MySQL Forums
Forum List  »  Newbie

control order of insertion
Posted by: Matthieu Mosch
Date: May 07, 2008 05:24AM

hi,

this my first post on the forum, so please be gentle ;)

i have a problem with inserting data into a mysql database
i am using a suse linux distribution and mysql server 5.0.19-standard

i insert some data into a database (created by a former colleague)
i do this from the command prompt with the following commands :
mysql my_database < my_file1.sql
mysql my_database < my_file2.sql

the files contain the following lines :
my_file1.sql :

LOCK TABLES MY_TABLE WRITE;
INSERT INTO MY_TABLE VALUES (11,'abc');
UNLOCK TABLES;

my_file2.sql :

LOCK TABLES MY_TABLE WRITE;
INSERT INTO MY_TABLE VALUES (12,'def');
UNLOCK TABLES;

when i first insert my_file1.sql and then my_file2.sql from the command prompt and then check the content of the table inside mysql with :

select * from MY_TABLE;

then i see 'def' before 'abc' ... how can i make sure that 'abc' is show before 'def' on the select ?

i prefer not to change the select statement as its used in many parts of code created by a former colleague .. it would be best if i could make sure the data would be in the correct order in the database itself

could anyone give me a tip ? ;)

Options: ReplyQuote


Subject
Written By
Posted
control order of insertion
May 07, 2008 05:24AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.