Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: executing a query in a Stored Procedure

Re: executing a query in a Stored Procedure

From: <eoin7_at_my-deja.com>
Date: Thu, 24 Jun 1999 17:09:48 GMT
Message-ID: <7ktooi$bfu$1@nnrp1.deja.com>


Neal,

For what you are trying to do, you just might find it helpful to reference documentation on the OCI (Oracle Call Interface). This is the API that allows you to embed SQL calls into C programs. I have not worked with it a lot, but I do remember that there were examples of returning result sets from a procedure to a calling C program via arrays. I would guess that the JDBC API should be able to do the same kind of thing.
This documentation and examples come with the Programmer/2000 package. Sorry I can't be more specific.

In article <7ktkk0$9jf$1_at_nnrp1.deja.com>,   nealgran_at_my-deja.com wrote:
> Since my initial posting was vague and did not properly address the
real
> issue I am interested in, I will rephrase my question in more detail.
>
> I am creating a general purpose SQL interpreter in java using JDBC
to
> connect to various databases including Oracle. One problem that I
have
> is that there is a facility in the JDBC API to perform an
'executeQuery'
> statement on a stored procedure. This facility works fine with
> SQLServer for example, but when I tried to test it with Oracle, I
found
> that Oracles PL/SQL interface does not permit Stored Procedures to
> execute a query, and make the resultant table of that query available
to
> the caller.
>
> From the responses I have gotten, and thru examples on the Oracle
web
> site, I think may be able to use a cursor for this purpose. The
> implementation details are still vague to me, and if anyone can lend
> some insight, or point to a good reference on this topic, I would
> appreciate it.
>
> Thanks
>
> -Neal Gran
> Metaserver Inc.
> check out http://www.mserver.com to see our revolutionary web
> application server technology
>
> In article <7krcta$g8j$1_at_nnrp1.deja.com>,
> nealgran_at_my-deja.com wrote:
> > When I try to perform a query in a stored procedure it does not
> compile.
> >
> > The PL/SQL syntax I used is as follows:
> >
> > Create Procedure GetInfo AS
> > BEGIN
> > select Field1 from MyTable;
> > END;
> >
> > Does this have to do with the handling of the resultant table from
the
> > query? If I replace the query with a directive the Stored procedure
> > compiles.
> >
> > Sent via Deja.com http://www.deja.com/
> > Share what you know. Learn what you don't.
> >
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu Jun 24 1999 - 12:09:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US