このコマンドを正しく実行するのに問題があります。テーブルの最初の列は自動インクリメント整数なので、2 列目からデータの入力を開始したいと考えています。
PREPARE fooplan (text, smallint, smallint, text, date, timestamp with time zone) as
INSERT INTO "table" VALUES($2, $3, $4, $5, $6, $7);
EXECUTE fooplan('Add New Record', 2, 2, 'User', '1999-Jan-08', '04:05:06');
次のエラーが表示されます。
SQL error:
ERROR: column "category_id" is of type smallint but expression is of type text
LINE 2: insert into "MOP" values($2, $3, $4, $5, $6, $7);
^
HINT: You will need to rewrite or cast the expression.
In statement:
prepare fooplan (text, smallint, smallint, text, date, time without time zone) as
insert into "MOP" values($2, $3, $4, $5, $6, $7);
execute fooplan('Add New Mop', 2, 2, 'User', '1999-Jan-08', '04:05:06');
私が間違っていることを誰かが理解するのを手伝ってくれますか?