Subject [IBO] Date/Time selections
Author Brian Nuckels
I am having an issue with a parameterized SELECT query in IBO. I am writing a data import application to move data from some Paradox tables to Interbase. I'm using the BDE w/ TTable for the Paradox data and a TIB_DSQL component to perform the inserts. This import has to be performed in stages, because the DB schema is different. One of the fields being inserted to is of type TIMESTAMP. The data in this table appears fine after the inserts.

The next step of this process involves building a parameterized select query to search the table that was just populated. I am grabbing a Date/Time value from a Paradox table and using it to set one of my TIB_Query parameters which corresponds to a TIMESTAMP field. I have tried it several ways, including the straightforward:

qryTransID.Params.ParamByName('PKGDATE').AsDateTime := tblMonth.FieldByName('Send Date/Time').AsDateTime;

where qryTransID is my TIB_Query and tblMonth is a TTable.

However, no matter what, it never finds the record in the IB table. If I remove the TIMESTAMP parameter, I do get results back. I have verified that a record exists in the IB table that matches the date/time information from the Paradox record.

Here is what the SQL Monitor shows for the execution of my query:

EXECUTE STATEMENT
TR_HANDLE = 14097168
STMT_HANDLE = 14096704
PARAMS = [ Version 1 SQLd 4 SQLn 4
[CLIENT_NUM] = 'M005 '
[LOAN_NUM] = 'CL001009 '
[PKGDATE] = '11 Jan 2000 14:43:07'
[BILL_CLNT] = 'Y' ]

The timestamp info looks right--and I can see this record in the table. Any ideas why my query isn't working?

Brian Nuckels
http://www.shift8.net


[Non-text portions of this message have been removed]