Malc P wrote:
> Weird one here; this is a test case because some 4gl's we have are
> behaving oddly in R4GL and IDB but *not* in i4GL.
>
> In I4gl we get the tabname followed by a '1' or a '2' back as
> expected, but in R4GL/IDB we get a -1214 NUMBER EXCEEDS LIMIT OF
> SMALLINT PRECISION error and the number is - well see for yourselves:
>
> flags_text 28514
> logmessage 25969
> smi_build_status 29184
> sysadtinfo 29539
> sysaggregates 3443
> sysams 3699
> sysattrtypes 24418
> sysaudit 29292
> sysblobs 29539
> sysbtcreq 29561
> sysbufhdr 29539
> syscasts 1
> syscdrack_buf 24436
> syscdrack_txn 1
> syscdrctrl_buf 0
> syscdrctrl_txn 0
> syscdrprog 0
>
> Any clues? For one reason or another we can't talk to tech support
> about this ....
>
> Test 4GL follows:
>
> database sysmaster
> main
> define lv_tabname like systables.tabname
> define lv_dummy smallint
> define lv_sql char(500)
>
> whenever error continue
>
> let lv_sql = "select trim(tabname), 1 ",
> " from systables ",
> " where tabtype = 'T' ",
> " union ",
> " select (tabname), 2 ",
> " from systables ",
> " where tabtype = 'V'",
> " order by 2,1 "
>
> prepare pr_tabs from lv_sql
> declare cr_tabs cursor for pr_tabs
>
> foreach cr_tabs into lv_tabname, lv_dummy
> display lv_tabname, lv_dummy
> end foreach
It sound like R4GL/IDB are returning an INT instead of a SMALLINT. Have
you tried defining lv_dummy as an INT?
I don't think you mentioned the version of the DB server, but if it's
9.x, then you could cast the "1" to a SMALLINT... I guess.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /|
| Mydas Solutions Ltd http://MydasSolutions.com |///// / //|
| +-----------------------------------+//// / ///|
| |We value your comments, which have |/// / ////|
| |been recorded and automatically |// / /////|
| |emailed back to us for our records.|/ ////////|
+----------------------+-----------------------------------+-----------+
sending to informix-list