#include <database.mod/postgresql.mod/.bmx/postgresql.bmx.debug.win32.x86.h>
struct BBString_1{BBClass_String* clas;BBULONG hash;int length;BBChar buf[1];};
struct BBString_5{BBClass_String* clas;BBULONG hash;int length;BBChar buf[5];};
struct BBString_6{BBClass_String* clas;BBULONG hash;int length;BBChar buf[6];};
struct BBString_12{BBClass_String* clas;BBULONG hash;int length;BBChar buf[12];};
struct BBString_28{BBClass_String* clas;BBULONG hash;int length;BBChar buf[28];};
struct BBString_30{BBClass_String* clas;BBULONG hash;int length;BBChar buf[30];};
struct BBString_34{BBClass_String* clas;BBULONG hash;int length;BBChar buf[34];};
struct BBString_25{BBClass_String* clas;BBULONG hash;int length;BBChar buf[25];};
struct BBString_26{BBClass_String* clas;BBULONG hash;int length;BBChar buf[26];};
struct BBString_10{BBClass_String* clas;BBULONG hash;int length;BBChar buf[10];};
struct BBString_8{BBClass_String* clas;BBULONG hash;int length;BBChar buf[8];};
struct BBString_92{BBClass_String* clas;BBULONG hash;int length;BBChar buf[92];};
struct BBString_7{BBClass_String* clas;BBULONG hash;int length;BBChar buf[7];};
struct BBString_9{BBClass_String* clas;BBULONG hash;int length;BBChar buf[9];};
struct BBString_4{BBClass_String* clas;BBULONG hash;int length;BBChar buf[4];};
static struct BBString_1 _s4={
	&bbStringClass,
	0xbbe01a6a523daf15,
	1,
	{10}
};
static struct BBString_1 _s16={
	&bbStringClass,
	0x7c4af187e743bfa6,
	1,
	{34}
};
static struct BBString_1 _s10={
	&bbStringClass,
	0xe7661a0566dadf97,
	1,
	{39}
};
static struct BBString_5 _s13={
	&bbStringClass,
	0xcfcc9b7dad8621a6,
	5,
	{66,69,71,73,78}
};
static struct BBString_6 _s0={
	&bbStringClass,
	0x2af6a1053207f7d7,
	6,
	{67,79,77,77,73,84}
};
static struct BBString_12 _s15={
	&bbStringClass,
	0x6d2b704bc28ae022,
	12,
	{68,69,65,76,76,79,67,65,84,69,32,34}
};
static struct BBString_28 _s1={
	&bbStringClass,
	0x98ccb0d8ca98ec90,
	28,
	{69,114,114,111,114,32,99,111,109,109,105,116,116,105,110,103,32
	,116,114,97,110,115,97,99,116,105,111,110}
};
static struct BBString_30 _s9={
	&bbStringClass,
	0x7353ccd578ffd426,
	30,
	{69,114,114,111,114,32,99,111,110,110,101,99,116,105,110,103,32
	,116,111,32,100,97,116,97,98,97,115,101,32,39}
};
static struct BBString_34 _s20={
	&bbStringClass,
	0x32f5f682d92778b,
	34,
	{69,114,114,111,114,32,101,120,101,99,117,116,105,110,103,32,112
	,114,101,112,97,114,101,100,32,115,116,97,116,101,109,101,110
	,116}
};
static struct BBString_25 _s17={
	&bbStringClass,
	0x97c2d963e4b94776,
	25,
	{69,114,114,111,114,32,101,120,101,99,117,116,105,110,103,32,115
	,116,97,116,101,109,101,110,116}
};
static struct BBString_25 _s19={
	&bbStringClass,
	0x48fa39593b31d4a4,
	25,
	{69,114,114,111,114,32,112,114,101,112,97,114,105,110,103,32,115
	,116,97,116,101,109,101,110,116}
};
static struct BBString_30 _s12={
	&bbStringClass,
	0xa04557736a983af5,
	30,
	{69,114,114,111,114,32,114,111,108,108,105,110,103,32,98,97,99
	,107,32,116,114,97,110,115,97,99,116,105,111,110}
};
static struct BBString_26 _s14={
	&bbStringClass,
	0x2182482802d813a0,
	26,
	{69,114,114,111,114,32,115,116,97,114,116,105,110,103,32,116,114
	,97,110,115,97,99,116,105,111,110}
};
static struct BBString_10 _s21={
	&bbStringClass,
	0xfa035337190856a1,
	10,
	{80,79,83,84,71,82,69,83,81,76}
};
static struct BBString_8 _s11={
	&bbStringClass,
	0xa61426338e4547af,
	8,
	{82,79,76,76,66,65,67,75}
};
static struct BBString_92 _s2={
	&bbStringClass,
	0x63b3944770b6c9a7,
	92,
	{83,101,108,101,99,116,32,116,97,98,108,101,110,97,109,101,32
	,102,114,111,109,32,112,103,95,116,97,98,108,101,115,32,119
	,104,101,114,101,32,115,99,104,101,109,97,110,97,109,101,32
	,78,111,116,32,105,110,32,40,39,112,103,95,99,97,116,97
	,108,111,103,39,44,32,39,105,110,102,111,114,109,97,116,105
	,111,110,95,115,99,104,101,109,97,39,41}
};
static struct BBString_7 _s3={
	&bbStringClass,
	0x24e08fd41fea89a0,
	7,
	{100,98,110,97,109,101,61}
};
static struct BBString_5 _s5={
	&bbStringClass,
	0x991b30ba7136f11a,
	5,
	{104,111,115,116,61}
};
static struct BBString_9 _s8={
	&bbStringClass,
	0xbeebd0062440d939,
	9,
	{112,97,115,115,119,111,114,100,61}
};
static struct BBString_5 _s6={
	&bbStringClass,
	0x36b9e7d48b418ba1,
	5,
	{112,111,114,116,61}
};
static struct BBString_4 _s18={
	&bbStringClass,
	0x153254c493f00e18,
	4,
	{112,114,101,112}
};
static struct BBString_5 _s7={
	&bbStringClass,
	0x712441eb9f78b9f5,
	5,
	{117,115,101,114,61}
};
struct BBDebugScope_1{int kind; const char *name; BBDebugDecl decls[2]; };
struct BBDebugScope_11{int kind; const char *name; BBDebugDecl decls[12]; };
struct BBDebugScope_15{int kind; const char *name; BBDebugDecl decls[16]; };
struct BBDebugScope_17{int kind; const char *name; BBDebugDecl decls[18]; };
struct BBDebugScope_2{int kind; const char *name; BBDebugDecl decls[3]; };
struct BBDebugScope_3{int kind; const char *name; BBDebugDecl decls[4]; };
struct BBDebugScope_4{int kind; const char *name; BBDebugDecl decls[5]; };
struct BBDebugScope_5{int kind; const char *name; BBDebugDecl decls[6]; };
struct BBDebugScope_8{int kind; const char *name; BBDebugDecl decls[9]; };
void _database_postgresql_TPostgreSQLDatabaseLoader_New(struct database_postgresql_TPostgreSQLDatabaseLoader_obj* o) {
	_database_core_TDatabaseLoader_New((struct database_core_TDatabaseLoader_obj*)o);
	o->clas = &database_postgresql_TPostgreSQLDatabaseLoader;
	struct BBDebugScope __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"New",
		{
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 755, 0};
	bbOnDebugEnterStm(&__stmt_0);
	((struct database_core_TDatabaseLoader_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdatabaseloader__type =((BBString*)&_s21);
	bbOnDebugLeaveScope();
}
struct database_core_TDBConnection_obj* _database_postgresql_TPostgreSQLDatabaseLoader_LoadDatabase_SSiSSSS(struct database_postgresql_TPostgreSQLDatabaseLoader_obj* o,BBSTRING bbt_dbname,BBSTRING bbt_host,BBINT bbt_port,BBSTRING bbt_user,BBSTRING bbt_password,BBSTRING bbt_server,BBSTRING bbt_options){
	((struct database_postgresql_TPostgreSQLDatabaseLoader_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_8 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"LoadDatabase",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLDatabaseLoader",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"dbname",
				"$",
				.var_address=&bbt_dbname
			},
			{
				BBDEBUGDECL_LOCAL,
				"host",
				"$",
				.var_address=&bbt_host
			},
			{
				BBDEBUGDECL_LOCAL,
				"port",
				"i",
				.var_address=&bbt_port
			},
			{
				BBDEBUGDECL_LOCAL,
				"user",
				"$",
				.var_address=&bbt_user
			},
			{
				BBDEBUGDECL_LOCAL,
				"password",
				"$",
				.var_address=&bbt_password
			},
			{
				BBDEBUGDECL_LOCAL,
				"server",
				"$",
				.var_address=&bbt_server
			},
			{
				BBDEBUGDECL_LOCAL,
				"options",
				"$",
				.var_address=&bbt_options
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 762, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbOnDebugLeaveScope();
	return (struct database_core_TDBConnection_obj*)database_postgresql_TDBPostgreSQL_Create_TTDBConnection_SSiSSSS(bbt_dbname,bbt_host,bbt_port,bbt_user,bbt_password,bbt_server,bbt_options);
}
struct BBDebugScope_2 database_postgresql_TPostgreSQLDatabaseLoader_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TPostgreSQLDatabaseLoader",
	{
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLDatabaseLoader_New
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"LoadDatabase",
			"($,$,i,$,$,$,$):TDBConnection",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLDatabaseLoader_LoadDatabase_SSiSSSS
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_postgresql_TPostgreSQLDatabaseLoader database_postgresql_TPostgreSQLDatabaseLoader={
	&database_core_TDatabaseLoader,
	bbObjectFree,
	(BBDebugScope*)&database_postgresql_TPostgreSQLDatabaseLoader_scope,
	sizeof(struct database_postgresql_TPostgreSQLDatabaseLoader_obj),
	(void (*)(BBOBJECT))_database_postgresql_TPostgreSQLDatabaseLoader_New,
	bbObjectDtor,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	0
	,0
	,sizeof(void*)
	,_database_postgresql_TPostgreSQLDatabaseLoader_LoadDatabase_SSiSSSS
};

void _database_postgresql_TDBPostgreSQL_New(struct database_postgresql_TDBPostgreSQL_obj* o) {
	_database_core_TDBConnection_New((struct database_core_TDBConnection_obj*)o);
	o->clas = &database_postgresql_TDBPostgreSQL;
}
void _database_postgresql_TDBPostgreSQL_Delete(struct database_postgresql_TDBPostgreSQL_obj* o) {
	_database_core_TDBConnection_Delete((struct database_core_TDBConnection_obj*)o);
}
struct database_core_TDBConnection_obj* database_postgresql_TDBPostgreSQL_Create_TTDBConnection_SSiSSSS(BBSTRING bbt_dbname,BBSTRING bbt_host,BBINT bbt_port,BBSTRING bbt_user,BBSTRING bbt_password,BBSTRING bbt_server,BBSTRING bbt_options){
	struct database_postgresql_TDBPostgreSQL_obj* bbt_this=(struct database_postgresql_TDBPostgreSQL_obj*)((struct database_postgresql_TDBPostgreSQL_obj*)&bbNullObject);
	struct BBDebugScope_8 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"Create",
		{
			{
				BBDEBUGDECL_LOCAL,
				"dbname",
				"$",
				.var_address=&bbt_dbname
			},
			{
				BBDEBUGDECL_LOCAL,
				"host",
				"$",
				.var_address=&bbt_host
			},
			{
				BBDEBUGDECL_LOCAL,
				"port",
				"i",
				.var_address=&bbt_port
			},
			{
				BBDEBUGDECL_LOCAL,
				"user",
				"$",
				.var_address=&bbt_user
			},
			{
				BBDEBUGDECL_LOCAL,
				"password",
				"$",
				.var_address=&bbt_password
			},
			{
				BBDEBUGDECL_LOCAL,
				"server",
				"$",
				.var_address=&bbt_server
			},
			{
				BBDEBUGDECL_LOCAL,
				"options",
				"$",
				.var_address=&bbt_options
			},
			{
				BBDEBUGDECL_LOCAL,
				"this",
				":TDBPostgreSQL",
				.var_address=&bbt_this
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 89, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbt_this=(struct database_postgresql_TDBPostgreSQL_obj*)(struct database_postgresql_TDBPostgreSQL_obj*)bbObjectNew((BBClass *)&database_postgresql_TDBPostgreSQL);
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 91, 0};
	bbOnDebugEnterStm(&__stmt_1);
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)bbt_this))->clas->m_Init_SSiSSSS((struct database_core_TDBConnection_obj*)bbt_this,bbt_dbname,bbt_host,bbt_port,bbt_user,bbt_password,bbt_server,bbt_options);
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 93, 0};
	bbOnDebugEnterStm(&__stmt_2);
	if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)bbt_this))->_database_core_tdbconnection__dbname != &bbEmptyString){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 94, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)bbt_this))->clas->m_open_SS((struct database_postgresql_TDBPostgreSQL_obj*)bbt_this,bbt_user,bbt_password);
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 97, 0};
	bbOnDebugEnterStm(&__stmt_3);
	bbOnDebugLeaveScope();
	return (struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)bbObjectDowncast((BBOBJECT)bbt_this,(BBClass*)&database_core_TDBConnection));
}
void _database_postgresql_TDBPostgreSQL_close(struct database_postgresql_TDBPostgreSQL_obj* o){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"close",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 103, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen !=0){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 104, 0};
		bbOnDebugEnterStm(&__stmt_0);
		if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle ){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 105, 0};
			bbOnDebugEnterStm(&__stmt_0);
			bmx_pgsql_PQfinish(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle );
			struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 106, 0};
			bbOnDebugEnterStm(&__stmt_1);
			((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle =0;
			bbOnDebugLeaveScope();
		}
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 109, 0};
		bbOnDebugEnterStm(&__stmt_1);
		((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen =0;
		bbOnDebugLeaveScope();
	}
	bbOnDebugLeaveScope();
}
BBINT _database_postgresql_TDBPostgreSQL_isOpen(struct database_postgresql_TDBPostgreSQL_obj* o){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"isOpen",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 115, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen !=0){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 117, 0};
		bbOnDebugEnterStm(&__stmt_0);
		if(bmx_pgsql_PQstatus(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle )!=0){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 118, 0};
			bbOnDebugEnterStm(&__stmt_0);
			((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen =0;
			bbOnDebugLeaveScope();
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 122, 0};
	bbOnDebugEnterStm(&__stmt_1);
	bbOnDebugLeaveScope();
	return ((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen ;
}
BBINT _database_postgresql_TDBPostgreSQL_commit(struct database_postgresql_TDBPostgreSQL_obj* o){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	BBBYTE* bbt_result=0;
	struct BBDebugScope_2 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"commit",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"result",
				"*b",
				.var_address=&bbt_result
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 127, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(!(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen !=0) || !(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle )){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 128, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 131, 0};
	bbOnDebugEnterStm(&__stmt_1);
	BBBYTE* bbt_ = (BBBYTE*)bbStringToCString((BBString*)&_s0);
	bbt_result=bmx_pgsql_PQexec(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle ,bbt_);
	bbMemFree(bbt_);
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 133, 0};
	bbOnDebugEnterStm(&__stmt_2);
	if(!(bbt_result) || (bmx_pgsql_PQresultStatus(bbt_result)!=1)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 134, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,((BBString*)&_s1),database_core_convertUTF8toISO8859(bmx_pgsql_PQerrorMessage(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle )),1,0);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 135, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bmx_pgsql_PQclear(bbt_result);
		struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 136, 0};
		bbOnDebugEnterStm(&__stmt_2);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 139, 0};
	bbOnDebugEnterStm(&__stmt_3);
	bmx_pgsql_PQclear(bbt_result);
	struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 141, 0};
	bbOnDebugEnterStm(&__stmt_4);
	bbOnDebugLeaveScope();
	return 1;
}
BBARRAY _database_postgresql_TDBPostgreSQL_getTables(struct database_postgresql_TDBPostgreSQL_obj* o){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	BBARRAY bbt_list=(&bbEmptyArray);
	struct brl_linkedlist_TList_obj* bbt_tables=(struct brl_linkedlist_TList_obj*)((struct brl_linkedlist_TList_obj*)&bbNullObject);
	struct database_core_TDatabaseQuery_obj* bbt_query=(struct database_core_TDatabaseQuery_obj*)((struct database_core_TDatabaseQuery_obj*)&bbNullObject);
	BBSTRING bbt_sql=(&bbEmptyString);
	struct BBDebugScope_5 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"getTables",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"list",
				"[]$",
				.var_address=&bbt_list
			},
			{
				BBDEBUGDECL_LOCAL,
				"tables",
				":TList",
				.var_address=&bbt_tables
			},
			{
				BBDEBUGDECL_LOCAL,
				"query",
				":TDatabaseQuery",
				.var_address=&bbt_query
			},
			{
				BBDEBUGDECL_LOCAL,
				"sql",
				"$",
				.var_address=&bbt_sql
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 145, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbt_list=(&bbEmptyArray);
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 147, 0};
	bbOnDebugEnterStm(&__stmt_1);
	if(!(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen !=0)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 148, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return bbt_list;
	}
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 151, 0};
	bbOnDebugEnterStm(&__stmt_2);
	bbt_tables=(struct brl_linkedlist_TList_obj*)(struct brl_linkedlist_TList_obj*)bbObjectNew((BBClass *)&brl_linkedlist_TList);
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 153, 0};
	bbOnDebugEnterStm(&__stmt_3);
	bbt_query=(struct database_core_TDatabaseQuery_obj*)database_core_TDatabaseQuery_Create_TTDatabaseQuery_TTDBConnection((struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)bbObjectDowncast((BBOBJECT)o,(BBClass*)&database_core_TDBConnection)));
	struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 155, 0};
	bbOnDebugEnterStm(&__stmt_4);
	bbt_sql=((BBString*)&_s2);
	struct BBDebugStm __stmt_5 = {0xd2c85e7745290c31, 156, 0};
	bbOnDebugEnterStm(&__stmt_5);
	if(((struct database_core_TDatabaseQuery_obj*)bbNullObjectTest((BBObject*)bbt_query))->clas->m_execute_S((struct database_core_TDatabaseQuery_obj*)bbt_query,bbt_sql)!=0){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 157, 0};
		bbOnDebugEnterStm(&__stmt_0);
		while(((struct database_core_TDatabaseQuery_obj*)bbNullObjectTest((BBObject*)bbt_query))->clas->m_nextRow((struct database_core_TDatabaseQuery_obj*)bbt_query)!=0){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 158, 0};
			bbOnDebugEnterStm(&__stmt_0);
			struct database_core_dbtypes_TDBType_obj* bbt_;
			((struct brl_linkedlist_TList_obj*)bbNullObjectTest((BBObject*)bbt_tables))->clas->m_AddLast_TObject((struct brl_linkedlist_TList_obj*)bbt_tables,(BBOBJECT)((struct database_core_dbtypes_TDBType_obj*)bbNullObjectTest((BBObject*)(bbt_ = ((struct database_core_TDatabaseQuery_obj*)bbNullObjectTest((BBObject*)bbt_query))->clas->m_value_i((struct database_core_TDatabaseQuery_obj*)bbt_query,0))))->clas->m_getString((struct database_core_dbtypes_TDBType_obj*)bbt_));
			bbOnDebugLeaveScope();
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_6 = {0xd2c85e7745290c31, 162, 0};
	bbOnDebugEnterStm(&__stmt_6);
	if(((struct brl_linkedlist_TList_obj*)bbNullObjectTest((BBObject*)bbt_tables))->clas->m_Count((struct brl_linkedlist_TList_obj*)bbt_tables)>0){
		BBINT bbt_i=0;
		struct BBDebugScope_1 __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_LOCAL,
					"i",
					"i",
					.var_address=&bbt_i
				},
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 163, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbt_list=bbArrayNew1D("$", ((struct brl_linkedlist_TList_obj*)bbNullObjectTest((BBObject*)bbt_tables))->clas->m_Count((struct brl_linkedlist_TList_obj*)bbt_tables));
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 164, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bbt_i=0;
		struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 165, 0};
		bbOnDebugEnterStm(&__stmt_2);
		struct brl_linkedlist_TListEnum_obj* bbt_2=(struct brl_linkedlist_TListEnum_obj*)((struct brl_linkedlist_TList_obj*)bbNullObjectTest((BBObject*)bbt_tables))->clas->m_ObjectEnumerator((struct brl_linkedlist_TList_obj*)bbt_tables);
		while(((struct brl_linkedlist_TListEnum_obj*)bbNullObjectTest((BBObject*)bbt_2))->clas->m_HasNext((struct brl_linkedlist_TListEnum_obj*)bbt_2)!=0){
			BBSTRING bbt_s=(&bbEmptyString);
			struct BBDebugScope_1 __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_LOCAL,
						"s",
						"$",
						.var_address=&bbt_s
					},
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			BBOBJECT bbt_3=(BBOBJECT)((struct brl_linkedlist_TListEnum_obj*)bbNullObjectTest((BBObject*)bbt_2))->clas->m_NextObject((struct brl_linkedlist_TListEnum_obj*)bbt_2);
			if(bbObjectIsString((BBOBJECT)bbt_3)==0){
				bbOnDebugLeaveScope();
				continue;
			}
			bbt_s=((BBString *)bbObjectStringcast((BBOBJECT)bbt_3));
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 166, 0};
			bbOnDebugEnterStm(&__stmt_0);
			((BBSTRING*)BBARRAYDATAINDEX((bbt_list),(bbt_list)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=bbt_s;
			struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 167, 0};
			bbOnDebugEnterStm(&__stmt_1);
			bbt_i+=1;
			bbOnDebugLeaveScope();
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_7 = {0xd2c85e7745290c31, 171, 0};
	bbOnDebugEnterStm(&__stmt_7);
	bbOnDebugLeaveScope();
	return bbt_list;
}
struct database_core_TDBTable_obj* _database_postgresql_TDBPostgreSQL_getTableInfo_Si(struct database_postgresql_TDBPostgreSQL_obj* o,BBSTRING bbt_tableName,BBINT bbt_withDDL){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_3 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"getTableInfo",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"tableName",
				"$",
				.var_address=&bbt_tableName
			},
			{
				BBDEBUGDECL_LOCAL,
				"withDDL",
				"i",
				.var_address=&bbt_withDDL
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	bbOnDebugLeaveScope();
	return (struct database_core_TDBTable_obj*)((struct database_core_TDBTable_obj*)&bbNullObject);
}
BBINT _database_postgresql_TDBPostgreSQL_open_SS(struct database_postgresql_TDBPostgreSQL_obj* o,BBSTRING bbt_user,BBSTRING bbt_pass){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	BBSTRING bbt_connect=(&bbEmptyString);
	struct BBDebugScope_4 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"open",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"user",
				"$",
				.var_address=&bbt_user
			},
			{
				BBDEBUGDECL_LOCAL,
				"pass",
				"$",
				.var_address=&bbt_pass
			},
			{
				BBDEBUGDECL_LOCAL,
				"connect",
				"$",
				.var_address=&bbt_connect
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 179, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen !=0){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 180, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TDBPostgreSQL_obj*)o)->clas->m_close((struct database_postgresql_TDBPostgreSQL_obj*)o);
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 183, 0};
	bbOnDebugEnterStm(&__stmt_1);
	if(bbt_user!= &bbEmptyString){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 184, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__user =bbt_user;
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 187, 0};
	bbOnDebugEnterStm(&__stmt_2);
	if(bbt_pass!= &bbEmptyString){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 188, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__password =bbt_pass;
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 192, 0};
	bbOnDebugEnterStm(&__stmt_3);
	bbt_connect=((BBString*)&bbEmptyString);
	struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 194, 0};
	bbOnDebugEnterStm(&__stmt_4);
	if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__dbname != &bbEmptyString){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 195, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbt_connect=bbStringConcat(bbt_connect,(bbStringConcat(bbStringConcat(((BBString*)&_s3),((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__dbname ),((BBString*)&_s4))));
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_5 = {0xd2c85e7745290c31, 198, 0};
	bbOnDebugEnterStm(&__stmt_5);
	if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__host != &bbEmptyString){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 199, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbt_connect=bbStringConcat(bbt_connect,(bbStringConcat(bbStringConcat(((BBString*)&_s5),((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__host ),((BBString*)&_s4))));
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_6 = {0xd2c85e7745290c31, 202, 0};
	bbOnDebugEnterStm(&__stmt_6);
	if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__port !=0){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 203, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbt_connect=bbStringConcat(bbt_connect,(bbStringConcat(bbStringConcat(((BBString*)&_s6),bbStringFromInt(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__port )),((BBString*)&_s4))));
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_7 = {0xd2c85e7745290c31, 206, 0};
	bbOnDebugEnterStm(&__stmt_7);
	if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__user != &bbEmptyString){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 207, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbt_connect=bbStringConcat(bbt_connect,(bbStringConcat(bbStringConcat(((BBString*)&_s7),((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__user ),((BBString*)&_s4))));
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_8 = {0xd2c85e7745290c31, 210, 0};
	bbOnDebugEnterStm(&__stmt_8);
	if(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__password != &bbEmptyString){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 211, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbt_connect=bbStringConcat(bbt_connect,(bbStringConcat(bbStringConcat(((BBString*)&_s8),((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__password ),((BBString*)&_s4))));
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_9 = {0xd2c85e7745290c31, 215, 0};
	bbOnDebugEnterStm(&__stmt_9);
	BBBYTE* bbt_ = (BBBYTE*)bbStringToCString(bbt_connect);
	((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle =bmx_pgsql_PQconnectdb(bbt_);
	bbMemFree(bbt_);
	struct BBDebugStm __stmt_10 = {0xd2c85e7745290c31, 217, 0};
	bbOnDebugEnterStm(&__stmt_10);
	if(bmx_pgsql_PQstatus(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle )!=0){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 218, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,bbStringConcat(bbStringConcat(((BBString*)&_s9),((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__dbname ),((BBString*)&_s10)),database_core_convertUTF8toISO8859(bmx_pgsql_PQerrorMessage(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle )),2,0);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 219, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_11 = {0xd2c85e7745290c31, 223, 0};
	bbOnDebugEnterStm(&__stmt_11);
	((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen =1;
	struct BBDebugStm __stmt_12 = {0xd2c85e7745290c31, 224, 0};
	bbOnDebugEnterStm(&__stmt_12);
	bbOnDebugLeaveScope();
	return 1;
}
BBINT _database_postgresql_TDBPostgreSQL_rollback(struct database_postgresql_TDBPostgreSQL_obj* o){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	BBBYTE* bbt_result=0;
	struct BBDebugScope_2 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"rollback",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"result",
				"*b",
				.var_address=&bbt_result
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 229, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(!(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen !=0) || !(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle )){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 230, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 233, 0};
	bbOnDebugEnterStm(&__stmt_1);
	BBBYTE* bbt_ = (BBBYTE*)bbStringToCString((BBString*)&_s11);
	bbt_result=bmx_pgsql_PQexec(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle ,bbt_);
	bbMemFree(bbt_);
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 235, 0};
	bbOnDebugEnterStm(&__stmt_2);
	if(!(bbt_result) || (bmx_pgsql_PQresultStatus(bbt_result)!=1)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 236, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,((BBString*)&_s12),database_core_convertUTF8toISO8859(bmx_pgsql_PQerrorMessage(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle )),1,0);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 237, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bmx_pgsql_PQclear(bbt_result);
		struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 238, 0};
		bbOnDebugEnterStm(&__stmt_2);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 241, 0};
	bbOnDebugEnterStm(&__stmt_3);
	bmx_pgsql_PQclear(bbt_result);
	struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 243, 0};
	bbOnDebugEnterStm(&__stmt_4);
	bbOnDebugLeaveScope();
	return 1;
}
BBINT _database_postgresql_TDBPostgreSQL_startTransaction(struct database_postgresql_TDBPostgreSQL_obj* o){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	BBBYTE* bbt_result=0;
	struct BBDebugScope_2 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"startTransaction",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"result",
				"*b",
				.var_address=&bbt_result
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 248, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(!(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection__isopen !=0) || !(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle )){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 249, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 252, 0};
	bbOnDebugEnterStm(&__stmt_1);
	BBBYTE* bbt_ = (BBBYTE*)bbStringToCString((BBString*)&_s13);
	bbt_result=bmx_pgsql_PQexec(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle ,bbt_);
	bbMemFree(bbt_);
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 254, 0};
	bbOnDebugEnterStm(&__stmt_2);
	if(!(bbt_result) || (bmx_pgsql_PQresultStatus(bbt_result)!=1)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 255, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_core_TDBConnection_obj*)o)->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o,((BBString*)&_s14),database_core_convertUTF8toISO8859(bmx_pgsql_PQerrorMessage(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle )),1,0);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 256, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bmx_pgsql_PQclear(bbt_result);
		struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 257, 0};
		bbOnDebugEnterStm(&__stmt_2);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 260, 0};
	bbOnDebugEnterStm(&__stmt_3);
	bmx_pgsql_PQclear(bbt_result);
	struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 262, 0};
	bbOnDebugEnterStm(&__stmt_4);
	bbOnDebugLeaveScope();
	return 1;
}
BBBYTE* _database_postgresql_TDBPostgreSQL_databaseHandle(struct database_postgresql_TDBPostgreSQL_obj* o){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"databaseHandle",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 266, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbOnDebugLeaveScope();
	return ((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tdbconnection_handle ;
}
struct database_core_TQueryResultSet_obj* _database_postgresql_TDBPostgreSQL_createResultSet(struct database_postgresql_TDBPostgreSQL_obj* o){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"createResultSet",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 270, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbOnDebugLeaveScope();
	return (struct database_core_TQueryResultSet_obj*)database_postgresql_TPostgreSQLResultSet_Create_TTQueryResultSet_TTDBConnectionS((struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)bbObjectDowncast((BBOBJECT)o,(BBClass*)&database_core_TDBConnection)),(&bbEmptyString));
}
BBSTRING _database_postgresql_TDBPostgreSQL_nativeErrorMessage_i(struct database_postgresql_TDBPostgreSQL_obj* o,BBINT bbt_err){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_2 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"nativeErrorMessage",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"err",
				"i",
				.var_address=&bbt_err
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	bbOnDebugLeaveScope();
	return ((BBString*)&bbEmptyString);
}
BBINT _database_postgresql_TDBPostgreSQL_hasPrepareSupport(struct database_postgresql_TDBPostgreSQL_obj* o){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"hasPrepareSupport",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 277, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbOnDebugLeaveScope();
	return 1;
}
BBINT _database_postgresql_TDBPostgreSQL_hasTransactionSupport(struct database_postgresql_TDBPostgreSQL_obj* o){
	((struct database_postgresql_TDBPostgreSQL_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"hasTransactionSupport",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TDBPostgreSQL",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 281, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbOnDebugLeaveScope();
	return 1;
}
struct BBDebugScope_15 database_postgresql_TDBPostgreSQL_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TDBPostgreSQL",
	{
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_New
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"Create",
			"($,$,i,$,$,$,$):TDBConnection",
			.func_ptr=(BBFuncPtr)&database_postgresql_TDBPostgreSQL_Create_TTDBConnection_SSiSSSS
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"close",
			"()",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_close
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"isOpen",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_isOpen
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"commit",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_commit
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getTables",
			"()[]$",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_getTables
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getTableInfo",
			"($,i):TDBTable",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_getTableInfo_Si
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"open",
			"($,$)i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_open_SS
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"rollback",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_rollback
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"startTransaction",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_startTransaction
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"databaseHandle",
			"()*b",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_databaseHandle
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"createResultSet",
			"():TQueryResultSet",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_createResultSet
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"nativeErrorMessage",
			"(i)$",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_nativeErrorMessage_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"hasPrepareSupport",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_hasPrepareSupport
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"hasTransactionSupport",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TDBPostgreSQL_hasTransactionSupport
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_postgresql_TDBPostgreSQL database_postgresql_TDBPostgreSQL={
	&database_core_TDBConnection,
	bbObjectFree,
	(BBDebugScope*)&database_postgresql_TDBPostgreSQL_scope,
	sizeof(struct database_postgresql_TDBPostgreSQL_obj),
	(void (*)(BBOBJECT))_database_postgresql_TDBPostgreSQL_New,
	(void (*)(BBOBJECT))_database_postgresql_TDBPostgreSQL_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	0
	,0
	,sizeof(void*)
	,database_postgresql_TDBPostgreSQL_Create_TTDBConnection_SSiSSSS
	,_database_core_TDBConnection_Init_SSiSSSS
	,_database_postgresql_TDBPostgreSQL_close
	,_database_postgresql_TDBPostgreSQL_commit
	,_database_postgresql_TDBPostgreSQL_getTables
	,_database_postgresql_TDBPostgreSQL_getTableInfo_Si
	,_database_postgresql_TDBPostgreSQL_open_SS
	,_database_postgresql_TDBPostgreSQL_rollback
	,_database_postgresql_TDBPostgreSQL_startTransaction
	,_database_core_TDBConnection_executeQuery_S
	,_database_postgresql_TDBPostgreSQL_isOpen
	,_database_core_TDBConnection_getDatabaseName
	,_database_core_TDBConnection_getHost
	,_database_core_TDBConnection_getPortNumber
	,_database_core_TDBConnection_error
	,_database_core_TDBConnection_resetError
	,_database_core_TDBConnection_hasError
	,_database_core_TDBConnection_setError_SSii
	,_database_postgresql_TDBPostgreSQL_databaseHandle
	,_database_postgresql_TDBPostgreSQL_createResultSet
	,_database_postgresql_TDBPostgreSQL_nativeErrorMessage_i
	,_database_postgresql_TDBPostgreSQL_hasPrepareSupport
	,_database_postgresql_TDBPostgreSQL_hasTransactionSupport
	,_database_core_TDBConnection_free
};

void _database_postgresql_TPostgreSQLResultSet_New(struct database_postgresql_TPostgreSQLResultSet_obj* o) {
	_database_core_TQueryResultSet_New((struct database_core_TQueryResultSet_obj*)o);
	o->clas = &database_postgresql_TPostgreSQLResultSet;
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult = 0;
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__queryrows = 0;
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__rowsaffected = 0;
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname = ((BBString*)&bbEmptyString);
}
void _database_postgresql_TPostgreSQLResultSet_Delete(struct database_postgresql_TPostgreSQLResultSet_obj* o) {
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"Delete",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 308, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname != &bbEmptyString){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 309, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_executeQuery_S((struct database_postgresql_TPostgreSQLResultSet_obj*)o,bbStringConcat(bbStringConcat(((BBString*)&_s15),((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname ),((BBString*)&_s16)));
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 310, 0};
		bbOnDebugEnterStm(&__stmt_1);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname =(&bbEmptyString);
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 312, 0};
	bbOnDebugEnterStm(&__stmt_1);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
	bbOnDebugLeaveScope();
	BBRELEASE(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname )
	_database_core_TQueryResultSet_Delete((struct database_core_TQueryResultSet_obj*)o);
}
struct database_core_TQueryResultSet_obj* database_postgresql_TPostgreSQLResultSet_Create_TTQueryResultSet_TTDBConnectionS(struct database_core_TDBConnection_obj* bbt_db,BBSTRING bbt_sql){
	struct database_postgresql_TPostgreSQLResultSet_obj* bbt_this=(struct database_postgresql_TPostgreSQLResultSet_obj*)((struct database_postgresql_TPostgreSQLResultSet_obj*)&bbNullObject);
	struct BBDebugScope_3 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"Create",
		{
			{
				BBDEBUGDECL_LOCAL,
				"db",
				":TDBConnection",
				.var_address=&bbt_db
			},
			{
				BBDEBUGDECL_LOCAL,
				"sql",
				"$",
				.var_address=&bbt_sql
			},
			{
				BBDEBUGDECL_LOCAL,
				"this",
				":TPostgreSQLResultSet",
				.var_address=&bbt_this
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 299, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbt_this=(struct database_postgresql_TPostgreSQLResultSet_obj*)(struct database_postgresql_TPostgreSQLResultSet_obj*)bbObjectNew((BBClass *)&database_postgresql_TPostgreSQLResultSet);
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 301, 0};
	bbOnDebugEnterStm(&__stmt_1);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)bbt_this))->clas->m_Init_TTDBConnectionS((struct database_core_TQueryResultSet_obj*)bbt_this,(struct database_core_TDBConnection_obj*)bbt_db,bbt_sql);
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 302, 0};
	bbOnDebugEnterStm(&__stmt_2);
	((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)bbt_this))->_database_core_tqueryresultset_rec =(struct database_core_TQueryRecord_obj*)database_core_TQueryRecord_Create_TTQueryRecord();
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 304, 0};
	bbOnDebugEnterStm(&__stmt_3);
	bbOnDebugLeaveScope();
	return (struct database_core_TQueryResultSet_obj*)((struct database_core_TQueryResultSet_obj*)bbObjectDowncast((BBOBJECT)bbt_this,(BBClass*)&database_core_TQueryResultSet));
}
void _database_postgresql_TPostgreSQLResultSet_clearResultSet(struct database_postgresql_TPostgreSQLResultSet_obj* o){
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"clearResultSet",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 316, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 317, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bmx_pgsql_PQclear(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult );
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 318, 0};
		bbOnDebugEnterStm(&__stmt_1);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult =0;
		bbOnDebugLeaveScope();
	}
	bbOnDebugLeaveScope();
}
void _database_postgresql_TPostgreSQLResultSet_cleanup(struct database_postgresql_TPostgreSQLResultSet_obj* o){
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"cleanup",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 323, 0};
	bbOnDebugEnterStm(&__stmt_0);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_clearResultSet((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 324, 0};
	bbOnDebugEnterStm(&__stmt_1);
	((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index =-1;
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 325, 0};
	bbOnDebugEnterStm(&__stmt_2);
	((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset__isactive =0;
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 326, 0};
	bbOnDebugEnterStm(&__stmt_3);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__queryrows =-1;
	bbOnDebugLeaveScope();
}
BBINT _database_postgresql_TPostgreSQLResultSet_executeQuery_S(struct database_postgresql_TPostgreSQLResultSet_obj* o,BBSTRING bbt_statement){
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	BBSTRING bbt_q=(&bbEmptyString);
	BBINT bbt_status=0;
	BBINT bbt_fieldCount=0;
	struct BBDebugScope_5 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"executeQuery",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"statement",
				"$",
				.var_address=&bbt_statement
			},
			{
				BBDEBUGDECL_LOCAL,
				"q",
				"$",
				.var_address=&bbt_q
			},
			{
				BBDEBUGDECL_LOCAL,
				"status",
				"i",
				.var_address=&bbt_status
			},
			{
				BBDEBUGDECL_LOCAL,
				"fieldCount",
				"i",
				.var_address=&bbt_fieldCount
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 331, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(!(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->clas->m_isOpen((struct database_core_TDBConnection_obj*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn )!=0)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 332, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 335, 0};
	bbOnDebugEnterStm(&__stmt_1);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 337, 0};
	bbOnDebugEnterStm(&__stmt_2);
	bbt_q=database_core_convertISO8859toUTF8(bbt_statement);
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 338, 0};
	bbOnDebugEnterStm(&__stmt_3);
	BBBYTE* bbt_ = (BBBYTE*)bbStringToCString(bbt_q);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult =bmx_pgsql_PQexec(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->_database_core_tdbconnection_handle ,(bbt_));
	bbMemFree(bbt_);
	struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 340, 0};
	bbOnDebugEnterStm(&__stmt_4);
	if(!(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult )){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 341, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 342, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_5 = {0xd2c85e7745290c31, 345, 0};
	bbOnDebugEnterStm(&__stmt_5);
	bbt_status=bmx_pgsql_PQresultStatus(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult );
	struct BBDebugStm __stmt_6 = {0xd2c85e7745290c31, 347, 0};
	bbOnDebugEnterStm(&__stmt_6);
	BBINT bbt_2=bbt_status;
	struct BBDebugStm __stmt_7 = {0xd2c85e7745290c31, 348, 0};
	bbOnDebugEnterStm(&__stmt_7);
	if(bbt_2==2){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 351, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__queryrows =bmx_pgsql_PQntuples(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult );
		bbOnDebugLeaveScope();
	}else{
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 352, 0};
		bbOnDebugEnterStm(&__stmt_0);
		if(bbt_2==1){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 355, 0};
			bbOnDebugEnterStm(&__stmt_0);
			((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__queryrows =-1;
			bbOnDebugLeaveScope();
		}else{
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 358, 0};
			bbOnDebugEnterStm(&__stmt_0);
			((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ,((BBString*)&_s17),database_core_convertUTF8toISO8859(bmx_pgsql_PQerrorMessage(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->_database_core_tdbconnection_handle )),3,0);
			struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 359, 0};
			bbOnDebugEnterStm(&__stmt_1);
			((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
			((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
			struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 360, 0};
			bbOnDebugEnterStm(&__stmt_2);
			bbOnDebugLeaveScope();
			bbOnDebugLeaveScope();
			bbOnDebugLeaveScope();
			return 0;
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_8 = {0xd2c85e7745290c31, 363, 0};
	bbOnDebugEnterStm(&__stmt_8);
	bbt_fieldCount=bmx_pgsql_PQnfields(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult );
	struct BBDebugStm __stmt_9 = {0xd2c85e7745290c31, 365, 0};
	bbOnDebugEnterStm(&__stmt_9);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_initRecord_i((struct database_postgresql_TPostgreSQLResultSet_obj*)o,bbt_fieldCount);
	struct BBDebugStm __stmt_10 = {0xd2c85e7745290c31, 369, 0};
	bbOnDebugEnterStm(&__stmt_10);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__rowsaffected =bbStringToInt((BBSTRING)bbStringFromCString(bmx_pgsql_PQcmdTuples(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult )));
	struct BBDebugStm __stmt_11 = {0xd2c85e7745290c31, 372, 0};
	bbOnDebugEnterStm(&__stmt_11);
	if(bbt_fieldCount!=0){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 374, 0};
		bbOnDebugEnterStm(&__stmt_0);
		{
			BBINT bbt_i=0;
			BBINT bbt_3=bbt_fieldCount;
			for(;(bbt_i<bbt_3);bbt_i=(bbt_i+1)){
				BBINT bbt_dtype=0;
				struct database_core_TQueryField_obj* bbt_qf=(struct database_core_TQueryField_obj*)((struct database_core_TQueryField_obj*)&bbNullObject);
				struct BBDebugScope_3 __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_LOCAL,
							"i",
							"i",
							.var_address=&bbt_i
						},
						{
							BBDEBUGDECL_LOCAL,
							"dtype",
							"i",
							.var_address=&bbt_dtype
						},
						{
							BBDEBUGDECL_LOCAL,
							"qf",
							":TQueryField",
							.var_address=&bbt_qf
						},
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 375, 0};
				bbOnDebugEnterStm(&__stmt_0);
				bbt_dtype=bmx_pgsql_PQftype(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,bbt_i);
				struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 376, 0};
				bbOnDebugEnterStm(&__stmt_1);
				bbt_qf=(struct database_core_TQueryField_obj*)database_core_TQueryField_Create_TTQueryField_Si(database_core_convertUTF8toISO8859(bmx_pgsql_PQfname(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,bbt_i)),o->clas->f_dbTypeFromNative_i_Sii((&bbEmptyString),bbt_dtype,0));
				struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 377, 0};
				bbOnDebugEnterStm(&__stmt_2);
				((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_length =bmx_pgsql_PQfsize(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,bbt_i);
				struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 378, 0};
				bbOnDebugEnterStm(&__stmt_3);
				((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_precision =bmx_pgsql_PQfmod(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,bbt_i);
				struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 379, 0};
				bbOnDebugEnterStm(&__stmt_4);
				((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_dtype =bbt_dtype;
				struct BBDebugStm __stmt_5 = {0xd2c85e7745290c31, 382, 0};
				bbOnDebugEnterStm(&__stmt_5);
				if(((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_length ==-1){
					struct BBDebugScope __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 383, 0};
					bbOnDebugEnterStm(&__stmt_0);
					((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_length =(((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_precision -4);
					struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 384, 0};
					bbOnDebugEnterStm(&__stmt_1);
					((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_precision =-1;
					bbOnDebugLeaveScope();
				}
				struct BBDebugStm __stmt_6 = {0xd2c85e7745290c31, 387, 0};
				bbOnDebugEnterStm(&__stmt_6);
				((struct database_core_TQueryRecord_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec ))->clas->m_setField_iTTQueryField((struct database_core_TQueryRecord_obj*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec ,bbt_i,(struct database_core_TQueryField_obj*)bbt_qf);
				bbOnDebugLeaveScope();
			}
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_12 = {0xd2c85e7745290c31, 392, 0};
	bbOnDebugEnterStm(&__stmt_12);
	if(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__queryrows ==-1){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 393, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
		bbOnDebugLeaveScope();
	}else{
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 395, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset__isactive =1;
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_13 = {0xd2c85e7745290c31, 398, 0};
	bbOnDebugEnterStm(&__stmt_13);
	bbOnDebugLeaveScope();
	return 1;
}
void _database_postgresql_TPostgreSQLResultSet_initRecord_i(struct database_postgresql_TPostgreSQLResultSet_obj* o,BBINT bbt_size){
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_2 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"initRecord",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"size",
				"i",
				.var_address=&bbt_size
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 403, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec )!= &bbNullObject){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 404, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TQueryRecord_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec ))->clas->m_clear((struct database_core_TQueryRecord_obj*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec );
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 406, 0};
		bbOnDebugEnterStm(&__stmt_1);
		if(bbt_size>0){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 407, 0};
			bbOnDebugEnterStm(&__stmt_0);
			((struct database_core_TQueryRecord_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec ))->clas->m_Init_i((struct database_core_TQueryRecord_obj*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec ,bbt_size);
			bbOnDebugLeaveScope();
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 411, 0};
	bbOnDebugEnterStm(&__stmt_1);
	((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o));
	((struct database_core_TQueryResultSet_obj*)o)->clas->m_resetValues_i((struct database_core_TQueryResultSet_obj*)o,bbt_size);
	bbOnDebugLeaveScope();
}
BBINT _database_postgresql_TPostgreSQLResultSet_prepare_S(struct database_postgresql_TPostgreSQLResultSet_obj* o,BBSTRING bbt_statement){
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	BBSTRING bbt_q=(&bbEmptyString);
	struct BBDebugScope_3 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"prepare",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"statement",
				"$",
				.var_address=&bbt_statement
			},
			{
				BBDEBUGDECL_LOCAL,
				"q",
				"$",
				.var_address=&bbt_q
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 416, 0};
	bbOnDebugEnterStm(&__stmt_0);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 418, 0};
	bbOnDebugEnterStm(&__stmt_1);
	if(!(bbt_statement!= &bbEmptyString) || ((bbt_statement->length)==0)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 419, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 422, 0};
	bbOnDebugEnterStm(&__stmt_2);
	if(!(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname != &bbEmptyString)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 423, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((BBOBJECT)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname =bbStringConcat(((BBString*)&_s18),((BBOBJECT)o)->clas->ToString((BBOBJECT)o));
		bbOnDebugLeaveScope();
	}else{
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 425, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_executeQuery_S((struct database_postgresql_TPostgreSQLResultSet_obj*)o,bbStringConcat(bbStringConcat(((BBString*)&_s15),((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname ),((BBString*)&_s16)));
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 426, 0};
		bbOnDebugEnterStm(&__stmt_1);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 429, 0};
	bbOnDebugEnterStm(&__stmt_3);
	bbt_q=database_core_convertISO8859toUTF8(bbt_statement);
	struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 431, 0};
	bbOnDebugEnterStm(&__stmt_4);
	BBBYTE* bbt_ = (BBBYTE*)bbStringToCString(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname );
	BBBYTE* bbt_2 = (BBBYTE*)bbStringToCString(bbt_q);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult =bmx_pgsql_PQprepare(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->_database_core_tdbconnection_handle ,(bbt_),(bbt_2));
	bbMemFree(bbt_2);
	bbMemFree(bbt_);
	struct BBDebugStm __stmt_5 = {0xd2c85e7745290c31, 433, 0};
	bbOnDebugEnterStm(&__stmt_5);
	if(!(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult )){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 434, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_6 = {0xd2c85e7745290c31, 437, 0};
	bbOnDebugEnterStm(&__stmt_6);
	if(bmx_pgsql_PQresultStatus(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult )!=1){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 438, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ,((BBString*)&_s19),database_core_convertUTF8toISO8859(bmx_pgsql_PQerrorMessage(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->_database_core_tdbconnection_handle )),3,0);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 439, 0};
		bbOnDebugEnterStm(&__stmt_1);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
		struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 440, 0};
		bbOnDebugEnterStm(&__stmt_2);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_7 = {0xd2c85e7745290c31, 443, 0};
	bbOnDebugEnterStm(&__stmt_7);
	bbOnDebugLeaveScope();
	return 1;
}
BBINT _database_postgresql_TPostgreSQLResultSet_execute(struct database_postgresql_TPostgreSQLResultSet_obj* o){
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	BBBYTE* bbt_params=0;
	BBINT* bbt_lengths=0;
	BBINT* bbt_formats=0;
	BBINT bbt_paramCount=0;
	BBINT bbt_length=0;
	BBSTRING bbt_s=(&bbEmptyString);
	BBARRAY bbt_strings=(&bbEmptyArray);
	BBARRAY bbt_values=(&bbEmptyArray);
	BBINT bbt_status=0;
	BBINT bbt_fieldCount=0;
	struct BBDebugScope_11 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"execute",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_LOCAL,
				"params",
				"*b",
				.var_address=&bbt_params
			},
			{
				BBDEBUGDECL_LOCAL,
				"lengths",
				"*i",
				.var_address=&bbt_lengths
			},
			{
				BBDEBUGDECL_LOCAL,
				"formats",
				"*i",
				.var_address=&bbt_formats
			},
			{
				BBDEBUGDECL_LOCAL,
				"paramCount",
				"i",
				.var_address=&bbt_paramCount
			},
			{
				BBDEBUGDECL_LOCAL,
				"length",
				"i",
				.var_address=&bbt_length
			},
			{
				BBDEBUGDECL_LOCAL,
				"s",
				"$",
				.var_address=&bbt_s
			},
			{
				BBDEBUGDECL_LOCAL,
				"strings",
				"[]*b",
				.var_address=&bbt_strings
			},
			{
				BBDEBUGDECL_LOCAL,
				"values",
				"[]:TDBType",
				.var_address=&bbt_values
			},
			{
				BBDEBUGDECL_LOCAL,
				"status",
				"i",
				.var_address=&bbt_status
			},
			{
				BBDEBUGDECL_LOCAL,
				"fieldCount",
				"i",
				.var_address=&bbt_fieldCount
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 448, 0};
	bbOnDebugEnterStm(&__stmt_0);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 450, 0};
	bbOnDebugEnterStm(&__stmt_1);
	bbt_params=0;
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 451, 0};
	bbOnDebugEnterStm(&__stmt_2);
	bbt_lengths=0;
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 452, 0};
	bbOnDebugEnterStm(&__stmt_3);
	bbt_formats=0;
	struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 453, 0};
	bbOnDebugEnterStm(&__stmt_4);
	bbt_paramCount=0;
	struct BBDebugStm __stmt_5 = {0xd2c85e7745290c31, 454, 0};
	bbOnDebugEnterStm(&__stmt_5);
	bbt_length=0;
	struct BBDebugStm __stmt_6 = {0xd2c85e7745290c31, 455, 0};
	bbOnDebugEnterStm(&__stmt_6);
	bbt_s=((BBString*)&bbEmptyString);
	struct BBDebugStm __stmt_7 = {0xd2c85e7745290c31, 456, 0};
	bbOnDebugEnterStm(&__stmt_7);
	bbt_strings=(&bbEmptyArray);
	struct BBDebugStm __stmt_8 = {0xd2c85e7745290c31, 459, 0};
	bbOnDebugEnterStm(&__stmt_8);
	bbt_values=((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_boundvalues ;
	struct BBDebugStm __stmt_9 = {0xd2c85e7745290c31, 461, 0};
	bbOnDebugEnterStm(&__stmt_9);
	if(bbt_values!= &bbEmptyArray){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 462, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbt_paramCount=(bbt_values->scales[0]);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 485, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bbt_strings=bbArrayNew1D("*b", bbt_paramCount);
		struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 486, 0};
		bbOnDebugEnterStm(&__stmt_2);
		bbt_params=bmx_pgsql_createParamValues(bbt_paramCount);
		struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 487, 0};
		bbOnDebugEnterStm(&__stmt_3);
		bbt_lengths=bmx_pgsql_createParamInts(bbt_paramCount);
		struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 488, 0};
		bbOnDebugEnterStm(&__stmt_4);
		bbt_formats=bmx_pgsql_createParamInts(bbt_paramCount);
		struct BBDebugStm __stmt_5 = {0xd2c85e7745290c31, 490, 0};
		bbOnDebugEnterStm(&__stmt_5);
		{
			BBINT bbt_i=0;
			BBINT bbt_=bbt_paramCount;
			for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
				struct BBDebugScope_1 __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_LOCAL,
							"i",
							"i",
							.var_address=&bbt_i
						},
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 492, 0};
				bbOnDebugEnterStm(&__stmt_0);
				struct database_core_dbtypes_TDBType_obj* bbt_2;
				if(!(((BBObject*)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])!= &bbNullObject) || ((((struct database_core_dbtypes_TDBType_obj*)bbNullObjectTest((BBObject*)(bbt_2 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])))->clas)->m_isNull((struct database_core_dbtypes_TDBType_obj*)bbt_2)!=0)){
					struct BBDebugScope __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 493, 0};
					bbOnDebugEnterStm(&__stmt_0);
					bmx_pgsql_setNullParam(bbt_params,bbt_i);
					bbOnDebugLeaveScope();
				}else{
					struct BBDebugScope __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 496, 0};
					bbOnDebugEnterStm(&__stmt_0);
					struct database_core_dbtypes_TDBType_obj* bbt_4;
					BBINT bbt_3=(((struct database_core_dbtypes_TDBType_obj*)bbNullObjectTest((BBObject*)(bbt_4 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])))->clas)->m_kind((struct database_core_dbtypes_TDBType_obj*)bbt_4);
					struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 497, 0};
					bbOnDebugEnterStm(&__stmt_1);
					if(bbt_3==2){
						struct BBDebugScope __scope = {
							BBDEBUGSCOPE_LOCALBLOCK,
							0,
							{
								{
									BBDEBUGDECL_END
								}
							}
						};
						bbOnDebugEnterScope((BBDebugScope *)&__scope);
						struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 498, 0};
						bbOnDebugEnterStm(&__stmt_0);
						bbt_s=bbStringFromInt(((struct database_core_dbtypes_TDBInt_obj*)bbNullObjectTest((BBObject*)((struct database_core_dbtypes_TDBInt_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBInt))))->_database_core_dbtypes_tdbint_value );
						struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 499, 0};
						bbOnDebugEnterStm(&__stmt_1);
						((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=bbStringToCString((BBSTRING)bbt_s);
						struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 500, 0};
						bbOnDebugEnterStm(&__stmt_2);
						bmx_pgsql_setParam(bbt_params,bbt_lengths,bbt_formats,bbt_i,((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(bbt_s->length));
						bbOnDebugLeaveScope();
					}else{
						struct BBDebugScope __scope = {
							BBDEBUGSCOPE_LOCALBLOCK,
							0,
							{
								{
									BBDEBUGDECL_END
								}
							}
						};
						bbOnDebugEnterScope((BBDebugScope *)&__scope);
						struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 501, 0};
						bbOnDebugEnterStm(&__stmt_0);
						if(bbt_3==5){
							struct BBDebugScope __scope = {
								BBDEBUGSCOPE_LOCALBLOCK,
								0,
								{
									{
										BBDEBUGDECL_END
									}
								}
							};
							bbOnDebugEnterScope((BBDebugScope *)&__scope);
							struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 502, 0};
							bbOnDebugEnterStm(&__stmt_0);
							bbt_s=bbStringFromLong(((struct database_core_dbtypes_TDBLong_obj*)bbNullObjectTest((BBObject*)((struct database_core_dbtypes_TDBLong_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBLong))))->_database_core_dbtypes_tdblong_value );
							struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 503, 0};
							bbOnDebugEnterStm(&__stmt_1);
							((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=bbStringToCString((BBSTRING)bbt_s);
							struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 504, 0};
							bbOnDebugEnterStm(&__stmt_2);
							bmx_pgsql_setParam(bbt_params,bbt_lengths,bbt_formats,bbt_i,((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(bbt_s->length));
							bbOnDebugLeaveScope();
						}else{
							struct BBDebugScope __scope = {
								BBDEBUGSCOPE_LOCALBLOCK,
								0,
								{
									{
										BBDEBUGDECL_END
									}
								}
							};
							bbOnDebugEnterScope((BBDebugScope *)&__scope);
							struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 505, 0};
							bbOnDebugEnterStm(&__stmt_0);
							if(bbt_3==4){
								struct BBDebugScope __scope = {
									BBDEBUGSCOPE_LOCALBLOCK,
									0,
									{
										{
											BBDEBUGDECL_END
										}
									}
								};
								bbOnDebugEnterScope((BBDebugScope *)&__scope);
								struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 506, 0};
								bbOnDebugEnterStm(&__stmt_0);
								bbt_s=bbStringFromFloat(((struct database_core_dbtypes_TDBFloat_obj*)bbNullObjectTest((BBObject*)((struct database_core_dbtypes_TDBFloat_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBFloat))))->_database_core_dbtypes_tdbfloat_value );
								struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 507, 0};
								bbOnDebugEnterStm(&__stmt_1);
								((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=bbStringToCString((BBSTRING)bbt_s);
								struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 508, 0};
								bbOnDebugEnterStm(&__stmt_2);
								bmx_pgsql_setParam(bbt_params,bbt_lengths,bbt_formats,bbt_i,((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(bbt_s->length));
								bbOnDebugLeaveScope();
							}else{
								struct BBDebugScope __scope = {
									BBDEBUGSCOPE_LOCALBLOCK,
									0,
									{
										{
											BBDEBUGDECL_END
										}
									}
								};
								bbOnDebugEnterScope((BBDebugScope *)&__scope);
								struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 509, 0};
								bbOnDebugEnterStm(&__stmt_0);
								if(bbt_3==3){
									struct BBDebugScope __scope = {
										BBDEBUGSCOPE_LOCALBLOCK,
										0,
										{
											{
												BBDEBUGDECL_END
											}
										}
									};
									bbOnDebugEnterScope((BBDebugScope *)&__scope);
									struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 510, 0};
									bbOnDebugEnterStm(&__stmt_0);
									bbt_s=bbStringFromDouble(((struct database_core_dbtypes_TDBDouble_obj*)bbNullObjectTest((BBObject*)((struct database_core_dbtypes_TDBDouble_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBDouble))))->_database_core_dbtypes_tdbdouble_value );
									struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 511, 0};
									bbOnDebugEnterStm(&__stmt_1);
									((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=bbStringToCString((BBSTRING)bbt_s);
									struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 512, 0};
									bbOnDebugEnterStm(&__stmt_2);
									bmx_pgsql_setParam(bbt_params,bbt_lengths,bbt_formats,bbt_i,((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(bbt_s->length));
									bbOnDebugLeaveScope();
								}else{
									struct BBDebugScope __scope = {
										BBDEBUGSCOPE_LOCALBLOCK,
										0,
										{
											{
												BBDEBUGDECL_END
											}
										}
									};
									bbOnDebugEnterScope((BBDebugScope *)&__scope);
									struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 513, 0};
									bbOnDebugEnterStm(&__stmt_0);
									if(bbt_3==7){
										struct database_core_dbtypes_TDBBlob_obj* bbt_b=(struct database_core_dbtypes_TDBBlob_obj*)((struct database_core_dbtypes_TDBBlob_obj*)&bbNullObject);
										struct BBDebugScope_1 __scope = {
											BBDEBUGSCOPE_LOCALBLOCK,
											0,
											{
												{
													BBDEBUGDECL_LOCAL,
													"b",
													":TDBBlob",
													.var_address=&bbt_b
												},
												{
													BBDEBUGDECL_END
												}
											}
										};
										bbOnDebugEnterScope((BBDebugScope *)&__scope);
										struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 514, 0};
										bbOnDebugEnterStm(&__stmt_0);
										bbt_b=(struct database_core_dbtypes_TDBBlob_obj*)((struct database_core_dbtypes_TDBBlob_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBBlob));
										struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 515, 0};
										bbOnDebugEnterStm(&__stmt_1);
										bmx_pgsql_setParamBinary(bbt_params,bbt_lengths,bbt_formats,bbt_i,((struct database_core_dbtypes_TDBBlob_obj*)bbNullObjectTest((BBObject*)bbt_b))->_database_core_dbtypes_tdbblob_value ,((struct database_core_dbtypes_TDBBlob_obj*)bbNullObjectTest((BBObject*)bbt_b))->_database_core_dbtypes_tdbblob__size );
										bbOnDebugLeaveScope();
									}else{
										struct BBDebugScope __scope = {
											BBDEBUGSCOPE_LOCALBLOCK,
											0,
											{
												{
													BBDEBUGDECL_END
												}
											}
										};
										bbOnDebugEnterScope((BBDebugScope *)&__scope);
										struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 516, 0};
										bbOnDebugEnterStm(&__stmt_0);
										if(bbt_3==6){
											struct BBDebugScope __scope = {
												BBDEBUGSCOPE_LOCALBLOCK,
												0,
												{
													{
														BBDEBUGDECL_END
													}
												}
											};
											bbOnDebugEnterScope((BBDebugScope *)&__scope);
											struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 517, 0};
											bbOnDebugEnterStm(&__stmt_0);
											struct database_core_dbtypes_TDBDate_obj* bbt_5;
											bbt_s=(((struct database_core_dbtypes_TDBDate_obj*)((struct database_core_dbtypes_TDBDate_obj*)bbNullObjectTest((BBObject*)(bbt_5 = ((struct database_core_dbtypes_TDBDate_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBDate))))))->clas)->m_getString((struct database_core_dbtypes_TDBDate_obj*)bbt_5);
											struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 518, 0};
											bbOnDebugEnterStm(&__stmt_1);
											((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=bbStringToCString((BBSTRING)bbt_s);
											struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 519, 0};
											bbOnDebugEnterStm(&__stmt_2);
											bmx_pgsql_setParam(bbt_params,bbt_lengths,bbt_formats,bbt_i,((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(bbt_s->length));
											bbOnDebugLeaveScope();
										}else{
											struct BBDebugScope __scope = {
												BBDEBUGSCOPE_LOCALBLOCK,
												0,
												{
													{
														BBDEBUGDECL_END
													}
												}
											};
											bbOnDebugEnterScope((BBDebugScope *)&__scope);
											struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 520, 0};
											bbOnDebugEnterStm(&__stmt_0);
											if(bbt_3==8){
												struct BBDebugScope __scope = {
													BBDEBUGSCOPE_LOCALBLOCK,
													0,
													{
														{
															BBDEBUGDECL_END
														}
													}
												};
												bbOnDebugEnterScope((BBDebugScope *)&__scope);
												struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 521, 0};
												bbOnDebugEnterStm(&__stmt_0);
												struct database_core_dbtypes_TDBDateTime_obj* bbt_6;
												bbt_s=(((struct database_core_dbtypes_TDBDateTime_obj*)((struct database_core_dbtypes_TDBDateTime_obj*)bbNullObjectTest((BBObject*)(bbt_6 = ((struct database_core_dbtypes_TDBDateTime_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBDateTime))))))->clas)->m_getString((struct database_core_dbtypes_TDBDateTime_obj*)bbt_6);
												struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 522, 0};
												bbOnDebugEnterStm(&__stmt_1);
												((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=bbStringToCString((BBSTRING)bbt_s);
												struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 523, 0};
												bbOnDebugEnterStm(&__stmt_2);
												bmx_pgsql_setParam(bbt_params,bbt_lengths,bbt_formats,bbt_i,((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(bbt_s->length));
												bbOnDebugLeaveScope();
											}else{
												struct BBDebugScope __scope = {
													BBDEBUGSCOPE_LOCALBLOCK,
													0,
													{
														{
															BBDEBUGDECL_END
														}
													}
												};
												bbOnDebugEnterScope((BBDebugScope *)&__scope);
												struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 524, 0};
												bbOnDebugEnterStm(&__stmt_0);
												if(bbt_3==9){
													struct BBDebugScope __scope = {
														BBDEBUGSCOPE_LOCALBLOCK,
														0,
														{
															{
																BBDEBUGDECL_END
															}
														}
													};
													bbOnDebugEnterScope((BBDebugScope *)&__scope);
													struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 525, 0};
													bbOnDebugEnterStm(&__stmt_0);
													struct database_core_dbtypes_TDBTime_obj* bbt_7;
													bbt_s=(((struct database_core_dbtypes_TDBTime_obj*)((struct database_core_dbtypes_TDBTime_obj*)bbNullObjectTest((BBObject*)(bbt_7 = ((struct database_core_dbtypes_TDBTime_obj*)bbObjectDowncast((BBOBJECT)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(BBClass*)&database_core_dbtypes_TDBTime))))))->clas)->m_getString((struct database_core_dbtypes_TDBTime_obj*)bbt_7);
													struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 526, 0};
													bbOnDebugEnterStm(&__stmt_1);
													((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=bbStringToCString((BBSTRING)bbt_s);
													struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 527, 0};
													bbOnDebugEnterStm(&__stmt_2);
													bmx_pgsql_setParam(bbt_params,bbt_lengths,bbt_formats,bbt_i,((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(bbt_s->length));
													bbOnDebugLeaveScope();
												}else{
													BBSTRING bbt_s2=(&bbEmptyString);
													struct BBDebugScope_1 __scope = {
														BBDEBUGSCOPE_LOCALBLOCK,
														0,
														{
															{
																BBDEBUGDECL_LOCAL,
																"s",
																"$",
																.var_address=&bbt_s2
															},
															{
																BBDEBUGDECL_END
															}
														}
													};
													bbOnDebugEnterScope((BBDebugScope *)&__scope);
													struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 529, 0};
													bbOnDebugEnterStm(&__stmt_0);
													struct database_core_dbtypes_TDBType_obj* bbt_8;
													bbt_s2=database_core_convertISO8859toUTF8((((struct database_core_dbtypes_TDBType_obj*)bbNullObjectTest((BBObject*)(bbt_8 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((bbt_values),(bbt_values)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])))->clas)->m_getString((struct database_core_dbtypes_TDBType_obj*)bbt_8));
													struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 530, 0};
													bbOnDebugEnterStm(&__stmt_1);
													((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=bbStringToCString((BBSTRING)bbt_s2);
													struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 532, 0};
													bbOnDebugEnterStm(&__stmt_2);
													bmx_pgsql_setParam(bbt_params,bbt_lengths,bbt_formats,bbt_i,((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)],(bbt_s2->length));
													bbOnDebugLeaveScope();
												}
												bbOnDebugLeaveScope();
											}
											bbOnDebugLeaveScope();
										}
										bbOnDebugLeaveScope();
									}
									bbOnDebugLeaveScope();
								}
								bbOnDebugLeaveScope();
							}
							bbOnDebugLeaveScope();
						}
						bbOnDebugLeaveScope();
					}
					bbOnDebugLeaveScope();
				}
				bbOnDebugLeaveScope();
			}
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_10 = {0xd2c85e7745290c31, 546, 0};
	bbOnDebugEnterStm(&__stmt_10);
	if(bbt_params){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 548, 0};
		bbOnDebugEnterStm(&__stmt_0);
		BBBYTE* bbt_9 = (BBBYTE*)bbStringToCString(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname );
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult =bmx_pgsql_PQexecPrepared(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->_database_core_tdbconnection_handle ,(bbt_9),bbt_paramCount,bbt_params,bbt_lengths,bbt_formats);
		bbMemFree(bbt_9);
		bbOnDebugLeaveScope();
	}else{
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 551, 0};
		bbOnDebugEnterStm(&__stmt_0);
		BBBYTE* bbt_10 = (BBBYTE*)bbStringToCString(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__preparedstatementname );
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult =bmx_pgsql_PQexecPrepared(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->_database_core_tdbconnection_handle ,(bbt_10),bbt_paramCount,0,0,0);
		bbMemFree(bbt_10);
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_11 = {0xd2c85e7745290c31, 555, 0};
	bbOnDebugEnterStm(&__stmt_11);
	{
		BBINT bbt_i2=0;
		BBINT bbt_11=bbt_paramCount;
		for(;(bbt_i2<bbt_11);bbt_i2=(bbt_i2+1)){
			struct BBDebugScope_1 __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_LOCAL,
						"i",
						"i",
						.var_address=&bbt_i2
					},
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 556, 0};
			bbOnDebugEnterStm(&__stmt_0);
			if(((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i2)))[((BBUINT)bbt_i2)]){
				struct BBDebugScope __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 557, 0};
				bbOnDebugEnterStm(&__stmt_0);
				bbMemFree((void*)((BBBYTE**)BBARRAYDATAINDEX((bbt_strings),(bbt_strings)->dims,((BBUINT)bbt_i2)))[((BBUINT)bbt_i2)]);
				bbOnDebugLeaveScope();
			}
			bbOnDebugLeaveScope();
		}
	}
	struct BBDebugStm __stmt_12 = {0xd2c85e7745290c31, 561, 0};
	bbOnDebugEnterStm(&__stmt_12);
	if(bbt_params){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 562, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bmx_pgsql_deleteParamValues(bbt_params);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 563, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bmx_pgsql_deleteParamInts(bbt_lengths);
		struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 564, 0};
		bbOnDebugEnterStm(&__stmt_2);
		bmx_pgsql_deleteParamInts(bbt_formats);
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_13 = {0xd2c85e7745290c31, 567, 0};
	bbOnDebugEnterStm(&__stmt_13);
	if(!(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult )){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 568, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ,((BBString*)&_s20),((BBString*)&bbEmptyString),3,0);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 569, 0};
		bbOnDebugEnterStm(&__stmt_1);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
		struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 570, 0};
		bbOnDebugEnterStm(&__stmt_2);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_14 = {0xd2c85e7745290c31, 573, 0};
	bbOnDebugEnterStm(&__stmt_14);
	bbt_status=bmx_pgsql_PQresultStatus(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult );
	struct BBDebugStm __stmt_15 = {0xd2c85e7745290c31, 575, 0};
	bbOnDebugEnterStm(&__stmt_15);
	BBINT bbt_12=bbt_status;
	struct BBDebugStm __stmt_16 = {0xd2c85e7745290c31, 576, 0};
	bbOnDebugEnterStm(&__stmt_16);
	if(bbt_12==2){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 579, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__queryrows =bmx_pgsql_PQntuples(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult );
		bbOnDebugLeaveScope();
	}else{
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 580, 0};
		bbOnDebugEnterStm(&__stmt_0);
		if(bbt_12==1){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 583, 0};
			bbOnDebugEnterStm(&__stmt_0);
			((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__queryrows =-1;
			bbOnDebugLeaveScope();
		}else{
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 586, 0};
			bbOnDebugEnterStm(&__stmt_0);
			((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ,((BBString*)&_s20),database_core_convertUTF8toISO8859(bmx_pgsql_PQerrorMessage(((struct database_core_TDBConnection_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_conn ))->_database_core_tdbconnection_handle )),3,0);
			struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 587, 0};
			bbOnDebugEnterStm(&__stmt_1);
			((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
			((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
			struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 588, 0};
			bbOnDebugEnterStm(&__stmt_2);
			bbOnDebugLeaveScope();
			bbOnDebugLeaveScope();
			bbOnDebugLeaveScope();
			return 0;
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_17 = {0xd2c85e7745290c31, 591, 0};
	bbOnDebugEnterStm(&__stmt_17);
	bbt_fieldCount=bmx_pgsql_PQnfields(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult );
	struct BBDebugStm __stmt_18 = {0xd2c85e7745290c31, 593, 0};
	bbOnDebugEnterStm(&__stmt_18);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_initRecord_i((struct database_postgresql_TPostgreSQLResultSet_obj*)o,bbt_fieldCount);
	struct BBDebugStm __stmt_19 = {0xd2c85e7745290c31, 597, 0};
	bbOnDebugEnterStm(&__stmt_19);
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__rowsaffected =bbStringToInt((BBSTRING)bbStringFromCString(bmx_pgsql_PQcmdTuples(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult )));
	struct BBDebugStm __stmt_20 = {0xd2c85e7745290c31, 600, 0};
	bbOnDebugEnterStm(&__stmt_20);
	if(bbt_fieldCount!=0){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 602, 0};
		bbOnDebugEnterStm(&__stmt_0);
		{
			BBINT bbt_i3=0;
			BBINT bbt_13=bbt_fieldCount;
			for(;(bbt_i3<bbt_13);bbt_i3=(bbt_i3+1)){
				BBINT bbt_dtype=0;
				struct database_core_TQueryField_obj* bbt_qf=(struct database_core_TQueryField_obj*)((struct database_core_TQueryField_obj*)&bbNullObject);
				struct BBDebugScope_3 __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_LOCAL,
							"i",
							"i",
							.var_address=&bbt_i3
						},
						{
							BBDEBUGDECL_LOCAL,
							"dtype",
							"i",
							.var_address=&bbt_dtype
						},
						{
							BBDEBUGDECL_LOCAL,
							"qf",
							":TQueryField",
							.var_address=&bbt_qf
						},
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 603, 0};
				bbOnDebugEnterStm(&__stmt_0);
				bbt_dtype=bmx_pgsql_PQftype(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,bbt_i3);
				struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 604, 0};
				bbOnDebugEnterStm(&__stmt_1);
				bbt_qf=(struct database_core_TQueryField_obj*)database_core_TQueryField_Create_TTQueryField_Si(database_core_convertUTF8toISO8859(bmx_pgsql_PQfname(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,bbt_i3)),o->clas->f_dbTypeFromNative_i_Sii((&bbEmptyString),bbt_dtype,0));
				struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 605, 0};
				bbOnDebugEnterStm(&__stmt_2);
				((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_length =bmx_pgsql_PQfsize(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,bbt_i3);
				struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 606, 0};
				bbOnDebugEnterStm(&__stmt_3);
				((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_precision =bmx_pgsql_PQfmod(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,bbt_i3);
				struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 607, 0};
				bbOnDebugEnterStm(&__stmt_4);
				((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_dtype =bbt_dtype;
				struct BBDebugStm __stmt_5 = {0xd2c85e7745290c31, 610, 0};
				bbOnDebugEnterStm(&__stmt_5);
				if(((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_length ==-1){
					struct BBDebugScope __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 611, 0};
					bbOnDebugEnterStm(&__stmt_0);
					((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_length =(((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_precision -4);
					struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 612, 0};
					bbOnDebugEnterStm(&__stmt_1);
					((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)bbt_qf))->_database_core_tqueryfield_precision =-1;
					bbOnDebugLeaveScope();
				}
				struct BBDebugStm __stmt_6 = {0xd2c85e7745290c31, 615, 0};
				bbOnDebugEnterStm(&__stmt_6);
				((struct database_core_TQueryRecord_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec ))->clas->m_setField_iTTQueryField((struct database_core_TQueryRecord_obj*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec ,bbt_i3,(struct database_core_TQueryField_obj*)bbt_qf);
				bbOnDebugLeaveScope();
			}
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_21 = {0xd2c85e7745290c31, 622, 0};
	bbOnDebugEnterStm(&__stmt_21);
	if(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__queryrows <1){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 623, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
		bbOnDebugLeaveScope();
	}else{
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 625, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset__isactive =1;
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_22 = {0xd2c85e7745290c31, 628, 0};
	bbOnDebugEnterStm(&__stmt_22);
	bbOnDebugLeaveScope();
	return 1;
}
BBINT _database_postgresql_TPostgreSQLResultSet_firstRow(struct database_postgresql_TPostgreSQLResultSet_obj* o){
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"firstRow",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 632, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index ==-1){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 633, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return ((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_nextRow((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 636, 0};
	bbOnDebugEnterStm(&__stmt_1);
	bbOnDebugLeaveScope();
	return 0;
}
BBINT _database_postgresql_TPostgreSQLResultSet_nextRow(struct database_postgresql_TPostgreSQLResultSet_obj* o){
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"nextRow",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 641, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if(!(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset__isactive !=0)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 642, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 643, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 646, 0};
	bbOnDebugEnterStm(&__stmt_1);
	if(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index >=(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__queryrows -1)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 647, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_cleanup((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
		struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 648, 0};
		bbOnDebugEnterStm(&__stmt_1);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return 0;
	}
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 653, 0};
	bbOnDebugEnterStm(&__stmt_2);
	{
		BBINT bbt_i=0;
		BBINT bbt_=((struct database_core_TQueryRecord_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec ))->clas->m_count((struct database_core_TQueryRecord_obj*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec );
		for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
			struct BBDebugScope_1 __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_LOCAL,
						"i",
						"i",
						.var_address=&bbt_i
					},
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 655, 0};
			bbOnDebugEnterStm(&__stmt_0);
			if(((BBObject*)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])!= &bbNullObject){
				struct BBDebugScope __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 656, 0};
				bbOnDebugEnterStm(&__stmt_0);
				struct database_core_dbtypes_TDBType_obj* bbt_2;
				(((struct database_core_dbtypes_TDBType_obj*)bbNullObjectTest((BBObject*)(bbt_2 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])))->clas)->m_clear((struct database_core_dbtypes_TDBType_obj*)bbt_2);
				bbOnDebugLeaveScope();
			}
			struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 659, 0};
			bbOnDebugEnterStm(&__stmt_1);
			if(!(bmx_pgsql_PQgetisnull(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i)!=0)){
				BBINT bbt_fieldLength=0;
				struct BBDebugScope_1 __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_LOCAL,
							"fieldLength",
							"i",
							.var_address=&bbt_fieldLength
						},
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 661, 0};
				bbOnDebugEnterStm(&__stmt_0);
				bbt_fieldLength=bmx_pgsql_PQgetlength(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i);
				struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 663, 0};
				bbOnDebugEnterStm(&__stmt_1);
				BBINT bbt_3=((struct database_core_TQueryField_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryField_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryRecord_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec ))->_database_core_tqueryrecord_fields ),(((struct database_core_TQueryRecord_obj*)bbNullObjectTest((BBObject*)((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_rec ))->_database_core_tqueryrecord_fields )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]))->_database_core_tqueryfield_ftype ;
				struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 664, 0};
				bbOnDebugEnterStm(&__stmt_2);
				if(bbt_3==2){
					struct BBDebugScope __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 665, 0};
					bbOnDebugEnterStm(&__stmt_0);
					((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBInt_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBInt),(BBClass*)&database_core_dbtypes_TDBType));
					struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 666, 0};
					bbOnDebugEnterStm(&__stmt_1);
					struct database_core_dbtypes_TDBType_obj* bbt_4;
					(((struct database_core_dbtypes_TDBType_obj*)bbNullObjectTest((BBObject*)(bbt_4 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])))->clas)->m_setInt_i((struct database_core_dbtypes_TDBType_obj*)bbt_4,bbStringToInt((BBSTRING)bbStringFromBytes(bmx_pgsql_PQgetvalue(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i),bbt_fieldLength)));
					bbOnDebugLeaveScope();
				}else{
					struct BBDebugScope __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 667, 0};
					bbOnDebugEnterStm(&__stmt_0);
					if(bbt_3==5){
						struct BBDebugScope __scope = {
							BBDEBUGSCOPE_LOCALBLOCK,
							0,
							{
								{
									BBDEBUGDECL_END
								}
							}
						};
						bbOnDebugEnterScope((BBDebugScope *)&__scope);
						struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 668, 0};
						bbOnDebugEnterStm(&__stmt_0);
						((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBLong_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBLong),(BBClass*)&database_core_dbtypes_TDBType));
						struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 669, 0};
						bbOnDebugEnterStm(&__stmt_1);
						struct database_core_dbtypes_TDBType_obj* bbt_5;
						(((struct database_core_dbtypes_TDBType_obj*)bbNullObjectTest((BBObject*)(bbt_5 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])))->clas)->m_setLong_l((struct database_core_dbtypes_TDBType_obj*)bbt_5,bbStringToLong((BBSTRING)bbStringFromBytes(bmx_pgsql_PQgetvalue(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i),bbt_fieldLength)));
						bbOnDebugLeaveScope();
					}else{
						struct BBDebugScope __scope = {
							BBDEBUGSCOPE_LOCALBLOCK,
							0,
							{
								{
									BBDEBUGDECL_END
								}
							}
						};
						bbOnDebugEnterScope((BBDebugScope *)&__scope);
						struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 670, 0};
						bbOnDebugEnterStm(&__stmt_0);
						if(bbt_3==4){
							struct BBDebugScope __scope = {
								BBDEBUGSCOPE_LOCALBLOCK,
								0,
								{
									{
										BBDEBUGDECL_END
									}
								}
							};
							bbOnDebugEnterScope((BBDebugScope *)&__scope);
							struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 671, 0};
							bbOnDebugEnterStm(&__stmt_0);
							((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBFloat_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBFloat),(BBClass*)&database_core_dbtypes_TDBType));
							struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 672, 0};
							bbOnDebugEnterStm(&__stmt_1);
							struct database_core_dbtypes_TDBType_obj* bbt_6;
							(((struct database_core_dbtypes_TDBType_obj*)bbNullObjectTest((BBObject*)(bbt_6 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])))->clas)->m_SetFloat_f((struct database_core_dbtypes_TDBType_obj*)bbt_6,bbStringToFloat((BBSTRING)bbStringFromBytes(bmx_pgsql_PQgetvalue(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i),bbt_fieldLength)));
							bbOnDebugLeaveScope();
						}else{
							struct BBDebugScope __scope = {
								BBDEBUGSCOPE_LOCALBLOCK,
								0,
								{
									{
										BBDEBUGDECL_END
									}
								}
							};
							bbOnDebugEnterScope((BBDebugScope *)&__scope);
							struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 673, 0};
							bbOnDebugEnterStm(&__stmt_0);
							if(bbt_3==3){
								struct BBDebugScope __scope = {
									BBDEBUGSCOPE_LOCALBLOCK,
									0,
									{
										{
											BBDEBUGDECL_END
										}
									}
								};
								bbOnDebugEnterScope((BBDebugScope *)&__scope);
								struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 674, 0};
								bbOnDebugEnterStm(&__stmt_0);
								((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBDouble_obj*)bbObjectAtomicNew((BBClass *)&database_core_dbtypes_TDBDouble),(BBClass*)&database_core_dbtypes_TDBType));
								struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 675, 0};
								bbOnDebugEnterStm(&__stmt_1);
								struct database_core_dbtypes_TDBType_obj* bbt_7;
								(((struct database_core_dbtypes_TDBType_obj*)bbNullObjectTest((BBObject*)(bbt_7 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])))->clas)->m_setDouble_d((struct database_core_dbtypes_TDBType_obj*)bbt_7,bbStringToDouble((BBSTRING)bbStringFromBytes(bmx_pgsql_PQgetvalue(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i),bbt_fieldLength)));
								bbOnDebugLeaveScope();
							}else{
								struct BBDebugScope __scope = {
									BBDEBUGSCOPE_LOCALBLOCK,
									0,
									{
										{
											BBDEBUGDECL_END
										}
									}
								};
								bbOnDebugEnterScope((BBDebugScope *)&__scope);
								struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 676, 0};
								bbOnDebugEnterStm(&__stmt_0);
								if(bbt_3==6){
									struct BBDebugScope __scope = {
										BBDEBUGSCOPE_LOCALBLOCK,
										0,
										{
											{
												BBDEBUGDECL_END
											}
										}
									};
									bbOnDebugEnterScope((BBDebugScope *)&__scope);
									struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 677, 0};
									bbOnDebugEnterStm(&__stmt_0);
									((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBDate_SetFromString_TTDBDate_S(bbStringFromBytes(bmx_pgsql_PQgetvalue(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i),bbt_fieldLength)),(BBClass*)&database_core_dbtypes_TDBType));
									bbOnDebugLeaveScope();
								}else{
									struct BBDebugScope __scope = {
										BBDEBUGSCOPE_LOCALBLOCK,
										0,
										{
											{
												BBDEBUGDECL_END
											}
										}
									};
									bbOnDebugEnterScope((BBDebugScope *)&__scope);
									struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 678, 0};
									bbOnDebugEnterStm(&__stmt_0);
									if(bbt_3==8){
										struct BBDebugScope __scope = {
											BBDEBUGSCOPE_LOCALBLOCK,
											0,
											{
												{
													BBDEBUGDECL_END
												}
											}
										};
										bbOnDebugEnterScope((BBDebugScope *)&__scope);
										struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 679, 0};
										bbOnDebugEnterStm(&__stmt_0);
										((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBDateTime_SetFromString_TTDBDateTime_S(bbStringFromBytes(bmx_pgsql_PQgetvalue(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i),bbt_fieldLength)),(BBClass*)&database_core_dbtypes_TDBType));
										bbOnDebugLeaveScope();
									}else{
										struct BBDebugScope __scope = {
											BBDEBUGSCOPE_LOCALBLOCK,
											0,
											{
												{
													BBDEBUGDECL_END
												}
											}
										};
										bbOnDebugEnterScope((BBDebugScope *)&__scope);
										struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 680, 0};
										bbOnDebugEnterStm(&__stmt_0);
										if(bbt_3==9){
											struct BBDebugScope __scope = {
												BBDEBUGSCOPE_LOCALBLOCK,
												0,
												{
													{
														BBDEBUGDECL_END
													}
												}
											};
											bbOnDebugEnterScope((BBDebugScope *)&__scope);
											struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 681, 0};
											bbOnDebugEnterStm(&__stmt_0);
											((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBTime_SetFromString_TTDBTime_S(bbStringFromBytes(bmx_pgsql_PQgetvalue(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i),bbt_fieldLength)),(BBClass*)&database_core_dbtypes_TDBType));
											bbOnDebugLeaveScope();
										}else{
											struct BBDebugScope __scope = {
												BBDEBUGSCOPE_LOCALBLOCK,
												0,
												{
													{
														BBDEBUGDECL_END
													}
												}
											};
											bbOnDebugEnterScope((BBDebugScope *)&__scope);
											struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 682, 0};
											bbOnDebugEnterStm(&__stmt_0);
											if(bbt_3==7){
												BBBYTE* bbt_b=0;
												BBBYTE* bbt_c=0;
												struct BBDebugScope_2 __scope = {
													BBDEBUGSCOPE_LOCALBLOCK,
													0,
													{
														{
															BBDEBUGDECL_LOCAL,
															"b",
															"*b",
															.var_address=&bbt_b
														},
														{
															BBDEBUGDECL_LOCAL,
															"c",
															"*b",
															.var_address=&bbt_c
														},
														{
															BBDEBUGDECL_END
														}
													}
												};
												bbOnDebugEnterScope((BBDebugScope *)&__scope);
												struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 684, 0};
												bbOnDebugEnterStm(&__stmt_0);
												bbt_b=bmx_pgsql_PQgetvalue(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i);
												struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 686, 0};
												bbOnDebugEnterStm(&__stmt_1);
												bbt_c=bmx_pgsql_PQunescapeBytea(bbt_b,(&bbt_fieldLength));
												struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 687, 0};
												bbOnDebugEnterStm(&__stmt_2);
												((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBBlob_Set_TTDBBlob_pbii(bbt_c,bbt_fieldLength,1),(BBClass*)&database_core_dbtypes_TDBType));
												struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 689, 0};
												bbOnDebugEnterStm(&__stmt_3);
												bmx_pgsql_PQfreemem(bbt_c);
												bbOnDebugLeaveScope();
											}else{
												struct BBDebugScope __scope = {
													BBDEBUGSCOPE_LOCALBLOCK,
													0,
													{
														{
															BBDEBUGDECL_END
														}
													}
												};
												bbOnDebugEnterScope((BBDebugScope *)&__scope);
												struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 691, 0};
												bbOnDebugEnterStm(&__stmt_0);
												((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)]=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)(struct database_core_dbtypes_TDBString_obj*)bbObjectNew((BBClass *)&database_core_dbtypes_TDBString),(BBClass*)&database_core_dbtypes_TDBType));
												struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 692, 0};
												bbOnDebugEnterStm(&__stmt_1);
												struct database_core_dbtypes_TDBType_obj* bbt_8;
												(((struct database_core_dbtypes_TDBType_obj*)bbNullObjectTest((BBObject*)(bbt_8 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATAINDEX((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values ),(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_values )->dims,((BBUINT)bbt_i)))[((BBUINT)bbt_i)])))->clas)->m_setString_S((struct database_core_dbtypes_TDBType_obj*)bbt_8,database_core_sizedUTF8toISO8859(bmx_pgsql_PQgetvalue(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ,(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +1),bbt_i),bbt_fieldLength));
												bbOnDebugLeaveScope();
											}
											bbOnDebugLeaveScope();
										}
										bbOnDebugLeaveScope();
									}
									bbOnDebugLeaveScope();
								}
								bbOnDebugLeaveScope();
							}
							bbOnDebugLeaveScope();
						}
						bbOnDebugLeaveScope();
					}
					bbOnDebugLeaveScope();
				}
				bbOnDebugLeaveScope();
			}
			bbOnDebugLeaveScope();
		}
	}
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 700, 0};
	bbOnDebugEnterStm(&__stmt_3);
	((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index +=1;
	struct BBDebugStm __stmt_4 = {0xd2c85e7745290c31, 702, 0};
	bbOnDebugEnterStm(&__stmt_4);
	if(((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset_index >=(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__queryrows -1)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 703, 0};
		bbOnDebugEnterStm(&__stmt_0);
		((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
		((struct database_postgresql_TPostgreSQLResultSet_obj*)o)->clas->m_clearResultSet((struct database_postgresql_TPostgreSQLResultSet_obj*)o);
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_5 = {0xd2c85e7745290c31, 706, 0};
	bbOnDebugEnterStm(&__stmt_5);
	bbOnDebugLeaveScope();
	return 1;
}
BBLONG _database_postgresql_TPostgreSQLResultSet_lastInsertedId(struct database_postgresql_TPostgreSQLResultSet_obj* o){
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"lastInsertedId",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 710, 0};
	bbOnDebugEnterStm(&__stmt_0);
	if((((struct database_core_TQueryResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_core_tqueryresultset__isactive !=0) && (((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult )){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 711, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbOnDebugLeaveScope();
		bbOnDebugLeaveScope();
		return ((BBLONG)bmx_pgsql_PQoidValue(((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset_pgresult ));
	}
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 713, 0};
	bbOnDebugEnterStm(&__stmt_1);
	bbOnDebugLeaveScope();
	return -1LL;
}
BBINT _database_postgresql_TPostgreSQLResultSet_rowsAffected(struct database_postgresql_TPostgreSQLResultSet_obj* o){
	((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o));
	struct BBDebugScope_1 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"rowsAffected",
		{
			{
				BBDEBUGDECL_LOCAL,
				"Self",
				":TPostgreSQLResultSet",
				.var_address=&o
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 717, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbOnDebugLeaveScope();
	return ((struct database_postgresql_TPostgreSQLResultSet_obj*)bbNullObjectTest((BBObject*)o))->_database_postgresql_tpostgresqlresultset__rowsaffected ;
}
BBINT database_postgresql_TPostgreSQLResultSet_dbTypeFromNative_i_Sii(BBSTRING bbt_name,BBINT bbt__type,BBINT bbt__flags){
	BBINT bbt_dbType=0;
	struct BBDebugScope_4 __scope = {
		BBDEBUGSCOPE_FUNCTION,
		"dbTypeFromNative",
		{
			{
				BBDEBUGDECL_LOCAL,
				"name",
				"$",
				.var_address=&bbt_name
			},
			{
				BBDEBUGDECL_LOCAL,
				"_type",
				"i",
				.var_address=&bbt__type
			},
			{
				BBDEBUGDECL_LOCAL,
				"_flags",
				"i",
				.var_address=&bbt__flags
			},
			{
				BBDEBUGDECL_LOCAL,
				"dbType",
				"i",
				.var_address=&bbt_dbType
			},
			{
				BBDEBUGDECL_END
			}
		}
	};
	bbOnDebugEnterScope((BBDebugScope *)&__scope);
	struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 722, 0};
	bbOnDebugEnterStm(&__stmt_0);
	bbt_dbType=0;
	struct BBDebugStm __stmt_1 = {0xd2c85e7745290c31, 724, 0};
	bbOnDebugEnterStm(&__stmt_1);
	BBINT bbt_=bbt__type;
	struct BBDebugStm __stmt_2 = {0xd2c85e7745290c31, 725, 0};
	bbOnDebugEnterStm(&__stmt_2);
	if(((((((bbt_==16) || (bbt_==21)) || (bbt_==23)) || (bbt_==2278)) || (bbt_==24)) || (bbt_==28)) || (bbt_==29)){
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 726, 0};
		bbOnDebugEnterStm(&__stmt_0);
		bbt_dbType=2;
		bbOnDebugLeaveScope();
	}else{
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_LOCALBLOCK,
			0,
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 727, 0};
		bbOnDebugEnterStm(&__stmt_0);
		if(bbt_==20){
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 728, 0};
			bbOnDebugEnterStm(&__stmt_0);
			bbt_dbType=5;
			bbOnDebugLeaveScope();
		}else{
			struct BBDebugScope __scope = {
				BBDEBUGSCOPE_LOCALBLOCK,
				0,
				{
					{
						BBDEBUGDECL_END
					}
				}
			};
			bbOnDebugEnterScope((BBDebugScope *)&__scope);
			struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 729, 0};
			bbOnDebugEnterStm(&__stmt_0);
			if(bbt_==700){
				struct BBDebugScope __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 730, 0};
				bbOnDebugEnterStm(&__stmt_0);
				bbt_dbType=4;
				bbOnDebugLeaveScope();
			}else{
				struct BBDebugScope __scope = {
					BBDEBUGSCOPE_LOCALBLOCK,
					0,
					{
						{
							BBDEBUGDECL_END
						}
					}
				};
				bbOnDebugEnterScope((BBDebugScope *)&__scope);
				struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 731, 0};
				bbOnDebugEnterStm(&__stmt_0);
				if((bbt_==1700) || (bbt_==701)){
					struct BBDebugScope __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 732, 0};
					bbOnDebugEnterStm(&__stmt_0);
					bbt_dbType=3;
					bbOnDebugLeaveScope();
				}else{
					struct BBDebugScope __scope = {
						BBDEBUGSCOPE_LOCALBLOCK,
						0,
						{
							{
								BBDEBUGDECL_END
							}
						}
					};
					bbOnDebugEnterScope((BBDebugScope *)&__scope);
					struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 733, 0};
					bbOnDebugEnterStm(&__stmt_0);
					if(bbt_==1082){
						struct BBDebugScope __scope = {
							BBDEBUGSCOPE_LOCALBLOCK,
							0,
							{
								{
									BBDEBUGDECL_END
								}
							}
						};
						bbOnDebugEnterScope((BBDebugScope *)&__scope);
						struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 734, 0};
						bbOnDebugEnterStm(&__stmt_0);
						bbt_dbType=6;
						bbOnDebugLeaveScope();
					}else{
						struct BBDebugScope __scope = {
							BBDEBUGSCOPE_LOCALBLOCK,
							0,
							{
								{
									BBDEBUGDECL_END
								}
							}
						};
						bbOnDebugEnterScope((BBDebugScope *)&__scope);
						struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 735, 0};
						bbOnDebugEnterStm(&__stmt_0);
						if((bbt_==1083) || (bbt_==1266)){
							struct BBDebugScope __scope = {
								BBDEBUGSCOPE_LOCALBLOCK,
								0,
								{
									{
										BBDEBUGDECL_END
									}
								}
							};
							bbOnDebugEnterScope((BBDebugScope *)&__scope);
							struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 736, 0};
							bbOnDebugEnterStm(&__stmt_0);
							bbt_dbType=9;
							bbOnDebugLeaveScope();
						}else{
							struct BBDebugScope __scope = {
								BBDEBUGSCOPE_LOCALBLOCK,
								0,
								{
									{
										BBDEBUGDECL_END
									}
								}
							};
							bbOnDebugEnterScope((BBDebugScope *)&__scope);
							struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 737, 0};
							bbOnDebugEnterStm(&__stmt_0);
							if((((bbt_==1114) || (bbt_==1184)) || (bbt_==702)) || (bbt_==703)){
								struct BBDebugScope __scope = {
									BBDEBUGSCOPE_LOCALBLOCK,
									0,
									{
										{
											BBDEBUGDECL_END
										}
									}
								};
								bbOnDebugEnterScope((BBDebugScope *)&__scope);
								struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 738, 0};
								bbOnDebugEnterStm(&__stmt_0);
								bbt_dbType=8;
								bbOnDebugLeaveScope();
							}else{
								struct BBDebugScope __scope = {
									BBDEBUGSCOPE_LOCALBLOCK,
									0,
									{
										{
											BBDEBUGDECL_END
										}
									}
								};
								bbOnDebugEnterScope((BBDebugScope *)&__scope);
								struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 739, 0};
								bbOnDebugEnterStm(&__stmt_0);
								if(bbt_==17){
									struct BBDebugScope __scope = {
										BBDEBUGSCOPE_LOCALBLOCK,
										0,
										{
											{
												BBDEBUGDECL_END
											}
										}
									};
									bbOnDebugEnterScope((BBDebugScope *)&__scope);
									struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 740, 0};
									bbOnDebugEnterStm(&__stmt_0);
									bbt_dbType=7;
									bbOnDebugLeaveScope();
								}else{
									struct BBDebugScope __scope = {
										BBDEBUGSCOPE_LOCALBLOCK,
										0,
										{
											{
												BBDEBUGDECL_END
											}
										}
									};
									bbOnDebugEnterScope((BBDebugScope *)&__scope);
									struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 742, 0};
									bbOnDebugEnterStm(&__stmt_0);
									bbt_dbType=1;
									bbOnDebugLeaveScope();
								}
								bbOnDebugLeaveScope();
							}
							bbOnDebugLeaveScope();
						}
						bbOnDebugLeaveScope();
					}
					bbOnDebugLeaveScope();
				}
				bbOnDebugLeaveScope();
			}
			bbOnDebugLeaveScope();
		}
		bbOnDebugLeaveScope();
	}
	struct BBDebugStm __stmt_3 = {0xd2c85e7745290c31, 745, 0};
	bbOnDebugEnterStm(&__stmt_3);
	bbOnDebugLeaveScope();
	return bbt_dbType;
}
struct BBDebugScope_17 database_postgresql_TPostgreSQLResultSet_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TPostgreSQLResultSet",
	{
		{
			BBDEBUGDECL_FIELD,
			"pgResult",
			"*b",
			.field_offset=offsetof(struct database_postgresql_TPostgreSQLResultSet_obj,_database_postgresql_tpostgresqlresultset_pgresult)
		},
		{
			BBDEBUGDECL_FIELD,
			"_queryRows",
			"i",
			.field_offset=offsetof(struct database_postgresql_TPostgreSQLResultSet_obj,_database_postgresql_tpostgresqlresultset__queryrows)
		},
		{
			BBDEBUGDECL_FIELD,
			"_rowsAffected",
			"i",
			.field_offset=offsetof(struct database_postgresql_TPostgreSQLResultSet_obj,_database_postgresql_tpostgresqlresultset__rowsaffected)
		},
		{
			BBDEBUGDECL_FIELD,
			"_preparedStatementName",
			"$",
			.field_offset=offsetof(struct database_postgresql_TPostgreSQLResultSet_obj,_database_postgresql_tpostgresqlresultset__preparedstatementname)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_New
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"Create",
			"(:TDBConnection,$):TQueryResultSet",
			.func_ptr=(BBFuncPtr)&database_postgresql_TPostgreSQLResultSet_Create_TTQueryResultSet_TTDBConnectionS
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"clearResultSet",
			"()",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_clearResultSet
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"cleanup",
			"()",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_cleanup
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"executeQuery",
			"($)i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_executeQuery_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"initRecord",
			"(i)",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_initRecord_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"prepare",
			"($)i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_prepare_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"execute",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_execute
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"firstRow",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_firstRow
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"nextRow",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_nextRow
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"lastInsertedId",
			"()l",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_lastInsertedId
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"rowsAffected",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_postgresql_TPostgreSQLResultSet_rowsAffected
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"dbTypeFromNative",
			"($,i,i)i",
			.func_ptr=(BBFuncPtr)&database_postgresql_TPostgreSQLResultSet_dbTypeFromNative_i_Sii
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_postgresql_TPostgreSQLResultSet database_postgresql_TPostgreSQLResultSet={
	&database_core_TQueryResultSet,
	bbObjectFree,
	(BBDebugScope*)&database_postgresql_TPostgreSQLResultSet_scope,
	sizeof(struct database_postgresql_TPostgreSQLResultSet_obj),
	(void (*)(BBOBJECT))_database_postgresql_TPostgreSQLResultSet_New,
	(void (*)(BBOBJECT))_database_postgresql_TPostgreSQLResultSet_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_postgresql_TPostgreSQLResultSet_obj,_database_postgresql_tpostgresqlresultset__preparedstatementname) - offsetof(struct database_postgresql_TPostgreSQLResultSet_obj,_database_postgresql_tpostgresqlresultset_pgresult) + sizeof(BBSTRING)
	,0
	,offsetof(struct database_postgresql_TPostgreSQLResultSet_obj,_database_postgresql_tpostgresqlresultset_pgresult)
	,database_postgresql_TPostgreSQLResultSet_Create_TTQueryResultSet_TTDBConnectionS
	,_database_core_TQueryResultSet_Init_TTDBConnectionS
	,_database_core_TQueryResultSet_clearBindValues
	,_database_core_TQueryResultSet_clear
	,_database_postgresql_TPostgreSQLResultSet_executeQuery_S
	,_database_postgresql_TPostgreSQLResultSet_prepare_S
	,_database_postgresql_TPostgreSQLResultSet_execute
	,_database_postgresql_TPostgreSQLResultSet_firstRow
	,_database_postgresql_TPostgreSQLResultSet_nextRow
	,_database_postgresql_TPostgreSQLResultSet_lastInsertedId
	,_database_postgresql_TPostgreSQLResultSet_rowsAffected
	,database_postgresql_TPostgreSQLResultSet_dbTypeFromNative_i_Sii
	,_database_core_TQueryResultSet_rowRecord
	,_database_core_TQueryResultSet_dataValue_i
	,_database_core_TQueryResultSet_rowIndex
	,_database_core_TQueryResultSet_setRowIndex_i
	,_database_core_TQueryResultSet_isActive
	,_database_core_TQueryResultSet_isValid
	,_database_core_TQueryResultSet_resetValues_i
	,_database_core_TQueryResultSet_resetBindCount
	,_database_core_TQueryResultSet_addBindValue_TTDBType
	,_database_core_TQueryResultSet_bindValue_iTTDBType
	,_database_core_TQueryResultSet_reset
	,_database_core_TQueryResultSet_free
	,_database_postgresql_TPostgreSQLResultSet_clearResultSet
	,_database_postgresql_TPostgreSQLResultSet_cleanup
	,_database_postgresql_TPostgreSQLResultSet_initRecord_i
};

static int __bb_database_postgresql_postgresql_inited = 0;
int __bb_database_postgresql_postgresql(){
	if (!__bb_database_postgresql_postgresql_inited) {
		__bb_database_postgresql_postgresql_inited = 1;
		__bb_brl_blitz_blitz();
		__bb_database_core_core();
		_bb_database_postgresql_common();
		bbObjectRegisterType((BBCLASS)&database_postgresql_TPostgreSQLDatabaseLoader);
		bbObjectRegisterType((BBCLASS)&database_postgresql_TDBPostgreSQL);
		bbObjectRegisterType((BBCLASS)&database_postgresql_TPostgreSQLResultSet);
		bbRegisterSource(0xd2c85e7745290c31, "c:/BlitzmaxNG/mod/database.mod/postgresql.mod/postgresql.bmx");
		struct BBDebugScope __scope = {
			BBDEBUGSCOPE_FUNCTION,
			"postgresql",
			{
				{
					BBDEBUGDECL_END
				}
			}
		};
		bbOnDebugEnterScope((BBDebugScope *)&__scope);
		struct BBDebugStm __stmt_0 = {0xd2c85e7745290c31, 768, 0};
		bbOnDebugEnterStm(&__stmt_0);
		database_core_AddDatabaseLoader((struct database_core_TDatabaseLoader_obj*)((struct database_core_TDatabaseLoader_obj*)bbObjectDowncast((BBOBJECT)(struct database_postgresql_TPostgreSQLDatabaseLoader_obj*)bbObjectNew((BBClass *)&database_postgresql_TPostgreSQLDatabaseLoader),(BBClass*)&database_core_TDatabaseLoader)));
		bbOnDebugLeaveScope();
		return 0;
	}
	return 0;
}