Stick them in a here document and parse them out as separate SQL statements by splitting on ';' or whatever does separate them. Strip out comments first - and do a check to ensure ';' doesn't appear in a literal string and you should be OK. This is something I use from time to time.
Of course your source scripts may be very hard to parse out, and this won't work for you. -----Original Message----- From: Fernando Luna [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 9:14 PM To: [EMAIL PROTECTED] Subject: Your DBI book There is the need at my organization to process DDL statements contained in a group of SQL files. I would like to know what the known limitations are concerning this, specifically: I am running perl version 5.005_03 built for AIX Unix. I have Oracle version 8.1.7 installed and running. I have AIX version 4.3.3.0 I have installed the DBI and DBD::Oracle modules... I am able to execute queries and PL/SQL blocks using these modules with no problems. What I'd like to do is read a file that contains DDL statements and execute them through these modules. These files contain specifically CREATE TABLE statements CREATE INDEX statements CREATE PACKAGE/PACKAGE BODY statements CREATE trigger statements CREATE VIEW statements In some cases, these files have more than one statement in them. (example, creating several indexes on a table)... These are taken from PVCS Version manager and I would like to be able to run them in one session and show the output (that is, if compilation or creation fails). I've searched the DBI and DBD documentation and I've not found anything that specifically addresses this. I tried running one CREATE TABLE statement and it appears to choke on some keywords that Oracle has no trouble with, but I suspect has to do with the fact that they are not necessarily ANSI-SQL compliant. Is this something that might be covered in this book or can you tell me if this just cannot be done with these modules? Thanks Fernando Luna - Seattle, WA ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************
