logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Retreiving an object and other informations with one query

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
Emnric



Joined: 08 May 2009
Posts: 4

PostPosted: Fri May 08, 2009 23:14    Post subject: Retreiving an object and other informations with one query Reply with quote

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?
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sat May 09, 2009 0:28    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Emnric



Joined: 08 May 2009
Posts: 4

PostPosted: Sat May 09, 2009 16:30    Post subject: Reply with quote

It would be nice if it could be done.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group