Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old May 12th, 2004, 01:24 PM
newmem newmem is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 4 newmem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy compile errors in procedure

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.

Reply With Quote
  #2  
Old May 12th, 2004, 01:47 PM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 5
Place the semicolon ( at the end of every SQL statement like :

SELECT SYSDATE FROM DUAL;

Reply With Quote
  #3  
Old May 12th, 2004, 02:03 PM
newmem newmem is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 4 newmem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs down new error after putting ;

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;

Reply With Quote
  #4  
Old May 12th, 2004, 02:11 PM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 5
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.

Reply With Quote
  #5  
Old May 12th, 2004, 02:47 PM
newmem newmem is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 4 newmem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

thanks. it worked!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > compile errors in procedure


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway