Subject | [IBO] Re: Extracting Table names from a SQL select statement |
---|---|
Author | sshowl09 |
Post date | 2009-03-08T13:01:45Z |
Thanks for the help Helen and Markus.
I need to take any SQL statement and extract from it all of the table names, as a stringlist perhaps.
Irrespective of the validity of the query (although obviously totally malformed SQL can't be parsed obviously) and irrespective of whether all, some or none of the tables actually exist.
I was hoping there might be a simple way to do it using IBObjects (which is a great library).
What I am hearing is I can either
1 - get into the parsing of the SQL statement string, in Markus' example leveraging off IB_Parse.
or
2 - Extract the table names from the exception messages that are raised when a table doesn't exist, whether this would work for tables that do exist, and aren't causing a problem I'm not sure.
Hmmmm.
Cheers
Sam H
I need to take any SQL statement and extract from it all of the table names, as a stringlist perhaps.
Irrespective of the validity of the query (although obviously totally malformed SQL can't be parsed obviously) and irrespective of whether all, some or none of the tables actually exist.
I was hoping there might be a simple way to do it using IBObjects (which is a great library).
What I am hearing is I can either
1 - get into the parsing of the SQL statement string, in Markus' example leveraging off IB_Parse.
or
2 - Extract the table names from the exception messages that are raised when a table doesn't exist, whether this would work for tables that do exist, and aren't causing a problem I'm not sure.
Hmmmm.
Cheers
Sam H