in reply to Re: Re: Re: OT: Oracle SQL issues
in thread OT: Oracle SQL issues
my $qs = 'insert into Promotions (' . join(',', keys %{$hash->{promoti +on}} ) . ',Date_Created,Date_Modified) values (' . join(',', ('?') x scalar( keys %{$hash->{promotion}} ) ) . ',SYSDATE,SYSDATE)'; $sth = $dbh->prepare( $qs ); $sth->execute( @{$hash->{promotion}}{ keys %{$hash->{promotion}} } );
You'll note that my two SYSDATE entries are not part of the bind parameters because I'd expect bind to escape them as strings. When I do a dump of $hash->{promotion} (not quite the same data as I was using in my earlier example):
$VAR1 = { 'Title' => 'Signup PagePoints', 'Trigger_Value' => '', 'Uses_Maximum' => 0, 'Reward_Type' => '5', 'Reward_Quantity' => '50', 'Trigger_Quantity' => '', 'Uses_PerCustomer' => '1', 'Promotion_Phrase' => '50 free page points at signup!', 'Status' => 0, 'Date_Start' => undef, 'Trigger_Type' => '4', 'ID' => '1', 'Date_End' => undef, 'Reward_Value' => '' };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re:... OT: Oracle SQL issues
by seesik (Initiate) on Sep 13, 2001 at 20:11 UTC | |
by AidanLee (Chaplain) on Sep 13, 2001 at 21:06 UTC |