alex.TT2 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use DBI; use strict; my $tdate = $ARGV[0]; my $dbh=DBI->connect("dbi:Oracle:dbname",username,password,{RaiseError + => 1 , PrintError => 0}); my $x; open ($x, '>P_RUN_TIME_LOG.txt'); my $sqlstmt = "select to_date('$tdate','mm/dd/yyyy') from dual"; my $sth = $dbh->prepare($sqlstmt); $sth->execute() or die $dbh->errstr; my $tmp; $sth->bind_columns(undef, \$tmp); while($sth->fetch()) {$tdate = $tmp;} # LOOP THROUGH RESULTS $t = localtime(); print $x "DATE formatted at $t. Formatted DATE is $tdate.\n\n"; $t = localtime(); print $x "Executing FT_PROC at $t.\n\n"; $sqlstmt = "BEGIN FT_PROC($tdate); EXCEPTION WHEN others THEN sql_stmt := 'INSERT INTO P_LOG (PRCDR, FT_DATE, RUN_ST +ATUS) VALUES ('FT_PROC', $tdate, 1)'; execute immediate sql_stmt; END;"; $sth = $dbh->do($sqlstmt) or die $dbh->errstr; $dbh -> disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Placeholder Error (Placeholder :0 invalid, placeholders must be >= 1)
by PeterPeiGuo (Hermit) on Jan 14, 2011 at 01:47 UTC | |
|
Re: Placeholder Error (Placeholder :0 invalid, placeholders must be >= 1)
by Anonyrnous Monk (Hermit) on Jan 14, 2011 at 07:13 UTC | |
|
Re: Placeholder Error (Placeholder :0 invalid, placeholders must be >= 1)
by runrig (Abbot) on Jan 14, 2011 at 17:01 UTC |