Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Nithin.

Asked: August 05, 2016 - 4:16 pm UTC

Last updated: August 07, 2016 - 4:34 am UTC

Version: DATABASE 11g EXPRESS EDITION

Viewed 1000+ times

You Asked

VARIABLE NAME CANNOT START WITH

A) NUMBER
B) SPECIAL CHARACTER
C) CHARACTER
D) ALL OF THE ABOVE

I KNOW THAT WE CANNOT START A VARIABLE USING NUMBER ALSO SPECIAL CHARACTERS EXCLUDING(&,#,_). THIS IS A QUESTION I GOT FOR AN EXAM AND I SELECTED AL FOUR THINKING BUT I GOT THE ANSWER WRONG SO WHICH ALL ARE THE ANSWER FOR THIS?

and Connor said...

Well... if you use quotes, you can use any of them...

SQL> declare
  2    "7abc" number;
  3  begin
  4    null;
  5  end;
  6  /

PL/SQL procedure successfully completed.

SQL> declare
  2    "*abc" number;
  3  begin
  4    null;
  5  end;
  6  /

PL/SQL procedure successfully completed.



So the question isnt really being precise enough. Remove the quotes from the examples above, and you'll get different results.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library