SQL::Statement questions
- From: mh@xxxxxxxxxxxxxxx (Michael Hirmke)
- Date: 20 Aug 2005 13:10:00 +0200
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/
.
- Follow-Ups:
- Re: SQL::Statement questions
- From: Jeff Zucker
- Re: SQL::Statement questions
- Prev by Date: Re: Need help in compilation of DBI.c
- Next by Date: Re: SQL::Statement questions
- Previous by thread: DBD Oracle column type
- Next by thread: Re: SQL::Statement questions
- Index(es):
Relevant Pages
|
|