Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Variable Question
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
> ‰
>
> -----------== 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