|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi all
I have been mainly worked with SQL2K and never with Oracle. So pls bear with me. I'm trying to write a procedure which simply returns the system date. - CREATE OR REPLACE PROCEDURE TESTDT IS BEGIN SELECT SYSDATE FROM DUAL END; when I execute this proc in (SQL*Plus Worksheet), I get compilation error as follows - PLS-00103: Encountered the symbol "END" when expecting one of the following: . , @ ; for <an identifier> Can someone help me with this error? thanks a ton. |
|
#2
|
|||
|
|||
|
Place the semicolon (
at the end of every SQL statement like :SELECT SYSDATE FROM DUAL; |
|
#3
|
|||
|
|||
|
After adding ; at the end of the select statement, I get new error:
Line 4/3 PLS-00428:an INTO clause is expected in this SELECT statement. SQL statement ignored. Here's what the SP looked like - CREATE OR REPLACE PROCEDURE TESTDT IS BEGIN SELECT SYSDATE FROM DUAL ; END; |
|
#4
|
|||
|
|||
|
CREATE OR REPLACE PROCEDURE TESTDT
IS P_DATE DATE; BEGIN SELECT SYSDATE INTO P_DATE FROM DUAL ; END; Must have a variable to save the every column values those are defined in SELECt statement. |
|
#5
|
|||
|
|||
|
thanks. it worked!
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > compile errors in procedure |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|