So since you would like for me to help improve this module then perhaps you
will allow to explain myself one more time (and CC'ed my personal message
to the group without my permission).

One this here page:
http://search.cpan.org/~rehsack/SQL-Statement-1.33/lib/SQL/Statement/Structure.pod#Executing_and_fetching_data_from_SQL_statements

There is this bit of code (i changed the SQL statement to fit my problem):

my $cache  = {};
my $parser = SQL::Parser->new();
my $stmt   = SQL::Statement->new('select foo.name from foo inner join bar
on foo.id=bar.id',$parser);
$stmt->execute( $cache );

I would like to do this:

my $sql = $stmt->get_sql;

Because i would like to do this:

my @tables = $stmt->tables();
my $date = '20120307' # today's date
$_ .= $date for @tables;

# now set the tables
$stmt->tables( @tables );

# and get the new sql
my $sql = $stmt->get_sql;

is $sql, 'select foo20120307.name from foo20120307 inner join bar20120307
on foo20120307.id=bar20120307.id', "WIN!";


In other words, i *thought* this module allowed the client to modify the
parsed SQL components and regenerate a new query. I can't imagine why this
module wouldn't provide such from the get-go. So, in conclusion, sorry that
you didn't understand my original email and thank you for expressing your
anger by copying my message without my permission.

Good luck.



On Sat, Apr 7, 2012 at 7:10 AM, Jens Rehsack <rehs...@googlemail.com> wrote:
> Am 7. April 2012 11:04 schrieb Jeff Anderson <captvanha...@gmail.com>:
>> On Sat, Apr 7, 2012 at 12:30 AM, Jens Rehsack <rehs...@googlemail.com>
wrote:
>>> Am 7. April 2012 01:30 schrieb Jeff Anderson <captvanha...@gmail.com>:
>>>> Greetings,
>>>>
>>>> I am wanting to take a SELECT statement and change the names of the
>>>> tables without IMMEDIATELY executing that statement. I was hoping that
>>>> SQL::Statement would solve the problem but apparently it can only
>>>> EXECUTE a statement. Is this true? I could not find anywhere that
>>>> deemed contrary in either the docs nor the source code.
>>>>
>>>> Seems to me that a lot of value is to be found in parsing statements,
>>>> changing them and then PRINTING them out or storing them as scalars
>>>> for execution at a later time.  Would you be so kind as to provide
>>>> this functionality? I honestly do not see any reason why it was not
>>>> made available from the first release of this code.
>>>>
>>>> Sorry for the tone, but i was highly disappointed to learn that such a
>>>> valuable and simple function was left out during my evaluation of this
>>>> software. We will most likely use an alternative, but maybe the next
>>>> person will not have to. Thanks in advance.
>>>
>>> Hey Jeff,
>>>
>>> please either open a ticket using RT or discuss it on dbi-dev@ or
>>> probably dbi-users@. For now, I cc dbi-dev@. For feature
>>> requests, cc'ing dbi-dev@ is always a good idea.
>>>
>>> To your mail itself: I absolutely don't know what you're talking about.
>>> No version information, nothing about the OS/distribution you use.
>>> No test describing what you're doing and what's failing.
>>>
>>> Probably you can fix this and after that worry about your tone ;)
>>>
>> Don't worry about it ... i just wanted confirmation that you really
>> didn't think to have such a valuable feature.
>
> Well, I don't know - because I don't understand what you want.
> But a "do what I mean" feature is indeed missing. Patches welcome.
>
>> I will "fix this" by simply not using your code. :)
>
> Well, great fix. I'm going to recommend it further.
>
> Impressive things in volunteer projects is that so many people
> kindly provide ideas, fixes and improvements.
>
> Thank you very much helping to improve SQL::Statement,
> Jens



-- 
jeffa

Reply via email to