Re: sql parser for oracle 9i
From: Pablo Sanchez <pablo_at_dev.null>
Date: Mon, 24 Feb 2003 12:13:32 -0600
Message-ID: <Xns932C7231E35A8pingottpingottbah_at_216.166.71.233>
>> You could write it using awk or Perl (or some other scripting lang)
>> which would look for statements begining with one of the SQL*Plus verbs
>> and ending with either a ';' or '/'.
>>
>> This would not validate the SQL as is done during the parse phase in
>> the database, but it would give you the statements.
>
> Given dynamic SQL I think any 'general' attempt is doomed.
Date: Mon, 24 Feb 2003 12:13:32 -0600
Message-ID: <Xns932C7231E35A8pingottpingottbah_at_216.166.71.233>
DA Morgan <damorgan_at_exesolutions.com> wrote in news:3E5A4C8B.A504814F_at_exesolutions.com:
> Ron Reidy wrote: >
>> You could write it using awk or Perl (or some other scripting lang)
>> which would look for statements begining with one of the SQL*Plus verbs
>> and ending with either a ';' or '/'.
>>
>> This would not validate the SQL as is done during the parse phase in
>> the database, but it would give you the statements.
>
> Given dynamic SQL I think any 'general' attempt is doomed.
Depending on the state of the original code, I would expect a very high hit ratio.
Also, rather than using awk/Perl, I'd use LEX/YACC -- those are the correct tools for the job.
-- Pablo Sanchez, High-Performance Database Engineering http://www.hpdbe.comReceived on Mon Feb 24 2003 - 19:13:32 CET