Home » SQL & PL/SQL » SQL & PL/SQL » Select into statements for several declared variables
Select into statements for several declared variables [message #269197] Fri, 21 September 2007 02:15 Go to next message
jimmy_t
Messages: 2
Registered: September 2007
Location: SWEDEN
Junior Member
Hi,
I want to use select into for several declared variables in a trigger but I don't seem to get the syntax right. This is how I write it:

SELECT col1
INTO var1,
col2 INTO var2,
col3 INTO var3
FROM TABLE_X
WHERE col1 = 'some value';

Any advice?

/ Jimmy
Re: Select into statements for several declared variables [message #269200 is a reply to message #269197] Fri, 21 September 2007 02:30 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

you need to do this way :

select <col1>,<col2>,<col3> into <var1>,<var2>,<var3> from your_table_name 




regards,

Re: Select into statements for several declared variables [message #269211 is a reply to message #269200] Fri, 21 September 2007 03:01 Go to previous message
jimmy_t
Messages: 2
Registered: September 2007
Location: SWEDEN
Junior Member
Thank you, works fine.
Previous Topic: Optional Field in form
Next Topic: Sending PDF Files from Oracle 8i
Goto Forum:
  


Current Time: Sat Dec 03 21:59:51 CST 2016

Total time taken to generate the page: 0.04339 seconds