[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: SQL Error - Data Type Has Changed?



I'll take a shot at it...

When SQR converts the SQL it would look something like this:
Select gldebitacct, glcreditacct, to_char(trunc(linecost * 100)),
linecost, percentage,
from {schema}invoicecost where invoicenum = ?

It seems like ODBC is complaining that the value being inserted into the
question mark is changing data types (probably from numeric to
character).  I would examine the &invoicenum to see if maybe there is a
space or some other non-display character imbeded in the field.  Good
luck!

>-----Original Message-----
>From:  C. Duncan Hudson [SMTP:c_duncan_hudson@YAHOO.COM]
>Sent:  Wednesday, July 22, 1998 6:02 AM
>To:    Multiple recipients of list SQR-USERS
>Subject:       SQL Error - Data Type Has Changed?
>
>Hi,
>
>
>I need help.  I've written a program, using SQR 4, that reads two
>Oracle tables and builds a flat file.  I begin by selecting records
>from one table, and then use the returned values (&invoicenum) to
>query the second table.  My second query (below) is returning an error
>about midway through the program (an error listing follows the code),
>after having successfully executed several times.  I've taken the
>offending SQL statement (with the variables that erred) and pasted it
>into SQL Plus and the query works fine.  I'm at a loss as to what's
>causing the error.  Can anyone give me a hand?  Thanks in advance,
>
>
>Dunc.
>
>...................................................
>
>{snip}
>
>begin-select on-error=error_proc(4.1)
>gldebitacct                       &debitacct
>glcreditacct                      &creditacct
>to_char(trunc(linecost * 100))    &linecost
>linecost                          &cost
>percentage                        &percentage
>    let #total_allocated = #total_allocated + &cost
>    do build_distribution
>from {schema}invoicecost
>where invoicenum = &invoicenum
>end-select
>
>{snip}
>
>begin-procedure error_proc (#source)
>evaluate #source
>when < 5 ! Invoice Select
>let #_return-status = 67
>display 'Invoice = ' noline                        display &_invoicnum
>display 'Status = ' noline
>display #source
>display 'Error selecting invoices'
>display 'SQL-Status = ' noline
>display #_sql-status
>display 'SQL-Error = ' noline
>display $_sql-error
>stop quiet
>break
>
>{snip}
>
>.........................................
>
>Invoice = 1011
>Status = 4.100000
>Error selecting invoices
>SQL-Status = 0.000000
>SQL-Error = [INTERSOLV][ODBC Oracle driver]Data type for parameter 1
>has changed since first SQLExecute call.
>
>
>_________________________________________________________
>DO YOU YAHOO!?
>Get your free @yahoo.com address at http://mail.yahoo.com