UPDATE_hoge_SQL="CREATE OR REPLACE FUNCTION update_hoge( DATE,TIME,TEXT,TEXT,TEXT,TEXT,TEXT,TEXT,TEXT,TEXT,TEXT,TEXT,TEXT,TEXT, TEXT,TEXT) RETURNS void AS ' BEGIN IF NOT EXISTS( SELECT SALES_DATE FROM hoge WHERE SALES_DATE=\$1 AND SHOP_CD=\$4 AND REGISTER_CD=\$5 AND RECEIPT_NO=\$6 ) THEN INSERT INTO hoge VALUES( \$1, \$2, \$3, \$4, \$5, \$6, \$7, \$8, \$9, \$10, \$11, \$12, \$13, \$14, \$15, \$16 ); END IF; RETURN; END; ' LANGUAGE plpgsql;"