Update Date Field to NULL [message #117630] |
Thu, 28 April 2005 10:58  |
Scott Cowan
Messages: 15 Registered: February 2004
|
Junior Member |
|
|
I am working on behalf off a client who has a body of business logic built into black box procobol libraries. Now the only access , I have to certain schemas , is via the insert/update/delete functions residing in these libraries.
I am not allowed ( due to legal reasons to delete any records) or update them via a SQL call . How can I reset a previously set date field to NULL via an update ?? The issue is , if I supply an empty field then the original data isn't updated, if I supply a space then the data the system returns an invalid date string , so within the constraints of a 'YYYYMMDD' input string is it possible to provide a null value.
I'm about inform the client that this can't be done , but hopefully, somebody on here , might know otherwise.
|
|
|
Re: Update Date Field to NULL [message #117636 is a reply to message #117630] |
Thu, 28 April 2005 12:05   |
Steve Corey
Messages: 336 Registered: February 2005 Location: RI
|
Senior Member |
|
|
you can set a field = to NULL via an update DML. Aside from this, I'm not sure how else you could alter the table?
UPDATE table_name
SET date_column = NULL
WHERE
....
HTH,
Steve
|
|
|
Re: Update Date Field to NULL [message #117638 is a reply to message #117630] |
Thu, 28 April 2005 12:12   |
smartin
Messages: 1803 Registered: March 2005 Location: Jacksonville, Florida
|
Senior Member |
|
|
Yeah, you are sorta constrained by whatever input checking is done on the value you enter. If their program tries to convert whatever you enter (including the null keyword) into a date format, and if it fails the conversion (as a string that contained 'null' would) it says no way buddy, then you are pretty much locked out and limited to entering whatever the input validation will accept, or going around the validation to do direct sql on the table itself.
|
|
|
|