pjofnj has asked for the wisdom of the Perl Monks concerning the following question:
Thanks, PJOfNJforeach my $sub (keys %data) { ($Artist, $Song) = split(/\|/, $sub); $DictIDNums = join(", ", @{$data{$sub}}); $CheckQuery = "Insert into MeterMusicTemp..QCStuff Select dictid,f +ilename,'$Song' from (select dictid,filename,artist,title,song,path,h +holdid,updated_by,filesize from FMDATAFILE3 where PPMonth=$PPMonth a +nd ($RuleID) and dictid in (select dictid from dictionary d,artist a, +song s where d.artistid=a.artistid and d.songid=s.songid and artist=' +$Artist' and song = '$Song') and matchlevel<3) as T1 where lower(File +Name) not like lower('%$Song%') order by filename "; print "$CheckQuery\n"; my $dbh = DBI->connect( "DBI:ODBC:MusicWatch", "App_User", "au", { + RaiseError => 1, AutoCommit => 0 }); eval { $dbh->do("$CheckQuery"); $dbh->commit( ); }; if ($@) { eval { $dbh->rollback( ) }; die "Couldn't roll back transaction" if $@; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Insert into DB problem
by jZed (Prior) on May 25, 2005 at 15:52 UTC | |
by pjofnj (Initiate) on May 25, 2005 at 16:01 UTC | |
by jZed (Prior) on May 25, 2005 at 16:09 UTC | |
|
Re: Insert into DB problem
by terce (Friar) on May 25, 2005 at 16:07 UTC | |
by pjofnj (Initiate) on May 25, 2005 at 16:55 UTC | |
|
Re: Insert into DB problem
by mifflin (Curate) on May 25, 2005 at 15:49 UTC | |
by pjofnj (Initiate) on May 25, 2005 at 15:56 UTC | |
by mifflin (Curate) on May 25, 2005 at 16:00 UTC | |
|
Re: Insert into DB problem
by Grygonos (Chaplain) on May 25, 2005 at 17:46 UTC |