You did 5 inserts and got 5 records.  You need to do either just ONE insert or 
ONE insert and FOUR updates.

I'd got for the one insert.



query = "insert into ONTTable (slotId,ponChannelId,onuType,onuId,adminStatus) 
values (?1,?2,?3,?4,?5);";
then bind each parameter.....



Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems

________________________________
From: [email protected] [[email protected]] on 
behalf of bhaskarReddy [[email protected]]
Sent: Monday, January 16, 2012 7:10 AM
To: [email protected]
Subject: EXT :[sqlite] All values of a fields are not stored in the single 
record.


Hi friends,

         While i am writing data into the table the values are not storing
in a single records, instead the values are storing in improper order.

          I am adding the values to the table as,

query = "insert into ONTTable (slotId) values (?1);";
sqlite3_prepare_v2(db,query,strlen(query)+1, &stmt, NULL);
sqlite3_bind_int(stmt,1,ontTable -> slotId);
sqlite3_step(stmt,DONE);

query = "insert into ONTTable (ponChannelId) values (?);";
sqlite3_prepare_v2(db,query,strlen(query)+1, &stmt, NULL);
sqlite3_bind_int(stmt,1,ontTable -> ponChannelId);
sqlite3_step(stmt,DONE);


query = "insert into ONTTable (onuType) values (?);";
sqlite_prepare_v2(db,query,strlen(query)+1, &stmt, NULL);
sqlite3_bind_int(stmt,1,ontTable -> ontType);
sqlite3_step(stmt,DONE);

query = "insert into ONTTable (onuId) values (?);";
sqlite3_prepare_v2(db,query,strlen(query)+1, &stmt, NULL);
sqlite3_bind_int(stmt,1,ontTable -> onuId);
sqlite3_step(stmt,DONE);

query = "insert into ONTTable (adminStatus) values (?);";
sqlite3_bind_prepare_v2(db,query,strlen(query)+1, &stmt, NULL);
sqlite3_bind_int(stmt,1,ontTable -> adminStatus);


slotId           ponChannelId         onuType           onuId
adminStatus

1

                        2


                                                   3

                                                                         4


5






 Can any one tell me how i can get all values at one record.


Regards
Bhaskar Reddy

--
View this message in context: 
http://old.nabble.com/All-values-of-a-fields-are-not-stored-in-the-single-record.-tp33147362p33147362.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to