Exec Function - Encountered the symbol "SELECT" when expecting one of the f
543595Mar 14 2007 — edited Mar 14 2007Hi Can anyone help me with this one.
I'm trying to run a command from Oracle SQL *Plus or from my Toad editor and I'm getting the below error.
The function I'm trying to execute is:
EXEC GenerateNewCaseIDs(
(SELECT lot_Id, Current_Qty FROM DAT_LOT WHERE Lot_Number ='3375910172'),
'N');
The Function GenerateNewCaseIDs accepts 3 parameters.
The Exec works when I pass in the Parameters manually but I dont have the Lot_Id so I need the Select statement to pull this from the database.
The problem seems to be around the Select statement.
Can anyone tell me if this syntax allowed in the EXEC function or if there is another way to do this.
ERROR at line 1:
ORA-06550: line 1, column 38:
PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + case mod new not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternativ
ORA-06550: line 1, column 109:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
. ( * @ % & - + ; / at for mod remainder rem
<an exponent (**)> and or group having intersect minus order
start union where connect || multiset