-
NEWBIE: declare causes ora-00936
Hi Gurus,
have just upgraded from 817 on HP to 9204
using exp, install new DB and imp.
Now the simple scripts don't start...
eg:
declare
c number;
d number;
sqlstring varchar2(2000);
begin
select date from dual ;
END;
/
exit
--------------------
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
JServer Release 9.2.0.5.0 - Production
sqlstring varchar2(2000);
*
ERROR at line 4:
ORA-06550: line 7, column 8:
PL/SQL: ORA-00936: missing expression
ORA-06550: line 7, column 1:
PL/SQL: SQL Statement ignored
I am obviously missing something important.
Maybe also an installation problem.
Application using SQL is fine - only my scripts.
Any ideas ??
Rgds
Nick
-
Re: NEWBIE: declare causes ora-00936
Originally posted by bc99
select date from dual ;
You mean sysdate.
Code:
SQL> select date from dual ;
select date from dual
*
ERROR at line 1:
ORA-00936: missing expression
Last edited by DaPi; 11-19-2004 at 09:07 AM.
-
also you need to select into something
or you will get
Code:
1 declare
2 c number;
3 d number;
4 sqlstring varchar2(2000);
5 begin
6 select sysdate from dual ;
7* END;
SQL> /
select sysdate from dual ;
*
ERROR at line 6:
ORA-06550: line 6, column 1:
PLS-00428: an INTO clause is expected in this SELECT statement
-
Many thanks the prompt replies -
I had hastily added the select from date as I needed
someting to follow the list of errors after the DECLARE.
The DECLARE was failing due to incomplete $LIB
parameters.
Once these were completed, the user can DECLARE everything and
doesn't complain anymore...
Thanks again
BC99 logged off
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|