Хорошо, узнал ответ.Ниже приведен пример кода
sqlite3 *_myLocalConnection;
if (sqlite3_open([["Your First DB file path"] UTF8String], &_myLocalConnection) == SQLITE_OK)
{
NSString *strSQLAttach = [NSString stringWithFormat:@"ATTACH DATABASE \'%s\' AS SECOND", [["Your second db file path"] UTF8String] ];
char *errorMessage;
if (sqlite3_exec(_myLocalConnection, [strSQLAttach UTF8String], NULL, NULL, &errorMessage) == SQLITE_OK)
{
sqlite3_stmt *myStatment;
NSString *strSQL = @"select * from SECOND.ADDRESS myAddress inner join main.CUSTTOMER myCustomer on myAddress.CustomerID = myCustomer.customerID ";
if (sqlite3_prepare_v2(_myLocalConnection, [strSQL UTF8String], -1, &myStatment, nil) == SQLITE_OK)
//do your loop logic
else
NSLog(@"Error while attaching '%s'", sqlite3_errmsg(_myLocalConnection));
}
}
Спасибо
Суреш Кумар Нараянасами