Subject Re: [ib-support] Embedded SQL anyone?
Author Peter Faulks
On Wed, 03 Apr 2002 13:15:50 -0500 Ann Harrison <aharrison@...>
wrote:

> >1) what is the deal with isc_decode_sql_date() why is the result in the
tm
> >struct a 2 digit year and why is the month off by 1?
>
> Because the tm struct is a c thingy and that's the way it's
> defined.

Here's a tm struct definition:

struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
};

For backward compatibility, you'd have to leave isc_decode_sql_date() as
is, but perhaps a new function that actually returns the correct values
might be in order?



> >2) a type decimal - seems to be off by a factor of 100 when fetched
into a
> >float or even a double - what gives?
>
> Is the number defined as (n, 2) - where n is some number?

yes


> >3) I have a query that works fine in isql but barfs in embedded sql -
>
> All I can think of is that you've used the syntax for a singleton
> select and should probably use a cursor.

No, it is guaranteed to be a single row.

And I tried a cursor anyway and got -501

Would it be any good if I sent the generated blr?

Thanks and Regards