Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How is this called (generating SQL from SQL)
Rauf Sarwar wrote:
> [snip]
>
>If you are looking for a general unofficial terminology used for this
>sort of thing then you can search for "Master/Slave sql script" or
>"Generate sql from sql script" in c.d.o.* and you will get few hits.
>
>Regards
>/Rauf
>
I think Rauf came closest .... "generated SQL", "generate SQL from SQL"
are both pretty common.... but I agree that there is no formal,
generally agreed upon name for this technique. It's just a special case
of the general technique of using programming to carry out a repetitive
task ... in this case, creating GRANT commands for a variety of objects.
Check out http://members.tripod.com/er4ebus/sql/ch17.htm
The same technique is applied to construct SQL statements at runtime for
execution in a program written in COBOL, C, PL/SQL etc.
e.g.
declare
sql_stmt = 'SELECT * FROM ';
begin
if trunc(sysdate) > '01-JAN-05' then
sql_stmt = sql_stmt || 'STATS_2005'; else
sql_stmt = sql_stmt || 'STATS_2004';
end if;
...
Martin Received on Mon Jan 16 2006 - 21:09:09 CST