> Hytham,
>
> Although I haven't used SQL::Statement you can certainly do something
like:
>
> $condition = $1 if $statement =~ /where (.+)( order by .+){0,1}$/;
>
> I haven't tested this but I expect it to pick up the conditional part of
an
> SQL statement which would then be up to you to parse further if needed.
>
> In your example though you have assigned the SQL statement in the code.
> Therefore wouldn't it make more sense if this is really how the code works
> to do something like:
>
> my $cond = 'x=y';
> $statement = SQL::Statement->new("select 1,2,3 from table where $cond;");
>
> Then you parse upfront, so to speak. This is how I assemble queries on the
> fly for transactions that need that functionality.
>
> hth,
>
> Marty
nice way to get the where clause, but i don't want ot get data, nor insert
data, the sole purpose of my script is to type the select statement in more
tree-like structure, so i don't know the values of $cond to evaluate it,
besides, am using SQL::Statement for the pure purpose of parsing, no more,
no less, all what i wounder is, why am getting this error message, and how
to avoid it.
any help or new idea?

--
Hytham Shehab



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to