Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Interpolating subroutine call in SQL INSERT INTO SELECT statement

by shadowsong (Pilgrim)
on Aug 26, 2015 at 09:35 UTC ( #1139989=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    INSERT INTO TABLE2 (COLUMN1, COLUMN2, COLUMN3)
    SELECT COLUMN1, COLUMN2, COLUMN3
    FROM TABLE1 WHERE COLUMN4='FOOBAR'
    
  2. or download this
    ...
    my $statement = 
    ...
         "SELECT COLUMN1, COLUMN2, COLUMN3 \n".
         "FROM TABLE1 WHERE COLUMN4=?";
    my $rv  = $dbh->do($statement, {}, 'foo');
    
  3. or download this
    ...
    my $statement = 
    ...
         "SELECT COLUMN1, COLUMN2, COLUMN3 \n".
         "FROM TABLE1 WHERE COLUMN4=?";
    my $rv  = $dbh->do($statement, {}, 'foo');
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1139989]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2019-07-24 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (32 votes). Check out past polls.

    Notices?