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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Variable Question

Re: PL/SQL Variable Question

From: <ashesh48_at_my-dejanews.com>
Date: Sat, 28 Nov 1998 21:23:59 GMT
Message-ID: <73ppl3$nvb$1@nnrp1.dejanews.com>


In article <737t8m$rfu$1_at_nnrp1.dejanews.com>,   shirushah_at_hotmail.com wrote:
> How do you assign, from the row of data that you have selected with a rowtype
> variable, just the data from one column into a variable? Here is an example
>
> SQL> variable li_deptname varchar2(20);
> SQL> declare
> li_dept dept%rowtype;


I guess it is as follow...

        li_deptname li_dept.loc ;
OR
u can create a cursor...
create cursor dept_cur
 is select loc from li_dept ;

then u can use the cursor...

HTH Ashesh

> begin
> select * into li_dept
> from dept
> where deptno = 40;
> end;
>
> In the dept table exsits a loc column, how do I get only data from that one
> column and assign it to the host variable li_deptname?
>
> Thanks in advance
>
> SS
> &#137;
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Sat Nov 28 1998 - 15:23:59 CST

Original text of this message

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