我的perl脚本:
my $dbh = DBI->connect("DBI:Oracle:MIGSTG","AI","migrate") or die " can't connect to db";
$data = "select package_id,action,line_seq,status,entry_date from pack_pr_queue where package_id = :p1";
$sth = $dbh->prepare($data) or die " cannnot prepare the select";
$sth->bind_param( ":p1", $package );
$sth->execute() or die "cannot execute";
while (@row = $sth->fetchrow_array) {
print "@row";
为传递值3687898 p1
我从脚本中获得此输出
3687898 Planned Release 2 OPEN 20-MAY-13
但是我从蟾蜍那里得到
3687898 Planned Release 2 OPEN 5/20/2013 3:40:36 AM
我想获得带有完整日期和时间的输出(5/20/2013 3:40:36 AM)
请给我一个建议
在entry_date上使用to_char:
to_char(entry_date,'DD/MM/YYYY HH:MI:SS AM')
$data = "select package_id,action,line_seq,status,to_char(entry_date,'DD/MM/YYYY HH:MI:SS AM') from pack_pr_queue where package_id = :p1";
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句