Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problems passing timestamp variable to block-SQL command not properly ended

851516Mar 30 2011 — edited Mar 30 2011
Can you please help me answer or direct me to resources in answering the following.

I'm attempting to pass a timestamp variable to a block but am getting errors with every method I've tried yet.

The example below is attempting to generate a list of all sales dates for orders after the 21st of March 2000.

DECLARE
BeginDate Orders.PurchaseDate%TYPE :=to_date('21-3-2000', 'dd-mm-yyyy');
Target Orders.PurchaseDate%TYPE;

BEGIN
DBMS_OUTPUT.PUT_LINE(to_char(BeginDate));
SELECT Distinct PurchaseDate from Orders into Target WHERE PurchaseDate>BeginDate;
END;

When running it - it returns
ORA-00933: SQL command not properly ended ORA-06512: at line 8
Please advise
This post has been answered by Thierry H. on Mar 30 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 27 2011
Added on Mar 30 2011
8 comments
728 views