develooper Front page | perl.perl5.porters | Postings from March 2000

Re: hook for qs// operator for embedded SQL?

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
March 20, 2000 08:10
Subject:
Re: hook for qs// operator for embedded SQL?
Message ID:
4.3.0.20000320104148.01cf9220@24.8.96.48
At 08:59 AM 3/20/00 -0600, Greg Bacon wrote:
>In message <MailDrop1.2d7j-PPC.1000320012616@perlfaq.com>,
>     "Joseph N. Hall" writes:
>
>: You p5p-ers may or may not understand the significance and popularity of
>: SQL and Perl but from my contact with the real world, it's headed toward
>: "huge."  A few syntactical nods in its direction will likely make Perl
>: many new friends a year or two down the road.
>
>I've only used DBI (as opposed to, say, Pro*C and friends) when talking
>to databases, so I have no idea what outsiders might want or expect
>(though reading people's code in *.pc makes me see that particular
>implementation as being rigid and inflexible).

I've used both. (As well as Pro*COBOL, though I don't like admitting that 
in public... :)

Embedded SQL is, without a doubt, terribly rigid and not particularly 
pleasant or perlish. On the other hand, at one point (the point where I was 
using Oracle regularly) I'd have killed, or at least given really nasty 
paper cuts, for it as a way to wean folks off of C. (It's amazing how many 
people write reports, including financial reports, in C. It's got to be one 
of the *least* suitable languages for that sort of thing...)

A qs (which I'd document as "quote special" rather than "quote SQL" that 
did some sort of function call would be great. If this:

   qs(select foo from bar where baz = $xyzzy);

got translated into:

   QS("select foo from bar where baz = ?", [{NAME => '$xyzzy',
                                              REFERENCE => \$xyzzy,
                                              TYPE => 'SCALAR'}]);

or something similar, would be really nice. Heck, the replacement character 
could be a null, or *something*, who cares what.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About