in reply to SQL Query Error
This will have the same effect as the CREATE TABLE AS SELECT , but does it in separate steps.$dbh->do(" CREATE TABLE saninfo (IP TEXT, Manufacturer TEXT, Model TEXT, OS TEXT, OSSP TEXT, RAM TEXT, CPUSpeed INT, CPUCount INT, CPUType TEXT, SOFT TEXT) "); my $select = $dbh->prepare(" SELECT hostinfo.IP, Manufacturer, Model, OS, OSSP, RAM, CPUSpeed, CPUCount, CPUType, SOFT FROM hostinfo JOIN software ON hostinfo.IP = software.IP WHERE SOFT LIKE '%Secure Path%' "); my $insert = $dbh->prepare(" INSERT INTO saninfo VALUES(?.?.?.?.?.?.?.?.?.?) "); $select->execute; while (my @row = $select->fetchrow_array) { $insert->execute(@row); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: SQL Query Error
by thor (Priest) on Sep 09, 2005 at 18:54 UTC | |
by jZed (Prior) on Sep 09, 2005 at 19:00 UTC | |
by thor (Priest) on Sep 09, 2005 at 19:02 UTC |