Re: PL/SQL - Can I SELECT variables?

From: Vinicius Viana <vviana_at_aton.inf.ufrgs.br>
Date: Wed, 14 Jul 1999 14:52:56 -0300
Message-ID: <378CCE77.3C09F2EA_at_aton.inf.ufrgs.br>


Try to select these variables from the system table dual.

SELECT var1, var2 FROM dual;

The dual table is a table with only one row.

Greg Smith wrote:

> Does anyone know how to get the value of a variable in PL/SQL into a
> result set easily? In Transact-SQL, I believe all I have to do is
>
> SELECT var1, var2
>
> and I get a result set with a row containing the variable values. But
> in PL/SQL, I can't write this simple SELECT. It always wants a FROM
> clause, but I don't really have anything I'm SELECTing from, other than
> the variables themselves.
>
> (BTW - what I'm really trying to do is get those OUT variable back into
> my Perl DBI routine. The DBI bind for variables appears to be good only
> for setting up IN variables. The best way I can see to get back the OUT
> variables is to SELECT them and then use DBI's bind_column feature, from
> which I'll be able to read their values.)
>
> Thanks for any help.
>
> Greg Smith
Received on Wed Jul 14 1999 - 19:52:56 CEST

Original text of this message