| Reply | « Previous Thread | Next Thread » |
|
Hi all,
Can someone give me a soln on how to set primary key and how to create a foreign key in e32db.. I learn't that COUNTER will act as a primary key in e32db.. I tried it but the counter value is 0 for all my record.. Is there anyother way to set primary key.. Also say me how to set a foreign key in e32db.. |
|
I am using like this:
Code:
self.db.execute(u"CREATE TABLE RelatedWLan (Id COUNTER, I_Id SMALLINT, WLan_Id SMALLINT)") Code:
self.SQLdb.query(u"INSERT INTO RelatedWLan (I_Id, WLan_Id) VALUES (" + str(id) + "," + str(result[0][0]) + ")")
hope this helps. mac |
|
malun123 thanks for ur reply but I didn't understand ur INSERT statement.. How does I_Id became the foreign key.. So, Can it be used in any other table? Can someone pls explain on that code..
Code:
db.execute(u"CREATE TABLE Details_table(Id COUNTER, Name CHAR(20)") db.execute(u"CREATE TABLE Settings_table(Id, Settings CHAR(20)") Python experts I am waiting for ur replies....... |
|
My example is the manual job. I am using I_Id as a FK in my project.
I am not into SQL that much, but if you are thinking about having something like 'joins', then I am afraid that Pys60 does not support that. mac |
|
Quote:
Is anybody else there who can give few more examples or can help me in creating foreign and primary keys in e32db.... Pls guys I need help....... Do reply to my post as soon as possible..... Thanks in advance.... |
|
this is how you should get a primary key:
Quote:
|
|
Thanks zarzu.. I am now clear on primary keys..
So if I want to access any value from one table to another table, is it not at all possible in e32db? My database design requires this aspect strictly.. What am i to do if I want to use one table values in another table.. Should i quit e32db and choose something else.. Pls clear my doubts.. |
|
Hello python experts... I am waiting for ur replies for my previous post... Do help in getting soln to my problem..
Can I access values from one table to another using e32db... I need this aspect in my db.. What should I do to get this done.. Plssssssss do reply as soon as possible.... Thanks in advance... |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Database:primary key-foreign key relation | remyag | General Symbian C++ | 4 | 2008-07-16 11:27 |