Problem with aggregate functions in sql
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi,
I have a problem in a 4gl program compiled with v4.13 running on a
SE 7.1 DB. When I do queries such as:
select count(*) into f_count_translog
from translog
where doc_num = "2019909"
and doc_typ = 'QUO'
and tr_status = "WS4"
-OR-
select max(translog.date) into f_current.trans_date
from translog
where doc_num = f_quote_h.quote_num
and doc_typ = 'QUO'
and tr_status = F_Quote_h.Quote_Status
I get the following error:
FORMS statement error number -1213.
Character to numeric conversion error
But the same queries run directly in isql work fine.
I tried tu use a cursor instead of directly running
the sql in the code, but I get the same message on
the "open" statement.
Could this be related to the use of the old 4.10 compiler
and SE 7.10 database ?
Thanks,
Chris
Get Your Private, Free Email at http://www.hotmail.com
In the first select either f_count_translog is type char or one of the three
fields you're matching on is of a different type than the one in quotes.
Christian Allaire <c_allaire@hotmail.com> wrote in message
news:7crn0c$74i$1@news.xmission.com...
>
> Hi,
>
> I have a problem in a 4gl program compiled with v4.13 running on a
> SE 7.1 DB. When I do queries such as:
>
> select count(*) into f_count_translog
> from translog
> where doc_num = "2019909"
> and doc_typ = 'QUO'
> and tr_status = "WS4">
> -OR-
>
> select max(translog.date) into f_current.trans_date
> from translog
> where doc_num = f_quote_h.quote_num
> and doc_typ = 'QUO'
> and tr_status = F_Quote_h.Quote_Status
>
> I get the following error:
>
> FORMS statement error number -1213.
> Character to numeric conversion error
>
> But the same queries run directly in isql work fine.
>
> I tried tu use a cursor instead of directly running
> the sql in the code, but I get the same message on
> the "open" statement.
>
> Could this be related to the use of the old 4.10 compiler
> and SE 7.10 database ?
>
> Thanks,
>
> Chris
> Get Your Private, Free Email at http://www.hotmail.com