Hi folks, my SQL is a little rusty. Three questions.
1. Can you see anything wrong with the following? Its returning a 0 code in the result when executed (indicating no update occurred) instead of a 1
The following "UPDATE" text is stuffed into the variable tCmd. This is a dump of the contents of tCmd.
UPDATE birthsum_II SET "onset active labour date"=:1, "onset active labour time"=:2, "membranes ruptured date"=:3, "membranes ruptured time"=:4, "Amniotic Fluid Other"=:5, "oxytocin augmentation date"=:6, "oxytocin augmentation time"=:7, "fully dilated date"=:8, "fully dilated time"=:9, "duration 1st stage"=:10, "date of birth"=:11, "time of birth"=:12, "placenta delivered date"=:13, "placenta delivered time"=:14, "mode of delivery"=:15, "position at delivery"=:16, "placenta delivered"=:17, "pphemorrhage_ml"=:18, "pphemorrhage_comments"=:19, "attendingcareprovider"=:20 where EventID=1
revExecuteSQL gConnectID, tCmd, "myArray"
2. Do the names in the above list have to match the case of the field names? Hoping not!
3. Does anyone know of an SQL syntax checker you can run code like this through to see if there are any errors.
Thanks a bunch
Mark
Syntax check
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Syntax check
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Syntax check
Thanks to everyone who spent time thinking about this. As I said, the SQL was rusty. I was attempting to UPDATE record 1, when no record existed. Creating the record first solved the problem.
Ah the rust dissolves, slowly at first.
Ah the rust dissolves, slowly at first.
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS