Sat, 30 Apr 2005 10:56:48 GMT
!!! help - date query and empty foreign key insertion
hello, I have two critical questions. I'm using delphi database angine with paradox tables. 1st Question: I want to execute that has a date field inside and I don't know how the date is formatted. For example I want to do something like that: "UPDATE STUDENTS SET BirthDate=20/07/1970 WHERE StudentID=10". How is the date formatted? Should I have to include it inside single quotes ('20/9/1980') or like that #20/9/1980# or how? 2nd Question: When I insert a record with InsertRecord command in Delphi I have no problem inserting values like '' or nil in fields that are foreign keys (are used in referential integrity rules and are primary keys of other tables) when I don't have a value for them yet. So I do something like this: Table1.InsertRecord([nil, 'teo', '']) where the third field is a foreign key let's say and the record is inserted without a value in the third field. BUT when I'm trying to execute an update query with this kind of fields I CANNOT update the field like GradeID='' or GradeID=0 because I get an error message "master record odes not exist"!. But I want to empty this field to contain NO value the same way I can insert it at first place with no value. How can this been done when updating a record? Every answer is higly appreciated, thanks in advance. Best regards, theo -- Posted via http://dbforums.com
|