|
|
sybperl-l Archive
Up Prev Next
From: jrisley at nex-web4 dot corp dot fedex dot com (Jason Risley)
Subject: Insert message...
Date: Dec 17 1998 8:39PM
Can anybody explain to me why I'm getting the error message (below)? I have
11 columns I wish to insert data in and there are 11 values yet I still get
the error message.
Any help is appreciated!!!!!!
Jason
******************
ERROR MESSAGE
******************
Server message:
Message number: 109, Severity 15, State 1, Line 1
Message String: There are more columns in the INSERT statement than values
speci
fied in the VALUES clause. The number of values in the VALUES clause must
match
the number of columns specified in the INSERT statement.
******************
CODE:
******************
open (DATABASE, "$ftp_path\\$file_repo");
$dbh=Sybase::CTlib->ct_connect($uid, $pwd, $srv);
$repo_cnt = 0;
while ()
{
$repo_cnt++;
($repo_key, $quantitiy, $item_number, $item_description, $api_id,
$date_ship, $order_number, $order_status_date, $serial_number, $entry_id,
$repair_location, $order_status) = split (/\|/,$_);
$dbh->ct_execute("insert inbound_parts ( quantity, item_number,
item_description, api_id, order_number, order_date, serial_number, entry_id,
repair_location, order_status, last_updated ) VALUES ( $quantity,
'$item_number', '$item_description', '$api_id', '$order_number',
'$order_status_date', '$serial_number', '$entry_id', '$repair_location',
'$order_status', getdate() )");
while ( $dbh->ct_results($result) == CS_SUCCEED) {
if ( $dbh->ct_fetchable($result) ) {
while (@dat = $dbh->ct_fetch) {
} # End of ct_fetchable
}
else {
}
} # End of ct_results
} # End of while ()
close (DATABASE);
******************
TABLE INFO:
******************
Column_name Type Length Prec Scale Nulls
Default_name Rule_name Identity
----------- ---- ----------- ----------- ----------- -----------
------------ --------- -----------
id numeric 4 5 0 0 NULL
NULL 1
quantity int 4 NULL NULL 0 NULL
NULL 0
item_number char 6 NULL NULL 0 NULL
NULL 0
item_description varchar 25 NULL NULL 0 NULL
NULL 0
api_id char 5 NULL NULL 0 NULL
NULL 0
order_number char 15 NULL NULL 0 NULL
NULL 0
order_date varchar 10 NULL NULL 0 NULL
NULL 0
serial_number char 10 NULL NULL 0 NULL
NULL 0
entry_id char 10 NULL NULL 0 NULL
NULL 0
repair_location char 15 NULL NULL 0 NULL
NULL 0
order_status char 1 NULL NULL 0 NULL
NULL 0
last_updated datetime 8 NULL NULL 0 NULL
NULL 0
|