Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: dbi style questions (code, discussion)

by guha (Priest)
on Dec 29, 2001 at 15:39 UTC ( [id://135106]=note: print w/replies, xml ) Need Help??


in reply to dbi style questions (code, discussion)

I mostly use something like

my $sqlstmt = <<SQL_A; select count(col1) from table1 where col1 = ? and col2 = ? and col3 = ? SQL_A
If the SQL statement gets really big I would consider wrapping it into a sub, aka

my $sqlstmt = def_sql_a; sub def_sql_a { return <<SQL_A; select count(col1) from table1 where col1 = ? and col2 = ? and col3 = ? SQL_A }
This is also consistent with hiding the gory details in a sub when creating "dynamic" SQL statements.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://135106]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-23 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found