[Info-ingres] OME and 11.2

Martin Bowes martin.bowes at ndph.ox.ac.uk
Fri Jul 30 11:20:00 UTC 2021


Me again,

For comparison on an 11.1 installation this is what the error testing shows:
select hex2int('asdf')
Executing . . .

E_OME001 hex2int(): Non hex character 's' found in string.
    (Fri Jul 30 12:18:26 2021)

continue
* * *
select hex2int('wrong')
Executing . . .

E_OME001 hex2int(): Non hex character 'w' found in string.
    (Fri Jul 30 12:18:26 2021)

continue
* * select hex2int('')
Executing . . .

E_OME001 hex2int(): No convertable characters in input string
    (Fri Jul 30 12:18:26 2021)

continue
* * select hex2int('0x8fffffffffffffff')
Executing . . .

E_OME001 hex2int(): Numeric Overflow has occurred.
    (Fri Jul 30 12:18:26 2021)

continue
* * select hex2int('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')
Executing . . .

E_OME001 hex2int(): character string is too long for conversion.
    (Fri Jul 30 12:18:26 2021)


Marty

From: Martin Bowes <martin.bowes at ndph.ox.ac.uk>
Sent: 30 July 2021 11:57
To: info-ingres at lists.planetingres.org
Subject: [Info-ingres] OME and 11.2

Hi all,

Having installed a fresh installation of 11.2, for some reason, the thought of making an OME function to convert a hex string into its integer8 equivalent came to mind. And so:

select hex2int('a'), hex2int('0xb'), hex2int('+0xc'), hex2int('-0xd')

┌──────────────────────┬──────────────────────┬──────────────────────┬──────────────────────┐
│col1                  │col2                  │col3                  │col4                  │
├──────────────────────┼──────────────────────┼──────────────────────┼──────────────────────┤
│                    10│                    11│                    12│                   -13│
└──────────────────────┴──────────────────────┴──────────────────────┴──────────────────────┘
(1 row)

Yep, that looks good! Now for some error testing:
select hex2int('wrong')
E_US2525 'hex2int' is only supported by queries on X100 tables.

What?

And in fact whenever my code finds a condition in which it generates an error, I get the above error at the front end rather than my error text. Nothing comes into the errlog.

Can anyone shed some light on that one please.

Marty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.planetingres.org/pipermail/info-ingres/attachments/20210730/e6ea5907/attachment.html>


More information about the Info-ingres mailing list