[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

[sqr-users] Loading fixed length flat file into Sybase table



 Hi,

What is the better way to load the data from fixed length flat file into a
sybase database table using SQR. Number of rows in the file vary from 10,000
to 50,000

I'm doing something like the code below, but my concern is for each insert
statement it goes to the database and could be performance issue.
**************************************************************************************************************************
open 'aaaa.txt' AS 100 for-reading record=600:fixed status=#z

while 1

read 10 into $name:40 $Id:30 $location:50

if #end-file

break

end-if

begin-sql

insert into cust (name, Id, location)

values ($name, $ID, $location)

end-sql

add 1 to #inserts

if #inserts >= 100

begin-sql

commit transaction

begin transaction

end-sql

move 0 to #inserts

end-if
end-while
************************************************************************************************************
Thanks!!
Maddy

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users