dcsimg
calling a script and using the results
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   chris_matthews
Posted On:   Wednesday, October 2, 2002 01:12 AM

HI All, I want to call an sql script which produces a couple of numbers for results. I would like to call this script and make the result be part of a ResultSet object for later display. My question is how to go about this. I have a number of prepared statements calling Oracel stored functions and procedures, but i am unsure how to call a script. The script cannot be rewritten into a procedure as it is nearly 200 lines and since I didn't write it I don't fully understand all the bits. I would just like to use the results......... Can a prepared statement be used, or a simple statement or what ?? thanks in advance, Chris    More>>
			HI All,
			

I want to call an sql script which produces a couple
of numbers for results. I would like to call this script
and make the result be part of a ResultSet object for later
display.

My question is how to go about this. I have a number
of prepared statements calling Oracel stored functions
and procedures, but i am unsure how to call a script.
The script cannot be rewritten into a procedure as it
is nearly 200 lines and since I didn't write it I don't
fully understand all the bits. I would just like to use
the results.........

Can a prepared statement be used, or a simple statement or
what ??

thanks in advance,
Chris
   <<Less

Re: calling a script and using the results

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, October 2, 2002 06:30 AM

When you say a "script", I assume you mean a file of SQLPlus commands, that you would run in "SQLPlus"? (e.g., valid SQL statements plus some Oracle proprietary extension statements just for SQLPlus' benefit, such as "set serverout on", "ttitle", "set linesize", or any of its "set" commands etc.?)



How would you imagine running such a thing inside Java, instead of inside SQLPlus? You could run each valid SQL statement as a JDBC statement, as long as the SQLPlus proprietary extension statements aren't crucial to the results.



If the SQLPlus extensions are important though (e.g. if you use serverout to get your final number output, etc.) then your best bet might be, in the short term, to just run SQLPlus, from inside Java. But then you wouldn't get your ResultSet out of it.

About | Sitemap | Contact