OK I am having problems with my ODBC call truncating Long fields that are 4000+ characters long and has \n's and/or \r's in the field. Here is my code:
#!c:\perl\bin use DBI; $user = "user"; $password = "password"; my $dbh = DBI->connect("dbi:ODBC:Remedy", $user, $password) or die "Ca +n't connect to Remedy: $DBI::errstr"; my $sth = $dbh->prepare( q{SELECT ISSUE_NUMBER, SUBMISSION_DATE, ASSIG +NED_TO, ISSUE_PRIORITY, STATUS, FULL_DESCRIPTION, ISSUE_DUE_DATE, ISS +UE_CLOSE_DATE, RESOLUTION_PROCESS_NOTES, ORIGINATOR FROM "BMS:ITS Iss +ue Creation"}) or die "Can't prepare statement: $DBI::errstr"; my $rc = $sth->execute or die "Can't execute statement: $DBI::errstr"; print "Query will return $sth->{NUM_OF_FIELDS} fields.\n\n"; print "Field names: @{ $sth->{NAME} }\n"; open (FILE, ">test.txt"); while (($issue_num, $sub_date, $assigned_to, $issue_priority, $status, + $full_desc, $issue_due_date, $issue_close_date, $res_notes, $origina +tor) = $sth->fetchrow_array) { print FILE "$issue_num\n"; print FILE "$sub_date\n"; print FILE "$assigned_to\n"; print FILE "$issue_priority\n"; print FILE "$status\n"; print FILE "$full_desc\n"; print FILE "$issue_due_date\n"; print FILE "$issue_close_date\n"; print FILE "$res_notes\n"; print FILE "$originator\n"; print FILE "------------------------------------------------\n\n"; } close (FILE); # check for problems which may have terminated the fetch early die $sth->errstr if $sth->err; $dbh->disconnect; exit;

Now for DB Info:

ISSUE_NUMBER - VARCHAR2(15)
SUBMISSION_DATE - NUMBER(15)
ASSIGNED_TO - VARCHAR2(30)
ISSUE_PRIORITY - VARCHAR2(20)
STATUS - VARCHAR2(20)
FULL_DESCRIPTION - VARCHAR2(4000)
ISSUE_DUE_DATE - NUMBER(15)
ISSUE_CLOSE_DATE - NUMBER(15)
RESOLUTION_PROCESS_NOTES - CLOB
ORIGINATOR - VARCHAR2(30)
Any suggestions??

-----------------------
Billy S.
Slinar Hardtail - Hand of Dane
Datal Ephialtes - Guildless
RallosZek.Net Admin/WebMaster

perl -e '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat! +\n"; } else { print "Thats a dog\n"; } print "\n";'

In reply to DBI/ODBC Truncating Long Fields by LostS

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.