Cicode Programming Reference > Cicode Function Categories > SQL Functions Introduction > SQLGetField


Gets field or column data from a database record. To get the database record, use the SQLExec() and SQLNext() functions.

Keywords such as "DATE", "TIME", and "DESC" cannot be used as field names by some database systems. To use fields with these names, you need to append underscores to the names (for example, "TIME_", "DATE_", "DESC_").


SQLGetField(hSQL, sField)


The handle to the SQL connection, returned from the SQLConnect() function. The SQL connection handle identifies the table where details of the associated SQL connection are stored.


The name of the field or column.

Return Value

The field or column data (as a string). A null string is returned if the field or column does not contain data.

The maximum length of the return data is 255 characters. If the returned data is longer than this, the function will return error 306.

Related Functions

SQLBeginTran, SQLCommit, SQLConnect, SQLDisconnect, SQLEnd, SQLErrMsg, SQLExec, SQLFieldInfo, SQLInfo, SQLNext, SQLNoFields, SQLNumChange, SQLRollBack, SQLTraceOff, SQLTraceOn


See SQLConnect

See Also

SQL Functions