Title: RE: QUERY PROBLEM

> -----Original Message-----
> From: Harvinder Singh [mailto:[EMAIL PROTECTED]]
>
> 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

Reply via email to