[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?



Hi,

  In the snips, I observed one typo. Could it be the reason?
  In select statement,
            where invoicenum = &invoicenum
  In error_proc,
            display 'Invoice = ' noline
            display &_invoicnum
  Are &invoicenum and &_invoicenum same?

-Raju




>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
>


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com