Emnric
Joined: 08 May 2009 Posts: 4
|
Posted: Fri May 08, 2009 23:14 Post subject: Retreiving an object and other informations with one query |
|
|
Hi, i have the follwing MySQL table:
Code: | CREATE TABLE kids (" +
"mother_id INT UNSIGNED NOT NULL," +
"father_id INT UNSIGNED," +
"name VARCHAR(64) NOT NULL," +
"location VARCHAR(60)," +
"in_party TINYINT," +
"object BLOB," +
"creation_date DATETIME," +
"FOREIGN KEY(mother_id) REFERENCES pcs(pc_id) ON DELETE CASCADE," +
"FOREIGN KEY(father_id) REFERENCES pcs(pc_id) ON DELETE SET NULL," +
"UNIQUE (mother_id, name)" +
")ENGINE=innodb; |
and i would like to do this query:
Code: |
string sSQL = "SELECT in_party,object,location FROM kids WHERE mother_id="
+ IntToString(nMotherId); |
Is it possible... with nwnx_odbc 2 on linux? |
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Sat May 09, 2009 0:28 Post subject: |
|
|
No, not in nwnx_odbc [as is stands]
The 'object' has to be retrieved in it's own select statement.
which means you need to select from kids (get a list of all the kids --PrimaryKey references)
Then select the objects by selecting each via the list from the prior select.
If someone wants to 'convert it',
the functionality (blobs anywhere in result-set) does exist in the nwnx_sqlserver plugin (nwnx2).
Cheers
Gryphyn |
|