I have been pouring over the forum and experimenting for the entire day and I cannot seem to make it work. I see a number of posts regarding stored procedures and postresql but none seem to show how the config.properties should be formatted. I've used variations on this:
Here is my procedure:
I am able to call the procedure using SQL in pgadmin4 and all works ok but here is what I see in my output window
Any help would be greatly appreciated
Larry
config.properties:
sql.proc_addcategory=call proc_addcategory(?,?,?,?,?)
sql.proc_addcategory = call proc_addcategory p_categoryid=? ,_categorytitle=? , _isactive=? , _categorydescription = ? , _categoryimage = ?
Here is my procedure:
Stored Procedure Code:
CREATE OR REPLACE PROCEDURE public.proc_addcategory(IN p_categoryid integer, IN _categorytitle character varying, IN _isactive integer, IN _categorydescription character varying, IN _categoryimage character varying)
LANGUAGE 'plpgsql'
AS $BODY$
declare
begin
if exists(select * from categoryinfo where categoryid = p_categoryid) then
update categoryinfo
set categorytitle = _categorytitle
,isactive = _isactive
,categorydescription = _categorydescription
,categoryimage = _categoryimage
where categoryid = p_categoryid;
else
insert into categoryinfo
(categorytitle
,isactive
,categorydescription
,categoryimage)
values
(_categorytitle
,_isactive
,_categorydescription
,_categoryimage);
end if;
end;
$BODY$;
I am able to call the procedure using SQL in pgadmin4 and all works ok but here is what I see in my output window
jrdc2 window output:
(PSQLException) org.postgresql.util.PSQLException: ERROR: syntax error at or near "p_categoryid"
Position: 27
Command: , took: 24ms, client=192.168.1.110
Any help would be greatly appreciated
Larry