Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Access to S_* Structure of TABLE crash Application.
Re: PROPOSAL: Access to S_* Structure of TABLE crash Application. [message #36304 is a reply to message #36302] Fri, 18 May 2012 23:31 Go to previous messageGo to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
sergeynikitin wrote on Fri, 18 May 2012 22:42

Another example:
SQL * Select(WORKER(NAME, LASTNAME), PLANT(NAME).As(PLANT_NAME), PLANT(ADDRESS)).From(WORKER).LeftJoin(PLANT).On(WORKER(PLANT_ID) == PLANT(ID));


This expression generates the SQL statement:
select WORKER.NAME, WORKER.LASTNAME, PLANT.NAME PLANT_NAME, PLANT.ADDRESS from WORKER left outer join PLANT on WORKER.PLANT_ID = PLANT.ID

Attention to PLANT.NAME and PLANT_NAME!!!


Yes. But, as I said about sqlite3_column_name function, it returns exactly:
NAME
LASTNAME
PLANT_NAME
ADDRESS

If it returns following columns:
WORKER.NAME
WORKER.LASTNAME
PLANT_NAME
PLANT.ADDRESS

It will be possible to access it with:
while (SQL.Fetch()) {
	DUMP(SQL["WORKER.NAME"]); DUMP(SQL["WORKER.LASTNAME"]);
	DUMP(SQL["PLANT_NAME"]); DUMP(SQL["PLANT.ADDRESS"]);
}

But it is not.

In case of:
SQL * Select(WORKER(NAME, LASTNAME), PLANT(NAME, ADDRESS)).From(WORKER).LeftJoin(PLANT).On(WORKER(PLANT_ID) == PLANT(ID));

while (SQL.Fetch()) {
	DUMP(SQL["NAME"]); DUMP(SQL["LASTNAME"]);
	DUMP(SQL[2]); DUMP(SQL["ADDRESS"]);
}

It returns following columns:
NAME
LASTNAME
NAME
ADDRESS

Therefore, it is not possible to access second "NAME" column through simple search algorithm.

[Updated on: Fri, 18 May 2012 23:32]

Report message to a moderator

 
Read Message icon3.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon3.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Sql .sch / Date (moved)
Next Topic: SqlBinary and Postgres 9
Goto Forum:
  


Current Time: Mon Aug 25 19:06:38 CEST 2025

Total time taken to generate the page: 0.00832 seconds