Whats your opinion?

i have a text file with data that goes to two tables the first two lines goes to one then i have a few rows which goes to another then a statement end to signal the end of the transaction.

although this can be done using java i was wondering if anyone had any ideas if this can be done using sql statements.

[320 byte] By [southamptona] at [2007-11-27 2:26:52]
# 1
Using SQL, no. SQL doesn't do any kind of file processing. Your database may provide a procedural langage that would allow you do do something like this.
bckrispia at 2007-7-12 2:36:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Consider CSV or XML. CSV parsers are easy to write yourself. XML parsers are available in many tastes from Sun and other parties.
BalusCa at 2007-7-12 2:36:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
If it was me depending on the file format one of the following.1. Use the database tools to import the file directly.2. Write a converter (perhaps in java) to convert it into a format that you could use in 1.
jschella at 2007-7-12 2:36:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
I would add, if the main reason of using txtfiles is that you can't or don't want to install a database, then consider using MS Access MDB files. You can access them by a JDBC-ODBC bridge.Anyway, if it was me, I should install a real RDBMS anyhow and make use of it ;)
BalusCa at 2007-7-12 2:36:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
> I would add, if the main reason of using txtfiles is> that you can't or don't want to install a database,I didn't consider that interpretation.In windows there is a odbc text file driver (direct to a text file) but it is very, very limited.
jschella at 2007-7-12 2:36:51 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...