Re: DBMS_SQL question ?
Date: 1996/07/25
Message-ID: <4t8avf$7m0_at_inet-nntp-gw-1.us.oracle.com>#1/1
In article <4t6p09$fho_at_dailyplanet.wam.umd.edu>, albewong_at_wam.umd.edu (AlBeRt tHe GoD) writes:
|> How to return a value using dbms_sql ?
|>
|> I parse a sql statement using dbms_sql.parse for selecting a count(*)
|> on a table, now I want to return the count on the table to a variable
|> how can I do this ?
|>
|>
|> Thanks ..
You need to use the following sequence of calls:
PARSE the statement
bind any input variables using BIND_VARIABLE
define the output variables (you have only one, since you are selecting count(*)
using DEFINE_COLUMN
execute the query using EXECUTE
fetch the row with FETCH_ROWS
use COLUMN_VALUE to get the answer back into a PL/SQL variable.
For more info, see the Application Developer's Guide or Chapter 10 of _Oracle PL/SQL Programming_ (info below).
Let me know if you have any more questions.
Scott Urman Oracle Corporation surman_at_us.oracle.com
Author of _Oracle PL/SQL Programming_ ISBN 0-07-882176-2 Published by Oracle Press - http://www.osborne.com/oracle/index.htm
"The opinions expressed here are my own, and are not necessarily that of Oracle Corporation"
Received on Thu Jul 25 1996 - 00:00:00 CEST