I need to create a stored procedure that checks if a particular accounts exists in the table If it exists
Need to create a custom function in PostgreSQL to update/insert a table. I need to pass around 200 values which unable to achieve. Some suggested to use Array as parameters. But its not working for me correctly. All 200 fields are combined with int, varchar, double, float etc. Also we cannot change the order.
Please tell me how to pass these as parameters and use them in update/insert statement.
My code looks something like this
create or replace function test(variadic text[])
....
Begin
Insert into customers (custno , company, firstname) values ($1[1],$1[2],$1[3]);
....
END;