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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Two questions about PRO*C

Re: Two questions about PRO*C

From: Stephane Faroult <sfaroult_at_oriole.com>
Date: Thu, 22 Nov 2001 06:38:51 -0800
Message-ID: <F001.003CB8E9.20011122054518@fatcity.com>

ehsan sinavalda wrote:
>
> Hi All
>
> 1- I have a (char *) that contains a SQL statement,
> Can I apply it to database from a PROC program.
>

Yes, it's called dynamic SQL. EXECUTE IMMEDIATE is fine if it's DDL or hard-coded INSERT/UPDATE/DELETE. SELECTs are more or less complicated, depending on whether you already know the number and types of the items in the select list. The less you know about the statement, the more complicated it becomes. Check the demo programs.

> 2- How can I move a cursor to first record?

 Although OCI functions are beginning to have parameters pointing into the direction of scrolling back cursors (but so far only one direction is allowed, forwards), this is inherently unnatural to Oracle. Close the cursor and reopen it.

-- 
Regards,

Stephane Faroult
Oriole Corporation
Voice:  +44  (0) 7050-696-269 
Fax:    +44  (0) 7050-696-449 
Performance Tools & Free Scripts
--------------------------------------------------------------
http://www.oriole.com, designed by Oracle DBAs for Oracle DBAs
--------------------------------------------------------------
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephane Faroult
  INET: sfaroult_at_oriole.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Nov 22 2001 - 08:38:51 CST

Original text of this message

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