Part of the problem with code like this (for me) is the tangle of database statements and perl code. Database coding can be strange because the syntax often depends on the database you're connecting to. What might work with Sybase might not work with MS SQL Server. I'm not familiar with Sybase. It looks like your basic DBI calls are correct--except it appears that you're opening both a SQL connection and a Sybase connection. Why two? Do you mean to do that?
Can Sybase manage stored procedures? I've sometimes found it helpful to put complicated data calls into stored procedures and then just run the procedure from the perl script. MS-SQL would look something like:
$sql = "{call procedure_name( '$any-input-values')}";
#call the procedure
$db->Sql($sql);
The rest of it seems conceptually workable, but I'm not experienced enough to advise you there. Just a minor point, you never close your OUTFILE. I always thought it was good practice to do so.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.