in reply to Re^2: dbi placeholders
in thread dbi placeholders
this is very interesting but get an error: 'statement has no result column' in the $sth2->bind_columns linemy %rec; my $sth1 = $dbh_0->prepare ("select * from production.computersystem") +; my @fields = @{$sth1->{NAME_lc}}; $sth1->bind_columns (\@rec{@{$sth1->{NAME_lc}}}); my $sth2 = do { local $" = ", "; my $sql = "insert into barrycomputersystem (@fields) values (@{ +[('?')x@fields]})"; $dbh_1->prepare ($sql); }; $sth2->bind_columns (\@rec{@fields}); while ($sth1->fetch) { $sth2->execute; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: dbi placeholders
by Tux (Canon) on Aug 06, 2014 at 14:25 UTC | |
by fionbarr (Friar) on Aug 06, 2014 at 14:38 UTC | |
by poj (Abbot) on Aug 06, 2014 at 17:48 UTC | |
by marto (Cardinal) on Aug 06, 2014 at 14:43 UTC | |
by fionbarr (Friar) on Aug 06, 2014 at 15:00 UTC | |
by Tux (Canon) on Aug 06, 2014 at 14:47 UTC |