Re: RFC: SQL::Preprocessor - a SQL filter for Perl

From: Dean Arnold (darnold_at_presicient.com)
Date: 07/26/04


Date: Mon, 26 Jul 2004 11:13:02 -0700
To: Jeff Zucker <jeff@vpservices.com>

Jeff Zucker wrote:
> Dean Arnold wrote:
>
>> - embedded SQL syntax for various databases
>> - possible feature requests/needs for optimal
>> Perl integration
>> - alternate namespace suggestions
>
>
> Are you actually going to be parsing SQL, or just looking for "EXEC SQL"
> and grabbing the SQL and feeding it to the drivers? If you're going to
> be parsing SQL, let's talk - I'm (slowly) rewriting SQL::Statement in
> Parse::Yapp and would be glad to collaborate in any way that would be
> helpful. If you're not going to be parsing SQL (other than to know
> where the statements begin and end), then I suggest a name more along
> the lines of SQL::Exec or SQL::Inline.
>

After some consideration, probably both.

I.e., if its just a std. SQL statement (SELECT, UPDATE, INSERT, DELETE etc),
then SQL::Preproc would recognize the intro keyword (required to be uppercase)
and parse the SQL. If a platform has some non-std extension, then the
EXEC SQL prefix would be required to pick it up.

RE: dbish...yes, you may be right...something for me to ponder
on the drive up to Portland...I guess I'm trying to come at perl
from the perspective of a 17 year SQL hacker, but relative perl
acolyte (well, hopefully more a journeyman now).

Being able to jump into perl to do database stuff by just
inserting the SQL statements, knowing a few implicitly
defined variables, and a minimal perl syntax for control flow,
might be a gentler introduction.

On the other hand, I might just be out of my tiny little mind...

- Dean



Relevant Pages

  • Re: use of DBI; I am getting multiple error messages mixed in with the correct output.
    ... T> expected a mature library like DBI to behave like this. ... I learned plenty about the perl side of things from her posts. ... closely represent the SQL idea of a null. ... trivially easy to perform bulk loads using the DB's particular ...
    (comp.lang.perl.misc)
  • ANNOUNCE - Muldis::DB v0.0.0 released, in p5+p6
    ... I am pleased to announce the release of Muldis::DB version 0.0.0 for Perl 5 on CPAN. ... If you want to read all the Muldis::DB documentation that exists now, I recommend doing so in this order: ... Muldis::DB implements a D language as defined by Hugh Darwen and Chris Date, and presents a superior interface for working with the relational model of data, contrasted with SQL. ...
    (perl.dbi.users)
  • Re: use of DBI; I am getting multiple error messages mixed in with the correct output.
    ... %%> Perl was to relate it to uninitialized values in Java or C++. ... %%> The idea of NULL in SQL is very different. ... mapping SQL NULLs to undef was a choice. ...
    (comp.lang.perl.misc)
  • Re: ANNOUNCE: SQL-Interpolate 0.31
    ... SQL-Interpolate does support variable references embedded in strings. ... Since a number of people I talked to distrust source filtering, I moved this capability into the separate module and made it entirely optional. ... I'm somewhat fond of your use of the ":" syntax though since this might clarify the special meaning and differentiate it from the standard Perl string interpolation. ... Some differences I see are that the core SQL::Interpolate module is not dependent on source filtering, and the SQL is treated more as a first-class object separate from the Perl code. ...
    (perl.dbi.users)
  • RE: Question with DBI versus PERL
    ... Question with DBI versus PERL ... statement at once (if I parse my SQL file) my pl/sql will work? ... All spool statements will turn to Perl print() calls. ... I want to know how can i run this sql script with DBI. ...
    (perl.dbi.users)