Skip to Main Content

Oracle Database Discussions

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!

Anonymous Block with Variable and SELECT

metalrayOct 27 2010 — edited Oct 27 2010
Hi Guys,
I am struggling to connect the material I am learning. I read about anonymous blocks and variables so I want to write a
nice and neat select with all the fancy stuff (variables, exceptions) to get it right and to it as I read in the book.

DECLARE
MYSTRING VARCHAR(10);
MYSTIRNG := 'X';
BEGIN
SELECT * FROM DUAL WHERE DUMMY = MYSTRING
END;


but....this causes one error after the other. Am I getting the concept wrong here or is it a syntax error?
This post has been answered by Hoek on Oct 27 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2010
Added on Oct 27 2010
6 comments
4,243 views