BUG #16796: Issue While passing null as value during procedure/Function Call from Groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

BUG #16796: Issue While passing null as value during procedure/Function Call from Groovy

apt.postgresql.org Repository Update
The following bug has been logged on the website:

Bug reference:      16796
Logged by:          Jeevitha Manickavasagam
Email address:      [hidden email]
PostgreSQL version: 12.3
Operating system:   64-bit Operating system
Description:        

Issue While passing null as value during procedure/Function Call from
Groovy.
We have a below Procedure in Postgresql

CREATE OR REPLACE PROCEDURE schemaname.procedurename(
        INOUT out_ctid integer DEFAULT NULL::integer,
        in_ctname character varying DEFAULT NULL::character varying,
        in_address1 character varying DEFAULT NULL::character varying,
        in_address2 character varying DEFAULT NULL::character varying,
        in_address3 character varying DEFAULT NULL::character varying,
        in_address4 character varying DEFAULT NULL::character varying)
LANGUAGE 'plpgsql'
AS $BODY$
BEGIN
    INSERT INTO schemaname.tablename (ctid_new, ctname, address1, address2,
address3, address4)
    VALUES (nextval('schemaname.ct_sq'), in_ctname,  in_address1,
in_address2, in_address3, in_address4,);
    out_ctid := currval('schemaname.ct_sq');
END;
$BODY$;

We are facing Calling this procedure from Groovy ( using
postgresql-42.2.14.jar and also replaced with latest jar -
postgresql-42.2.18.jar)

Below is our calling statement
sql.call("call
schemaname.procedurename(${​​​​​​​​Sql.INTEGER}​​​​​​​​,$ctName,$address1,$address2,$address3,$address4)")
   //values of all address variables are null

we are getting the below error

SQL Exception: ERROR: procedure schemaname.procedurename(character varying,
unknown, unknown, unknown, unknown) does not exist
  Hint: No procedure matches the given name and argument types. You might
need to add explicit type casts.
  Position: 6