[PostgreSQL] inconsistent types deduced for parameter $1
Posted: Thu 15 Sep 2011 15:39
Hi!
I use UniDAC 3.70.0.19, C++ Builder XE and PostgreSQL 9.0.4
Following query was causing 'inconsistent types deduced for parameter $1' error:
As far as You can see, I used param _f1 twice, and that was the problem, I think. I solved this by splitting this param into two new params:
But that's just provisional fix, or maybe I have to use each parameter only one time in a query?
Hope U'll solve this problem
Thx!
I use UniDAC 3.70.0.19, C++ Builder XE and PostgreSQL 9.0.4
Following query was causing 'inconsistent types deduced for parameter $1' error:
Code: Select all
INSERT INTO tbl_name (f1,f2,f3,f4,f5) VALUES (:_f1,:_f2,(SELECT id FROM tbl2_name WHERE name = :_f1),:_f4,:_f5) RETURNING id;
...
q->ParamByName("_f1")->AsString = "ala";
q->ParamByName("_f2")->AsString = "ma";
...
q->ParamByName("_f5")->AsString = "kota";
Code: Select all
INSERT INTO tbl_name (f1,f2,f3,f4,f5) VALUES (:_f1,:_f2,(SELECT id FROM tbl2_name WHERE name = :_f12),:_f4,:_f5) RETURNING id;
...
q->ParamByName("_f1")->AsString = "ala";
q->ParamByName("_f11")->AsString = "ala";
q->ParamByName("_f2")->AsString = "ma";
...
q->ParamByName("_f5")->AsString = "kota";
Hope U'll solve this problem
Thx!