Annpurna Mishra
Annpurna Mishra

Reputation: 11

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

I have created function pgsql:

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

When we call above function

Call 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.

Upvotes: 1

Views: 393

Answers (1)

Kouber Saparev
Kouber Saparev

Reputation: 8105

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');

Upvotes: 1

Related Questions