> -----Original Message-----
> From: lu peng [mailto:[EMAIL PROTECTED]
> Sent: Saturday, May 22, 2004 6:18 PM

[...]

> I migrated an oracle application to maxdb7.5.0.11 for 
> solaris(64bit) and 
> compiled under ORACLE MODE.
> 
> i got a "bus error" when using "sqlprc()" to extract 
> precision and scale 
> from NUMBER datatype.

Hi,
A trace back will be helpful. To prevent you to made a complete debug build you can 
include the 
actual implementation of the sqlprc function into your cpc program and compile it with 
debugging switched on.
Please rename the function sqlprc to sqlprc1 and call it before your original sqlprc 
call. 

regards
Burkhard

void sqlprc (long *length, int *precision, int *scale)
/*      The function sqlprc exstracts precision and scale fields
        from length according to the CPR_KIND_ORACLE conventions for the
        NUMBER data type. All parameters are pointers to long,
        length is input, precision and scale are output.
        This implementation requires, that a long variable occupies
        four bytes.
*/
{
        long m_scale = 0xFF; /* mask for scale extraction */
        long s_scale = 0x80; /* sign bit of scale field */
        unsigned long m_prec = 0xFFFFFF00; /* mask for precision extraction */
        long c_prec  = 0x00FFFFFF; /* clear mask for shifted precision */

        *scale = *length & m_scale; /* extract scale */
        if (*length & s_scale) *scale = *scale | m_prec; /* propagate sign */
        *precision = (*length & m_prec) >> 8 & c_prec; /* extract prec. */
        return;
}

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to