Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy data from a textfile into a Sybase table 1

Status
Not open for further replies.

Lutfal

Programmer
Nov 4, 2001
14
IN
Hi all,
Can any one help me to copy data from a text file to a sybase table without using the command line utility. I will run the statement using ADO connection via ASP.

I can do it easily in MySQL using "LOADDATA from infile.."

I think BCP utility can be used but from command line DOS prompt only (I am not sure ). The syabse server(system 11) OS is WIN2K and I am connecting via odbc for an internet application.

Any help ?
 
Hiya,

There are a number of ways that you can add data into a Sybase table from a file, but none of them can be done directly as Sybase commands.

You can use a query languange, such as SQR, which will take the flat file and construct Sybase INSERT statements, adding the data via ODBC links. Alternatively, you could put the data into MS Access, then link the tables via an ODBC link and upload the information that way.

However, BCP is really the Sybase tool designed to handle this process, and it should do what you require quite happily.

Tim
 
Hi tim,
Thanks. In fact I inserted data using simple insert into command by reading the file using filesystem object in ASP. But the performance is uncredibly low. So I wanted a direct method to read data from a text file (as bcp) but can run just like other SQL command through ODBC connection. Theidea of keeping the MDB is very good . But I am facing charset conversion problem as the content contains non english language keystrokes which creates problem in the insertion in the sybase table. surprising ly those keystrokes are automatically converted when inserting through ISQL utility. But I need to insert through ADO (via web) only

Any help ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top