Home » SQL & PL/SQL » SQL & PL/SQL » nvl function not working inside a procedure
nvl function not working inside a procedure [message #6550] Thu, 24 April 2003 15:26 Go to next message
Joe
Messages: 138
Registered: November 1999
Senior Member
I have a simple command that works at the command line:

update table_a
set some_column=nvl((select sum(col1) from table_b
where something=something),0);

However when I put this inside a procedure, I receive the error PLS-103...any ideas?
Re: nvl function not working inside a procedure [message #6551 is a reply to message #6550] Thu, 24 April 2003 15:38 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
The PL/SQL parser does not support all SQL syntax until 9i. What about just moving the NVL call inside the SELECT?

update table_a
   set some_column = (select nvl(sum(col1), 0)
                        from table_b
                       where ...);


This is fully supported in 8i PL/SQL.
Re: nvl function not working inside a procedure [message #6552 is a reply to message #6551] Thu, 24 April 2003 15:42 Go to previous message
Joe
Messages: 138
Registered: November 1999
Senior Member
Todd,
works like a champ...thanks.
Previous Topic: SQL query?
Next Topic: cursor closing
Goto Forum:
  


Current Time: Wed Apr 24 19:12:09 CDT 2024