SQL Yoga version 1.1.0 build 4 :: Visit website

Printer friendly version

command sqlrecord_create

Creates records in a database using a SQL Record object.

command sqlrecord_create @pRecordsA
Parameters
TypeNameDescription
Simple parameter. pRecordsA SQL Records object/array of SQL Record objects (numerically indexed). Any column
Description

values you want to insert when you create the record should be filled in.

This command creates records in the database based on the SQL Record object you pass in.

put sqlrecord_createObject("lessons") into theRecordA 
sqlrecord_set theRecordA, "title", "A new title"
sqlrecord_set theRecordA, "description", "It's a description."
sqlrecord_create theRecordA
put the result into theError

## theRecordA["id"] is now filled in with new id in database for this record


Create callbacks in your Table Object definitions will be called and broadcasts will be sent to listeners during this operation.

Return

Error message in 'the result', affected rows in 'it'

Note

If you pass in empty values for any of the fields in the primary key for the table then they will not be included in the CREATE statement.