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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to