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: QUERY PROBLEM

RE: QUERY PROBLEM

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Fri, 19 Oct 2001 12:17:14 -0700
Message-ID: <F001.003B064F.20011019123603@fatcity.com>

> -----Original Message-----
> From: Harvinder Singh [mailto:Harvinder.Singh_at_MetraTech.com]
>
> We need to write a query like this:
>
> declare
> dd number;
> begin
> select * from t_acc where id_acc=dd;
> end;
> /

Get the result back to where? What kind of client application? Is the query returning only one row or multiple rows?

Here are two ways of doing it in SQL*Plus:

SQL> define def_var = "X"
SQL> select * from dual where dummy = '&def_var' ; ancien   1 : select * from dual where dummy = '&def_var' nouveau   1 : select * from dual where dummy = 'X'

D
-
X

SQL> variable bind_var varchar2 (1)
SQL> execute :bind_var := 'X'

Procédure PL/SQL terminée avec succès.

SQL> select * from dual where dummy = :bind_var ;

D
-
X Received on Fri Oct 19 2001 - 14:17:14 CDT

Original text of this message

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