Re: feature request for SQL::Statement::Structure

Jeff Anderson <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <CAB0ignFKrAWvhhjm4hkRRFScbFf_og+YK=-cGgiR0FD=Qoyyvw@mail.gmail.com>
Like i said, i was mostly curious of the mindset behind this code that go
through the hard work of parsing a SQL statement but not providing the
ability to alter and reuse that statement.

You win the pointless code award. Congrats.



On Sun, Apr 8, 2012 at 4:59 AM, Jens Rehsack <[email protected]> wrote:

> Am 7. April 2012 18:01 schrieb Jeff Anderson <[email protected]>:
> > On Sat, Apr 7, 2012 at 7:10 AM, Jens Rehsack <[email protected]>
> wrote:
> >> Am 7. April 2012 11:04 schrieb Jeff Anderson <[email protected]>:
> >>> On Sat, Apr 7, 2012 at 12:30 AM, Jens Rehsack <[email protected]>
> >>> wrote:
> >>>> Am 7. April 2012 01:30 schrieb Jeff Anderson <[email protected]
> >:
> >>>>> 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
> >
> > So since you would like for me to help improve this module then perhaps
> you
> > will allow to explain myself one more time
>
> Glad to see it.
>
> > (and CC'ed my personal message to the group without my permission).
>
> 1st mistake. You gave me the permission to CC dbi-dev@ and/or dbi-users@
> or opening a ticket on CPAN containing your message by asking me via e-mail
> without having a valid business support contract. Please read SUPPORT
> section in S::S for details when you're allowed to mail me private.
>
> > 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.
>
> Well, sounds to me that you neither read the module documentation for the
> capabilities of SQL::Statement nor (reading your criticism about CC'ing
> your
> mail to the developer list) the support details. You simply assumed that me
> as the author of a name matching CPAN module will help you in private
> manner without any benefit for anyone except of yourself.
>
> If you're asking kindly on dbi-users@ using your above expectation,
> you might get an answer containing modules with appropriate features.
>
> > 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.
>
> Well, I don't express any anger by copying your mail to a public list,
> I followed the usual support workflow for non-commercial request.
>
> > Good luck.
>
> Thanks.
>
> Best regards,
> Jens
>



-- 
jeffa
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.