Home » RDBMS Server » Server Administration » CURSOR, SELECT INTO, UNION
CURSOR, SELECT INTO, UNION [message #374255] Sat, 02 June 2001 16:32 Go to next message
Louis Fortier
Messages: 1
Registered: June 2001
Junior Member
I want to use Cursor based on this model

OPEN pListRole FOR
SELECT Field 1,
Filed2
INTO v1,
v2,

FROM XList
where...

UNION

SELECT Field1,
FIELD2
INTO v1,
V2
from XlIST x
WHERE...

A compilation error message appears when I use the second Into
(PLS-00103: Encountered the symbol "INTO" when expecting one of the following:

. ( , * @ % & - + / at mod rem
as
from)

Is it possible to use cursor this way ??

Louis
Re: CURSOR, SELECT INTO, UNION [message #374257 is a reply to message #374255] Sun, 03 June 2001 09:38 Go to previous message
Bala
Messages: 205
Registered: November 1999
Senior Member
Hi,

Keep your union as subquery like
SELECT Field 1,
Filed2
INTO v1,
v2,
FROM
(SELECT Field1, Field2
FROM XList
where...

UNION

SELECT Field1,
FIELD2
from XlIST x
WHERE...)

Bala.
Previous Topic: difference between oracle 7 and oracle 8
Next Topic: Re: What is use of 'raise' command in pl/sql
Goto Forum:
  


Current Time: Thu Jul 04 02:56:39 CDT 2024