Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: error: invalid numer
Jerry Preston wrote:
> Hi!
>
> I am using perl to access oracle 8.1.7. I get the error: invalid number
> with the following code.
>
> my $sql="insert into EE_SPARES_SHOP ( STATUS, SITE, CUSTOMER_CONTACT,
> CUSTOMER_E_MAIL,
> TTC_REPRESENTITIVE,
> SYSTEM_TYPE, SYSTEM_NAME, TEST_HEAD,
> SYSTEM_SERIAL_NUMBER,
> PART_NUMBER, PART_TYPE, PART_DESCRIPTION,
> BOARD_SERIAL_NUMBER, QTY,
> FAILURE, TUI_REV, CAL_DIAGS_REV,
> DIAG_THAT_FAILED,
> RESULTS_FILE, RMA_NUMBER, WEB, FAIL_DATE
> )
> values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?, ?, to_date( '$Fail_date', 'MM/DD/YY' ) )";
> my $sth = $t_dbh->prepare( $sql );
> die $t_dbh->errstr if $t_dbh->err;
>
> print "\n$Schema, $Status, $Site, $Customer_Contact, $Customer_e_mail,
> $TTC_Representitive, $System_Type,
> $System_Name, $test_head, $System_Serial_Number,
> $Part_Number, $Part_Type, $Part_Description,
> $Board_Serial_Number, $Qty, $Failure, $TUI_Rev,
> $Cal_Diags_Rev, $Diag_that_Failed, $Results_File,
> $RMA_NUMBER*" if $DEBUG;
>
> $sth->execute( $Status, $Site, $Customer_Contact, $Customer_e_mail,
> $TTC_Representitive, $System_Type,
> $System_Name, $test_head, $System_Serial_Number,
> $Part_Number, $Part_Type, $Part_Description,
> $Board_Serial_Number, $Qty, $Failure, $TUI_Rev,
> $Cal_Diags_Rev, $Diag_that_Failed, $Results_File,
> $RMA_NUMBER, $YES,
> ) || die "Cannot execute save_rma_request_data insert
> Statement!!<br>$DBI::errstr";
>
> I am not sure why. I have 21 blind inputs and one not. I get my error on
> the execute. If I add FAIL_DATE, I get that I do not have 22 blind vars.
>
> Any ideas?
>
> Thanks,
>
> Jerry
>
Do any of the "strings" that you're inserting have spaces? That would
have the effect of shifting all the subsequent bind variables to the
right one. Put single quotes around all your string variables in the
execute statement - for example, $sth->execute( '$Status',...
What do you see with your 'print' statement? Received on Wed Jan 15 2003 - 18:34:34 CST