11-12-2015 2:51 PM
Hi all,
i need to insert rows into Oracle external database. It's work fine with Native SQL instruction but i have a problem with date fields, the system goes back me an error.
My Oracle database is created like this :
CREATE TABLE ENT_ENTITE(
ENT_No number(8) NOT NULL,
ENT_DenSoc varchar(80) NOT NULL,
TET_Code char(16) NOT NULL,
ENT_CodeSiret varchar(14) NULL,
ADR_Rue varchar(50) NULL,
ADR_ComplRue varchar(50) NULL,
ADR_Cedex varchar(10) NULL,
ADR_CodePostal varchar(16) NULL,
ADR_Ville varchar(32) NULL,
ADR_CodePays char(32) NOT NULL,
ENT_DtCessation date NULL,
GRE_No number(6) NULL,
DT_Mod date NOT NULL,
constraint PK_ENT_ENTITE primary key (ENT_No)
)
In my ABAP code, if i fill the field 'ENT_DtCessation4 with the value 'NULL', the system return the following error :
"con=1(SAPEXTST.WORLD): ORA-01858: a non-numeric
character was found where a numeric was expected"
I don't know why.
Thansk for your help.
Regards,
Eric
11-15-2015 8:10 PM
From error it seems that system is interpreting NULL as a string.
You can try passing NULL without quotes(' ') OR pass '00000000'(in quotes).
11-18-2015 3:30 PM
Hi,
thanks for your answer, unfortunately it don't work.
I use the query :
INSERT INTO ENT_ENTITE values (?,?,?,?,?,?,?,?,?,?,to_date(?,''yyyymmdd''),?,to_date(?,''yyyymmdd''))'.
If if pass the value :
ls_oracle_partner-ent_dtcessation = sy-datum.
It work fine.
If if pass the value :
ls_oracle_partner-ent_dtcessation = 'NULL'.
It don't work.