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



     Try using an alias on your second select:

          from {schema}invoicecost XX
          where XX.invoicenum = &invoicenum




______________________________ Reply Separator _________________________________
Subject: SQL Error - Data Type Has Changed?
Author:  Non-HP-c-duncan-hudson (c_duncan_hudson@YAHOO.COM) at
HP-PaloAlto,mimegw9
Date:    7/22/98 6:01 AM


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