[Kexi] IDENTITY issues in Sybase

Sharan Rao sharanrao at gmail.com
Tue Jan 1 20:04:48 CET 2008


On Tuesday 01 Jan 2008 7:48:11 pm Jarosław Staniek wrote:
> Sharan, thanks for the patch; it's mostly OK.
> First note, could you please change spaces to tabs in the indentation?
> (even if we plan to switch to spaces soon I hope)
>
> * Move Connection::drv_beforeInsert(), etc. to the header file for
> efficiency. You'll need to put Q_UNUSED(table);, etc. there to avoid
> warnings about unused args.
> * Check results of calling these methods, i.e.
>     if (!drv_beforeInsert(...))
> 	return false;
> * commit cursor.cpp change (removal of my commentout) as a separate
> checkin. * In SybaseConnection::drv_beforeInsert() you could put instead:
>
> +bool KexiDB::SybaseConnection::drv_beforeInsert( const QString& table,
> FieldList& fields )
> +{
> +
> +    if ( fields.autoIncrementFields()->isEmpty() )
> +          return true;
>       // explicit insertion into IDENTITY fields !!
>       return drv_executeSQL( QString::fromLatin1( "SET IDENTITY_INSERT %1
> ON" ).arg( table ) );
> +}
>
> Same for other 3 methods.
> BTW, don't we need escape the table name?

Yes, I think I forgot almost all the error checking stuff :).
As you didn't mention it, I presume that the first interface signature ( table 
and fieldList ) is to be used ?

Cheers!
 Sharan Rao



More information about the Kexi mailing list