Re: Dynamic SQL

From: Alvin W. Law <alaw_at_oracle.com>
Date: Sun, 13 Mar 1994 00:50:31 GMT
Message-ID: <ALAW.94Mar12165031_at_ap221sun.oracle.com>


In article <CMKnK5.L62_at_inesc.pt> ffs_at_vega (Filipe Santos) writes:

> I'm currently using ORACLE7 with SQL*Plus 3.1 and the C Precompiler ProC 1.5.
> I have been successful in creating a view dinamically using the precompiler.
> But of course I had to use a C compiler (in my case Visual C/C++) to do
> that. Still I would prefer to do it using SQL*Plus (it would be much easier
> writing a SQL script file than a C programm).
> What I would like to know is if it is possible to create dynamic SQL commands
> simply using SQL and PL/SQL commands.

There are two simple (relative speaking) ways to create dynamic SQL statements in SQL*Plus. You can directly use a SQL to paste the DDL statement or you can programatically construct the DDL using PL/SQL (assuming of course you have PL/SQL installed). Both involve spool a new SQL script and run either by start <filename> or _at_<filename>.

--
 Alvin W. Law .............................................. Oracle Corporation
 Senior Applications Engineer ..................... 300 Oracle Parkway, Floor 6
 Manufacturing Applications .......................... Redwood Shores, CA 94065
 Email: alaw_at_oracle.com ........... Voice: 1.415.506.3390 . Fax: 1.415.506.7299

ORA-03113: end-of-file on communication channel
Received on Sun Mar 13 1994 - 01:50:31 CET

Original text of this message