pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pepe TD Vo <pepevo@yahoo.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: insert data with invalid input syntax for integer:"42P01"
Date: Mon, 11 Feb 2019 19:25:42 +0000 (UTC)
Message-ID: <2112371589.1866229.1549913142122@mail.yahoo.com> (raw)
References: <2112371589.1866229.1549913142122.ref@mail.yahoo.com>

Hello,
I am still getting ERROR: invalid input syntax for integer:"42P01" when I am insert a data into the table.CONTEXT: PL/pgSQL function cidr_staging.trigger_fct_tr_stg_adjudicative_status_ins() line 29 at assignment.Insert query:insert into cidr_staging.stg_adjudicative_status (receipt_number, adjudicative_action_date, adjudicative_time_stamp, adjudicative_status, mig_filename, mig_insert_dt, mig_modified_dt, mig_seq) values (E'LIN1890030316', E'20180409',E'0752',E'Dennied',E'c3_20180626_adjudicativestatus_000.txt',NULL,NULL,172011);the trigger is:Create or replace function cidr_staging.trigger_fct_tr_stg_adjudicative_status_in() RETURNS trigger AS $BODY$declarev_seq bigint:=0;v_ErrorCode bigint;V_ErrorMsg varchar(512)'v_Module varchar(32):= 'TR_STG_ADJUDICATIVE_STATUS_INS';BEGINBEGINselect nextval('sq_staging') into STRICT v_seq;if NEW.mig_seg is null then   NEW.mig_seq:=v_seq;enf if;if NEW.mig_filename is null then   NEW.mig_filename :='Unknown';end if;exceptionwhen others then   v_ErrorCode := SQLSTATE'   v_ErrorMsg := SQLERRM;   insert into cidrmgmt.errorlog(stamp, os_user, host, module, errorcode, erromsg) values (CURRENT_TIMESTAMP, sys_context('userenv','session_user'), sys_context('userenv','host'),v_Module, v_ErrorCode, v_ErrorMsg);END;RETURN NEW;end$BODY$LANGUAGE 'plpgsql';CREATE TRIGGER tr_stg_adjudicative_status_ins BEFORE INSERT ON cidr_staging.stg_adjudicative_status FOR EACH ROW  EXECUTE PROCEDURE cidr_staging.trigger_fct_tr_stg_adjudicative_status_ins(); the table definition is:
create table cidr_staging.stg_adjudicative_status (receipt_number character varying (13) not null,adjudicative_action_date character varying(8), adjudicative_time_stamp character varying(4),adjudicative_status character varying(50,mig_file_name character varying(80) not null,mig_insert_dt timestamp without time zone,mig_modified_dt timestamp without time zone,mig_seg bigint not null);
Triggers:"tr_stg_adjudicative_status_ins" before INSERT ON cidr_staging.stg_adjudicative_status FOR EACH ROW EXECUTIVE PROCEDURE cidr_staging.trigger_fct_tr_stg_adjudicative_status_ins()

even I take the "E" values out the error is still occurred but if I dropped the function and trigger, the insert is fine


thank you so much for looking into this error. Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success

view thread (12+ messages)  latest in thread

Message-ID: <2112371589.1866229.1549913142122@mail.yahoo.com>
Permalink:  ../2112371589.1866229.1549913142122@mail.yahoo.com/
Also on:    postgresql.org/message-id/2112371589.1866229.1549913142122@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: pepevo@yahoo.com, david.g.johnston@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: insert data with invalid input syntax for integer:"42P01"
  In-Reply-To: <2112371589.1866229.1549913142122@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox