×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




What sort of date value do you expect to get by passing blanks into a date-type? I'd guess that SQL tries to help by initializing the field to a default (and valid) date value.

-Eric DeLong

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Robert Rogerson
Sent: Thursday, February 02, 2012 8:56 AM
To: RPG programming on the IBM i / System i
Subject: Date in External Stored Procedure not as expected...


Hi All,

I have the following stored procedure:

CREATE PROCEDURE CANLIB/GETSALES (
IN LISTTYPE VARCHAR(1) ,
IN ALLSTORES INTEGER ,
IN STORENUM INTEGER ,
IN MRKTREGION VARCHAR(1) ,
IN DSOREGION VARCHAR(1) ,
IN MISCREGION VARCHAR(1) ,
IN PEERGROUP VARCHAR(2) ,
IN STATE VARCHAR(2) ,
IN USERSTORES VARCHAR(50) ,
IN STOREGROUP INTEGER ,
IN DMA VARCHAR(30) ,
IN STARTDATE DATE ,
IN ENDDATE DATE ,
IN DATERANGE VARCHAR(3) )
DYNAMIC RESULT SETS 1
LANGUAGE RPGLE
SPECIFIC CANLIB/GETSALES
NOT DETERMINISTIC
READS SQL DATA
CALLED ON NULL INPUT
EXTERNAL NAME 'CANLIB/SPR0055 '
PARAMETER STYLE SQL ;
If I start a SEP on SPR0055 and call GetSales from iNav Run Sql Scripts
call getsales('I',1,0,'','','','','','',0,'','','0001-01-01','WTD');

When the program breaks (prior to the first executable statement) and I
press F5 (to execute the first statement) the value of the 12th parameter,
STARTDATE has a value of '2012-02-02' (today's date) even though I
specified ''.

Can anyone explain how or why STARTDATE is being populated with
'2012-02-02'?

Thanks in advance.

Robert Rogerson

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.