Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running an oracle pl/sql script from vb

Status
Not open for further replies.

AndyCooper

Programmer
Dec 23, 1999
1
US
I want to be able to run an oracle pl/sql script from a VB program and don't know the best way, or for that matter anyway to go about it. Anybody any ideas?<br>

<br>

thanks <br>

<br>

Andy
 
Use Orale Objects for OLE (OO4O). If you have the ORACLE client software on the machine then this is by far the best way to do it. You use the command:<br>
<br>
dim objdynasetresults as object<br>
<br>
set objDynasetResults = OraDatabase.CreatePLSQLDynaset(&quot;Begin packagename.procedure:)mydynaset); end;&quot;, &quot;mydynaset&quot;, 0&)<br>
<br>
You can the access this reultant dynaset as you would any other OO4O dynaset. I did this this morning and it works a treat.<br>
<br>
I originally got help on this from Zane E. Schott on the Oracle forum, and I thought I should mention him as I can't take all the credit.<br>
<br>
James :)
 
Have to agree with James there - Oracle Objects for OLE by far the best way to access Ora DB's. Doesn't have the advantage of portability that ODBC does but, as long as you don't need that, more than makes up for it with the facilities you get.<br>
<br>
Mike<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
OO4O I find is very portable, as it uses the underlying SQL*Net which allows the programs to use a TNS entry and if the location changes you just change the TNS entry - no need to recompile the application. I find that it is also infinitely more stable than ODBC, and you can alose use native ORACLE SQL rather than what is provided via ODBC. Hey, I should get a job as an ORCALE salesman, wonder if I can get something from ORACLE for this sales pitch?<br>
<br>
James :)
 
&lt;grin&gt; by not portable - i meant between different database systems, like informix, db2, access etc. rather than between oracle databases in different places.<br>
<br>
You're right in that regard though. TNS is a &quot;good thing&quot; because of that flexibility it gives you.<br>
<br>
Regards<br>
<br>
Mike<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top