Обсуждение: Function is giving execution error from inside the procedure

Поиск
Список
Период
Сортировка

Function is giving execution error from inside the procedure

От
M Sarwar
Дата:
 

Hi,

I am trying to create a simple procedure to updata  a table.

 

CREATE OR REPLACE PROCEDURE bronxdev.pr_asn_wafer_id_update(

                )

LANGUAGE 'plpgsql'

AS $BODY$

DECLARE

begin

 

UPDATE BRONXDEV.ASN_MANUFACTURER_PROFILE

SET WAFER_ID   =              BRIM(SERIAL_ID, '/')

;

commit;

--rollback;

END

$BODY$;

 

It is getting compiled without any issue but when I am trying to execute, I am getting BRIM function does not exist error message.

I have tried to google and few other resources and did not help.


Error:  ERROR: function brim(character varying, unknown) does not exist LINE 2: SET WAFER_ID = BRIM(SERIAL_ID, '/')


 

The same UPDATE is directly working from the pgadmin.

I have tried to change LANGUAGE from plpgsql to SQL and that did not help.

My postgres version is 13.2.

 

Thanks,

Sarwar

Re: Function is giving execution error from inside the procedure

От
"David G. Johnston"
Дата:
On Fri, Feb 2, 2024 at 8:04 AM M Sarwar <sarwarmd02@outlook.com> wrote:
 

Error:  ERROR: function brim(character varying, unknown) does not exist LINE 2: SET WAFER_ID = BRIM(SERIAL_ID, '/')



I suspect you wanted the btrim function, not the brim function.

David J.

Re: Function is giving execution error from inside the procedure

От
M Sarwar
Дата:
Hi David,
You are right. 
That is confirming that I messed up the characters in the code.
Thank you,
Sarwar


From: David G. Johnston <david.g.johnston@gmail.com>
Sent: Friday, February 2, 2024 10:30 AM
To: M Sarwar <sarwarmd02@outlook.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Function is giving execution error from inside the procedure
 
On Fri, Feb 2, 2024 at 8:04 AM M Sarwar <sarwarmd02@outlook.com> wrote:
 

Error:  ERROR: function brim(character varying, unknown) does not exist LINE 2: SET WAFER_ID = BRIM(SERIAL_ID, '/')



I suspect you wanted the btrim function, not the brim function.

David J.