Home » SQL & PL/SQL » SQL & PL/SQL » Can do it in SQL PLUS but not in PL/SQL
Can do it in SQL PLUS but not in PL/SQL [message #1185] Tue, 09 April 2002 11:13 Go to next message
Steve B
Messages: 1
Registered: April 2002
Junior Member
I have the following code which works in native SQL PLUS but which return an error (PLS-00103: Encountered the symbol "(" when expecting one of the following:
begin declare etc)

INSERT INTO scsen (fk_usstr_state_trtry_cd, us_state_anl_state_entlmnt_amt)
(SELECT DISTINCT scsme_state_cd,0
FROM scsme, scsen
WHERE
(select count(fk_usstr_state_trtry_cd)
FROM scsen,scsme
WHERE scsme.scsme_state_cd = scsen.fk_usstr_state_trtry_cd) =0 );
Is there a limit in the number of nested select where's in PL/SQL that there is not in SQL PLUS.

Thanks
Re: Can do it in SQL PLUS but not in PL/SQL [message #1192 is a reply to message #1185] Wed, 10 April 2002 06:39 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
you cannot issue this kind of sql statemetn in plsql.
use a cursor or
somemthing like this.
declare
var1
var2
..
begin
select ..... into var1,var2.... from scsen,sccme...

insert into scsen values( var1,var2....)
Previous Topic: dbms_output.put_line
Next Topic: could you help me import and export a file
Goto Forum:
  


Current Time: Fri Apr 26 11:07:40 CDT 2024