sqldata/sqlctapi.cpp
// Get a list of columns for specified foreign key
Get a list of columns for specified foreign key
Get a list of columns for specified foreign key
int SqlCtApi::GetForeignKeyConstraintColumns(SqlConstraints &cns, std::list<std::string> &fcols, std::list<std::string> &pcols, std::string &ptable)
{
	ptable = cns.pk_schema;
	ptable += ".";
	ptable += cns.pk_table;
	bool found = false;
	for(std::list<SqlConsColumns>::iterator i = _table_cons_columns.begin(); i != _table_cons_columns.end(); i++)
	{
		if((*i).cnsid == cns.cnsid && (*i).tabid == cns.tabid)
		{
			fcols.push_back((*i).column);
			pcols.push_back((*i).pk_column);
		}
		else if(found)
			break;
	}
	return 0;
}
int SqlCtApi :: GetForeignKeyConstraintColumns ( SqlConstraints & cns , std :: list < std :: string > & fcols , std :: list < std :: string > & pcols , std :: string & ptable ) { ptable = cns . pk_schema ; ptable += " " ; ptable += cns . pk_table ; bool found = false ; for ( std :: list < SqlConsColumns > :: iterator i = _table_cons_columns . begin ( ) ; i != _table_cons_columns . end ( ) ; i ++ ) { if ( ( * i ) . cnsid == cns . cnsid && ( * i ) . tabid == cns . tabid ) { fcols . push_back ( ( * i ) . column ) ; pcols . push_back ( ( * i ) . pk_column ) ; } else if ( found ) break ; } return 0 ; }
Get a list of columns for specified foreign key
Get a list of columns for specified foreign key
// Find columns