The QSqlRecord class encapsulates a database record, i.e. a set of database fields.
.PP
The QSqlRecord class encapsulates the functionality and characteristics of a database record (usually a table or view within the database). QSqlRecords support adding and removing fields as well as setting and retrieving field values.
.PP
QSqlRecord is implicitly shared. This means you can make copies of the record in time O(1). If multiple QSqlRecord instances share the same data and one is modifying the record's data then this modifying instance makes a copy and modifies its private copy - thus it does not affect other instances.
.PP
See also QSqlRecordInfo and Database Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QSqlRecord::QSqlRecord ()"
Constructs an empty record.
.SH "QSqlRecord::QSqlRecord ( const QSqlRecord & other )"
Constructs a copy of \fIother\fR.
.SH "QSqlRecord::~QSqlRecord ()\fC [virtual]\fR"
Destroys the object and frees any allocated resources.
.SH "void QSqlRecord::append ( const QSqlField & field )\fC [virtual]\fR"
Append a copy of field \fIfield\fR to the end of the record.
Returns the position of the field called \fIname\fR within the record, or -1 if it cannot be found. Field names are not case-sensitive. If more than one field matches, the first one is returned.
.SH "void QSqlRecord::remove ( int pos )\fC [virtual]\fR"
Removes the field at \fIpos\fR. If \fIpos\fR does not exist, nothing happens.
Sets the generated flag for the field called \fIname\fR to \fIgenerated\fR. If the field does not exist, nothing happens. Only fields that have \fIgenerated\fR set to TRUE are included in the SQL that is generated, e.g. by QSqlCursor.
.PP
See also isGenerated().
.PP
Reimplemented in QSqlCursor.
.SH "void QSqlRecord::setGenerated ( int i, bool generated )\fC [virtual]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the generated flag for the field \fIi\fR to \fIgenerated\fR.
.PP
See also isGenerated().
.PP
Reimplemented in QSqlCursor.
.SH "void QSqlRecord::setNull ( int i )\fC [virtual]\fR"
Sets the value of field \fIi\fR to NULL. If the field does not exist, nothing happens.
Returns a list of all the record's field names as a string separated by \fIsep\fR.
.PP
Note that fields which are not generated are \fInot\fR included (see isGenerated()). The returned string is suitable, for example, for generating SQL SELECT statements. If a \fIprefix\fR is specified, e.g. a table name, all fields are prefixed in the form:
Returns a list of all the record's field names, each having the prefix \fIprefix\fR.
.PP
Note that fields which have generated set to FALSE are \fInot\fR included. (See isGenerated()). If \fIprefix\fR is supplied, e.g. a table name, all fields are prefixed in the form:
.PP"
\fIprefix\fR.<fieldname>"
.SH "QVariant QSqlRecord::value ( int i ) const\fC [virtual]\fR"
Returns the value of the field located at position \fIi\fR in the record. If field \fIi\fR does not exist the resultant behaviour is undefined.
This function should be used with QSqlQuerys. When working with a QSqlCursor the value(const TQString&) overload which uses field names is more appropriate.