The script I've made mention of is an SQL Script, here it is:
rem finished_goods.sql set feedback off set heading off set echo off set pagesize 0 set linesize 510 spool invent_sap1.unl SELECT b.article_id || ' ' || 'CWL' || ' ' || b.mill_id || ' ' || b.track_num || ' ' || stat || ' ' || class || ' ' || TRIM(' ' FROM TO_CHAR(SUM(A.wgt_est), '999999990.9')) || ' ' || TRIM(' ' FROM TO_CHAR(SUM(sheet_count), '999999990.9')) FROM invent a, (SELECT unit_id, article_id, track_num, mill_id FROM invent WHERE (class = 'U' OR class = 'W' OR(class = 'T' AND class_orig IN('U', 'W')) OR (class = 'L' AND class_orig IN('U', 'W'))) AND stat IN('G','J','T') AND ts_scaled > 0 AND unit_id=roll_id_lead) b WHERE a.roll_id_lead=b.unit_id AND (a.type_code = 'S' OR a.type_code = 'C') GROUP BY b.article_id, 'CWL', b.mill_id, b.track_num, stat, class UNION SELECT b.article_id || ' ' || 'CWL' || ' ' || b.mill_id || ' ' || b.track_num || ' ' || stat || ' ' || class || ' ' || TRIM(' ' FROM TO_CHAR(SUM(A.wgt_scaled), '999999990.9')) || ' ' || TRIM(' ' FROM TO_CHAR(SUM(sheet_count), '999999990.9')) FROM invent a, (SELECT unit_id, article_id, track_num, mill_id FROM invent WHERE (class = 'U' OR class = 'W' OR (class = 'T' AND class_orig IN('U', 'W')) OR (class = 'L' AND class_orig IN('U', 'W'))) AND stat IN('G','J','T') AND ts_scaled > 0 AND unit_id=roll_id_lead) b WHERE a.roll_id_lead=b.unit_id AND a.type_code='R' GROUP BY b.article_id, 'CWL', b.mill_id, b.track_num, stat, class; spool OFF set feedback on set heading on set echo on set pagesize 1000 set linesize 100
When I said I think I have the FTP part, I should have said I've found a code snippet that I should be able to use. My starting point is figuring out how to call that SQL script. Thanks.

In reply to Re: (2) Waiting for an SQL script to finish by LeeC79
in thread Waiting for an SQL script to finish by LeeC79

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.