Excellent point,
Barb!
PL/SQL has limitations to the SQL that it can execute
natively (i.e., SQL that it can process without the benefit of the "EXECUTE IMMEDIATE" directive). PL/SQL can natively execute:[ul][li]SQL
Data-Manipulation Language(DML) verbs:[/li][ul][li]SELECT...[/li][li]INSERT...[/li][li]UPDATE...[/li][li]DELETE...[/li][li]COMMIT[/li][li]ROLLBACK[/LI][/ul][li]And the above commands
only when all of the tokens (i.e., syntactical "pieces") of the commands are fully resolvable (i.e., "defined") at the time that PL/SQL's SQL parser attempts to check the syntax of the DML statement.[/li][/ul]In
Ceccina's case, the specific sequence name (the value of "name_seq") is not known at the time that
Ceccina wants to
CREATE OR REPLACE FUNCTION PROT_GEN. Therefore, we must tell PL/SQL to
delay the syntax checking of the
SELECT... statement until the moment that
Ceccina actually executes the function.
Did that take care of business?
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services:
www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”