Hi,
I have a PL1 program to load a DB2 table with datetime zone (null allowed)
Usually when i have to load null values, I used nullindicator with -1 value but here, with a datetime variable i received sqlcode = -180.
How can I do ?
Thx
here is the code : -
PTXB003: PROC OPTIONS(MAIN);
-
-
-EXEC SQL INCLUDE SQLCA;
-
EXEC SQL DECLARE GTXCINDI.RELEVE_PRIJSOPNAME TABLE
-
( . . .
-
D_MODIFIED_NOW_TS TIMESTAMP,
-
. . .
-
) ;
-
/*********************************************************************/
-
/* PLI DECLARATION FOR INPUT SEQ FILE */
-
/*********************************************************************/
-
1/* ----------------------------------------------------------------- */
-
/* INPUT */
-
/* ----------------------------------------------------------------- */
-
-DCL INFIL FILE RECORD;
-
0DCL 1 RELEVEP,
-
5 ...
-
5 D_MODIFIED_NOW_TS CHAR(26),
-
5 ...;
-
0ON ENDFILE(INFIL) BEGIN;
-
GOTO FIN;
-
END;
-
1/* ----------------------------------------------------------------- */
-
/* VARIABLES */
-
/* ----------------------------------------------------------------- */
-
0DCL (STRING,SUBSTR,TRANSLATE,MOD,INDEX,TIME,DATE) BUILTIN;
-
DCL PLIRETC BUILTIN;
-
DCL CTR PIC'999999' INIT(0);
-
DCL IND1 BIN FIXED(15) INIT(-1);
-
/* ------------------------------------------------ */
-
/* DEBUT TRAITEMENT */
-
/* ------------------------------------------------ */
-
OPEN FILE(INFIL) INPUT;
-
/* --------------------------------------------------------- */
-
/* TRAITEMENT */
-
/* --------------------------------------------------------- */
-
LECTURE: READ FILE(INFIL) INTO(RELEVEP);
-
IF RELEVEP.D_MODIFIED_NOW_TS ^= '' THEN IND1 = 0;
-
ELSE IND1 = -1;
-
EXEC SQL INSERT INTO GTXCINDI.RELEVE_PRIJSOPNAME
-
( ...,
-
D_MODIFIED_NOW_TS,
-
...)
-
VALUES
-
( :...,
-
:RELEVEP.D_MODIFIED_NOW_TS :IND1,
-
:...);
-
IF SQLCODE ^= 0 THEN DO;
-
PUT SKIP EDIT('ERREUR CREATION RELEVE_PRIJSOPNAME')(A);
-
GOTO ERRSQL;
-
END;
-
CTR = CTR + 1;
-
GOTO LECTURE;
-
/* --------------------------------------------------------- */
-
/* ERREUR SQL */
-
ERRSQL: PUT SKIP LIST ('ERROR RAISED ON FETCH :' , SQLCODE);
-
CALL PLIRETC(99);
-
FIN: PUT SKIP DATA(CTR);
-
CLOSE FILE(INFIL);
-
END PTXB003;
-
1 5437
sorry guys the problem is not a problem but a mistake in my input file.
Sorry for that
Sign in to post your reply or Sign up for a free account.
Similar topics
by: stefy |
last post by:
I'd like insert null value from a query but i can do it,
if my query is :
UPDATE table:name UPDATE euro='' WHERE id='5';
i have a sybase message warning like this :
Error converting data type...
|
by: FatboyCanteen |
last post by:
When I using dataset to append
a null value to the datetime field.
It throw a error -> can not convert db.null to system.date
Can there is any standard to pass a Null value
to the DateTime...
|
by: Martin R |
last post by:
Hi,
How to find first not null value in column whitout chacking whole table
(if there is a not null value then show me it and stop searching, the
table is quite big)?
thx,
Martin
*** Sent...
|
by: hemant123 |
last post by:
Hi
I Am Trying To Insert Null Value In Oracle Date Column Using Visual Basic 6 Textbox. I Tried Various Options But Unable To Insert. Please Advise Me A Solution.
Thanks In Advance
Hemant
|
by: hemant123 |
last post by:
Hi
I am trying to insert null value in date field using vbasic textbox.I tried various options but failed.Please tell me the solution.
Thanks in advance.
Hemant
|
by: billa856 |
last post by:
Hi,
I am trying to insert Null value in column(ShipDate) in my table.That column(ShipDate)'s type id date/time and format is short date.
I am using "" to insert Null in that column(ShipDate)...
|
by: RN1 |
last post by:
How do I insert NULL values in a SQL Server DB table in a column whose
datatype is int? This is what I am trying currently (in the
UpdateCommand event function of a DataGrid):
...
|
by: dmorand |
last post by:
I have this query that I'm using in coldfusion:
Insert into ps_manager_employee_ids (manager_emplid,emp_id,last_name,first_name,hire_dt,rehire_dt,emp_status,union_status)
values...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |