[pgsql-jp: 37578] now()について

Isamu Kanda k_isamu @ topaz.plala.or.jp
2006年 10月 17日 (火) 23:25:16 JST


はじめましてhideです。
下記はnow()にto_charを使い書式を変更したあとにINSERT文を実行しています。
言語はperlです。

#=====更新日時=====
$result4 = $conn->exec("SELECT to_char(now(), 'yyyy.mm.dd hh24:mi:ss')");
if ($result2->ntuples <= 0){
    exit;
}
$date = $result4->getvalue(0,0);

#=====INSERT実行=====
$result3 = $conn->exec("INSERT INTO bp_inquiry
(inquiry_id,bp_cat_id,serial_id,product_name,status,customers_email_address,cus
tomers_name,message,entry_date,up_date) VALUES
(nextval('bp_inquiry_seq'),'$bp_cat_id','$name', '$honbun',now())");

----------------------------------------------------------------------


下記は上記の二つの文をひとつの文にしようとして実行してみようと思ったのですが、実行できません。
二つの文にして実行していくしかないのでしょうか?
申し訳ありませんがアドバイスをお願いします。

#=====1つにしてINSERTを実行=====
$result3 = $conn->exec("INSERT INTO bp_inquiry
(inquiry_id,bp_cat_id,serial_id,product_name,status,customers_email_address,cus
tomers_name,message,entry_date,up_date) VALUES
(nextval('bp_inquiry_seq'),'$bp_cat_id', '$name', '$honbun',to_char(now(), 
'yyyy.mm.dd hh24:mi:ss'))");




pgsql-jp メーリングリストの案内