Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: simple questions

Re: simple questions

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 15 Nov 1999 08:36:34 -0500
Message-ID: <GQwwOAg2HKuYwCHf4dpmBfSghd+5@4ax.com>


A copy of this was sent to "Alan Sze" <alan_at_icon.com.hk> (if that email address didn't require changing) On Mon, 15 Nov 1999 20:45:39 +0800, you wrote:

>
>The SELECT .... FROM dual doesn't work for me...
>How to declare a variable in sqlplus so that I can use var_a :=
>package_a.function_a(....) ???
>
>Thanks again..
>
>-- Alan
>

you can:

SQL> set serveroutput on
SQL> exec dbms_output.put_line( your_function( 'x', 'y' ) );

or

SQL> declare
   >     return_string varchar2(255);
   > begin
   >     return_string := your_function(...);
   > end;


or

SQL> variable x varchar2(255)
SQL> exec :x := your_function(....);

>
>
>aquabubble <aquabubble_at_geocities.com> wrote in message
>news:80oprg$qc9$1_at_nnrp1.deja.com...
>> In article <80ol4b$4c0$1_at_news.hk.linkage.net>,
>> "Alan Sze" <alan_at_icon.com.hk> wrote:
>> >
>> > Hi, all,
>> >
>> > I would have a few simple questions to ask.
>> > How to call a function within a pl/sql package in SQLPlus ??
>> > and how to display the return value??
>> >
>> > I've used
>> > call package_a.function_a('para A', 'para B', 0, 'para C', 'para
>> D');
>> > but it said
>> > *
>> > Error in line 1:
>> > ORA-00904: Invalid column name.
>>
>> You could use:
>>
>> SELECT package_a.function_a('para A', 'para B', 0, 'para C', 'para D')
>> FROM dual;
>>
>> HTH
>>
>>
>> Sent via Deja.com http://www.deja.com/
>> Before you buy.
>

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Nov 15 1999 - 07:36:34 CST

Original text of this message

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