12.07.2015 Views

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<str<strong>on</strong>g>Soluti<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>Guide</str<strong>on</strong>g> <str<strong>on</strong>g>for</str<strong>on</strong>g> <str<strong>on</strong>g>Migrating</str<strong>on</strong>g> <str<strong>on</strong>g>Oracle</str<strong>on</strong>g> <strong>on</strong> <strong>UNIX</strong> <strong>to</strong> <strong>SQL</strong> <strong>Server</strong> <strong>on</strong> Windows 245$sql1 = OCIParse($c<strong>on</strong>n, "INSERT INTO countries VALUES (‘US‘,‘United States ofAmerica’, 2)");OCIExecute($sql1);// Insert <strong>SQL</strong> statement with binding$var1 = ‘MX’;$var2 = ‘Mexico”;$var3 = 3;$sql2 = OCIParse($c<strong>on</strong>n, "INSERT INTO countries VALUES (:bind1, :bind2,:bind3); ");OCIBindByName($sql2, ":bind1", $var1);OCIBindByName($sql2, ":bind2", $var2);OCIBindByName($sql2, ":bind3", $var3);OCIExecute($sql2);echo OCIRowCount($sql2) . " rows inserted. ";// CommitOCICommit($c<strong>on</strong>n);// Close c<strong>on</strong>necti<strong>on</strong>OCILogoff($c<strong>on</strong>n);?>The following example is the same PHP source code modified <strong>to</strong> use the MS<strong>SQL</strong>drivers. Note the difference in the commit functi<strong>on</strong>.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!