18 January 2008

Executing SQL

Need to call simple SQL commands, like getting the next primary key by calling a sequence:


NSArray rawRows = EOUtilities.rawRowsForSQL( EDITING_CONTEXT, MODEL_NAME, SQL_STRING, NSArray.EmptyArray );
NSDictionary rowWithPK = (NSDictionary)rawRows.objectAtIndex( 0);
Object maxPK = rowWithPK.objectForKey( "NR" );

No comments: