in reply to Re: Re: Perl scripts to do extraction into Sybase
in thread Perl scripts to do extraction into Sybase

2 issues for you, best tackled one at a time. I've had to learn to do them both over the last little while, and barely suffered at all :)

  1. Reading flat files. This is a v. basic example which reads the file line at a time and prints the results. You could modify this approach to send to Sybase instead:
    #!/usr/local/bin/perl -w if (open(MYFILE, "path/to/file")) { $line = <MYFILE>; while ($line ne "") { print ($line); $line = <MYFILE>; } }
  2. Talking to a Sybase database. You'll need to come to grips with DBI/DBD. I doubt you will find it too difficult. It is pretty much a case of connecting to the database, executing an SQL command, then retrieving the results. The Tricks with DBI tutorial by btrott should head you off in the right direction.

    Have a look at davorg's reply below as well :)

*~-}o{-~*