Michael Kerry (mkerry@Glue.umd.edu) wrote:
: Hello,
:
: I have a question relating to isqlperl v1.2, running on a SPARC10 (SunOS4.1.3).
: Frankly, I'm not sure whether this is a perl question or an Informix
: question, as I'm fairly new to both.
:
: What I am trying to do is insert data from an array (obtained by slurping
: lines of a text file using <> ) into a text blob (a column of
: type TEXT). I gather that to do this in ESQL/C one uses the loc_t
: type...How does one do this in isqlperl?
:
: I, naively, tried something like the following:
:
: # Reading the data into the array @ary
: #
:
: $count = 0;
: open(FILE, "datafile") || die "Can't open file! $!\\n";
: while(<FILE>) {
: $ary[$count++] = $_;
: }
:
: # prepare cursor to insert @ary into 'mydata' table
: #
:
: $table = 'mydata';
: $insert = &isql_open(<<EOI) || die $isql_code;
: insert into $table(inv_data) values(?)
: EOI
:
: # insert it
: #
:
: &isql_execute($insert, (@ary)) || die $isql_code;
:
:
: That last line is bad, giving the error
: "-1213 Character to numeric conversion error"
The problem could be that you've tried to insert an ascii value
into a numeric column.
Check your table-structure.
--christian jachmann