T TColeman Member Aug 3, 2000 #1 I am trying to create a new record in a database table. My code is like this: CREATE database.tablename NO-ERROR. ASSIGN database.tablename.fieldname = newValue. Instead of creating a new record the old record is being overwritten. Am I missing something? Thanks, Terri
I am trying to create a new record in a database table. My code is like this: CREATE database.tablename NO-ERROR. ASSIGN database.tablename.fieldname = newValue. Instead of creating a new record the old record is being overwritten. Am I missing something? Thanks, Terri
Chris Kelleher Administrator Staff member Aug 3, 2000 #2 Terri- Since you have the NO-ERROR on the CREATE statement, you should check to see if an error occured while creating the record: Code: createcustomer: DO TRANSACTION: CREATE customer NO-ERROR. IF ERROR-STATUS:ERROR THEN DO: MESSAGE "Could Not Create Customer" VIEW-AS ALERT-BOX ERROR. UNDO, LEAVE createcustomer. END. ELSE ASSIGN customer.name = "Whatever". END. HTH. -Chris
Terri- Since you have the NO-ERROR on the CREATE statement, you should check to see if an error occured while creating the record: Code: createcustomer: DO TRANSACTION: CREATE customer NO-ERROR. IF ERROR-STATUS:ERROR THEN DO: MESSAGE "Could Not Create Customer" VIEW-AS ALERT-BOX ERROR. UNDO, LEAVE createcustomer. END. ELSE ASSIGN customer.name = "Whatever". END. HTH. -Chris
T TColeman Member Aug 4, 2000 #3 Error-Status I did later discover the ERROR-STATUS:ERROR and I used it however there is no error during the CREATE. Maybe something else I am missing? Thanks, Terri
Error-Status I did later discover the ERROR-STATUS:ERROR and I used it however there is no error during the CREATE. Maybe something else I am missing? Thanks, Terri
Chris Kelleher Administrator Staff member Aug 4, 2000 #4 Terri- Could you post a snippet of the exact code you are using... maybe we can track it down from there. Thanks, -Chris
Terri- Could you post a snippet of the exact code you are using... maybe we can track it down from there. Thanks, -Chris