Click or drag to resize

SQLSelect.Append Method (Typed)

X#
Create a blank row in the buffer; this blank row becomes the current position and is ready for assignment of data values. The SQLSelect:RecNo of this buffer is SQLSelect:RecCount+1.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOSQLClasses (in XSharp.VOSQLClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD Append(
	lReleaseLocks AS LOGIC
) AS LOGIC
Request Example View Source

Parameters

lReleaseLocks
Type: Logic

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks
Tip Tip
The details of the implementation of this method, and how it interacts with other operations such as unique indexes and concurrency control, depend on the particular database.
Use FieldPut() to assign values into the blank buffer. When you attempt to move position off this record, an insert will be automatically performed (using SQLSelect:AppendRow()) into the table, using the values in the buffer. You can also deliberately force the update to occur by calling SQLSelect:AppendRow() or SQLSelect:Update(TRUE). If the AutoCommit option is off, you may need to invoke the Commit() method to insert the row into the database.
Tip Tip
To cancel the pending update, call the SQLSelect:Delete() method.
Examples
The following example demonstrates the use of the SQLSelect:Append() method:
X#
 1FUNCTION NewRecord()
 2LOCAL oSel AS SQLSelect
 3LOCAL oConn AS SQLConnection
 4oConn := SQLConnection{"sample","dba","sql"}
 5oSel := SQLSelect{"SELECT * FROM customer", oConn}
 6oSel:Append()
 7oSel:CustNo := 515
 8oSel:CustName := "Michelle"
 9oSel:GoTop()        // Record inserted at this point
10oSel:FreeStmt(SQL_DROP)
11oConn:Disconnect()
See Also