Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How is this called (generating SQL from SQL)

Re: How is this called (generating SQL from SQL)

From: Martin Doherty <martin.doherty_at_undisclosed.com>
Date: Mon, 16 Jan 2006 22:09:09 -0500
Message-ID: <FtZyf.44$Zr6.249@news.oracle.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US