View previous topic :: View next topic
|
Author |
Message |
Sriram K
New User
Joined: 17 Feb 2009 Posts: 32 Location: Bangalore
|
|
|
|
Hi,
I want to validate whether the incoming date is valid or not for that i m using the below query
EXEC SQL
SELECT DATE(:WS-CHECK-DATE)
INTO :WS-TEST-DATE
FROM SYSIBM.SYSDUMMY1
END-EXEC
Is ther any other way to check the date instead of using SYSIBM.SYSDUMMY1 . Will it affect the performance if we use execute this for each record. |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
You can check for the return code -180 and -181 to check weather the date format and the date value is porper or not. |
|
Back to top |
|
|
Sriram K
New User
Joined: 17 Feb 2009 Posts: 32 Location: Bangalore
|
|
|
|
But many progarms do check for the below query often
EXEC SQL
SELECT DATE(:WS-CHECK-DATE)
INTO :WS-TEST-DATE
FROM SYSIBM.SYSDUMMY1
END-EXEC
Any idea when we should go for this. Any other way to check for valid date instead of checking the bad return code |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Do it programmatically .. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
Hi Sriram
What you have coded is correct. But here also you have to check for the bad SQLCODE (-181, -180). You can also use programming technique instead of using SQL to check the validity of the date value.
Regards
Raghu |
|
Back to top |
|
|
|