|
I've always populated a date/time field with a "DEFAULT" date when I don't have a date value to populate.
However, I would like to get away from this if possible.
This is what I'm doing currently
test(de) *ISO SFDATE;
if not %error ;
SurveyDate = %date(SFDATE : *ISO);
Else ;
SurveyDate = defaultdate ;
EndIf;
stmt = JDBC_PrepStmt(conn : 'Insert Into ELECTRICSURVEY'
+ '(OBJECTID,'
+ ' SERVICENUMBER,'
+ ' SURVEYDATE,'
+ ' CREATIONUSER,'
+ ' VOLTAGE,'
+ ' COMMENTS)'
+ ' values (?,?,?,?,?,?)');
JDBC_setInt (stmt: 1: ID);
JDBC_setString (stmt: 2: SFEID);
JDBC_setDate (stmt: 3: SurveyDate);
JDBC_setString (stmt: 4: INSPECT);
JDBC_setDecimal (stmt: 5: VGREAD);
JDBC_setString (stmt: 6: DESCRIPT);
rc = JDBC_ExecPrepUpd( stmt );
SO if SFDATE is 0 in my file, can I set SURVEYDATE to null and if so how?
I've played around with this, but haven't had any success.
Thanks
Mike
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.