SQL::Statement questions



Hi *,

I have a few questions regarding SQL::Statement:

The first one probably can only be answered by the quthor himself: Will
SQL::Statement be able to understand the "ALTER" command in the
future or do I have to implement it myself? I tried to activate it with
$sql_parser->feature( 'valid_commands', 'ALTER', 1 );
but that obviously isn't enough.
What about statements as "FOREIGN KEY" and "PRIMARY KEY" (see below)?

The second one: I have a file containing several SQL statements mainly
for creating and altering tables. This file is created by a case tool
for database design - for example:

------------------------< snip snip snip >-----------------------------
--- *************************************************************
--- Purpose : DDL script
--- Database : C
--- *************************************************************

--- =========================
--- DB table: Tray
--- C-Schema: fileSystem
--- =========================

CREATE TABLE Tray (
Tray_ID char NOT NULL,
Trayserver char ,
PRIMARY KEY (Tray_ID)
)
;

[...]

ALTER TABLE Tray
FOREIGN KEY (SpecialTableID) REFERENCES SpecialTable,
;

------------------------< snip snip snip >-----------------------------

I have to parse this file, check the syntax of the statements and then
transform them to something, which is completely different from SQL.
Is SQL::Statement the appropraite module for this or is there a module
that could do this job in a better way?
At the moment I read the file and cat all the lines together up to the next
semicolon. The resulting $sSQL is used as parameter for SQL::Statement:
$sql_statement = SQL::Statement->new( $sSQL, $sql_parser );

One more question: Is there any way to access the "column_defs" hashes
via object methods or do I have to read the structure directly (which
is deprecated as stated in the man page).


TIA.

Bye.
Michael.
--
Michael Hirmke | Telefon +49 (911) 557999
Wilhelm-Spaeth-Strasse 52 | FAX +49 (911) 557664
90461 Nuernberg | E-Mail mailto:mh@xxxxxxxxxxxxxxx
| WWW http://www.hirmke.de/
.



Relevant Pages

  • Re: Performance effect of adding a new index
    ... If this is a table in oracle and there's really a primary key defined ... changes in the indexes for a table can potentially affect quite a few ... You need to think carefully about what SQL statements will be improved ... Along with the thoughts included above, the first question needs to be ...
    (comp.databases.oracle.server)
  • Re: getting only first error when executing multiple sql statements
    ... > only get the first error out of Errors collection. ... > is the primary key. ... If I would execute the following SQL statements separately I ...
    (microsoft.public.data.ado)
  • Re: Multiple Table Creation in Access
    ... Allen Browne - Microsoft MVP. ... > Could you provide the macro or VBA assuming that the SQL statements are ... > stores in a table with a key to indicate order and a memo. ... >> How about a table, with a primary key to indicate the order, and a memo ...
    (microsoft.public.access.queries)
  • Re: access newbie
    ... I have amended the 'problems' table so that the primary key is now the ... pr_number, and removed the autoincrement number field, but I'm still having ... but Access doesn't seem to permit this (it keeps changing my SQL statements ...
    (microsoft.public.access.gettingstarted)