开发者

Pass string value to bit data type work properly in Win XP but not in Win Server 2003

开发者 https://www.devze.com 2023-01-29 04:51 出处:网络
I have created function pgsql: Function Name: fn_add_xyz(integer,bit,boolean,text). When we call above function

I have created function pgsql:

Function Name: fn_add_xyz(integer,bit,boolean,text).

When we call above function

Cal开发者_开发知识库l Function: select * from fn_add_xyz(1,'1','true','hello');

through java application in window XP .it works properly.

But when we call above function through same Java application in Win server 2003. It gives error:

org.postgresql.util.PSQLException: ERROR: function fn_add_xyz(integer,character varying,character varying,text)does not exist
  Hint: No function matches the given name and argument types. You might need to add explicit type casts.

This problem occur in client environment. We have tested this in our environment, it works properly.


The function is defined as fn_add_xyz(integer, bit, boolean, text), while you are trying to call fn_add_xyz(integer, text, text, text).

Try putting explicit casts that match your function's signature and/or remove the quotes around the boolean value:

SELECT * FROM fn_add_xyz(1, '1'::bit, true, 'hello');
0

精彩评论

暂无评论...
验证码 换一张
取 消