Db error

Hi All !
Anybody can explain me, what’s wrong?
In this case, I use only interbase.so directly, not DBI,
but when I use dbi have same problems.
You can see in code below

···

require ‘interbase’

conn=InterBase::connect(‘elf:c:/dbdata/ibdata/icsdata.gdb’,‘sysdba’,‘dbmaster
’) sql = “select HRS_DATE, HRS_TIME, HRS_PIPE3, HRS_PIPE4 from HOURS where
HRS_DATE between '”+strBegin+"’ and ‘"+strEnd+"’ order by HRS_DATE" cursor =
conn.execute(sql)

ERROR:
./dailyc.rbx:131: in ‘execute’: Column does not belong to referenced table
(Interbase::Error) from ./dailyx.rbx:131

SQL Server : Firebird 1.0.2
table Hours
fields
HRS_DATE type Date
HRS_TIME type Time
HRS_PIPE3, HRS_PIPE4 type double

I understand that problem with fields has date or time types.
How can I work with fields date and time types, not timestamp.
Some code examples
Thanks for advance
Vladimir

conn=InterBase::connect('elf:c:/dbdata/ibdata/icsdata.gdb','sysdba','dbmaster
') sql = "select HRS_DATE, HRS_TIME, HRS_PIPE3, HRS_PIPE4 from HOURS where
HRS_DATE between '"+strBegin+"' and '"+strEnd+"' order by HRS_DATE" cursor =
conn.execute(sql)

That is nasty. If strBegin or strEnd contained any text which was controlled
by an outside user, they could use it to access any part of your database,
or corrupt its contents. You really ought to use a quoting function.

If this were DBI you would be able to substitute parameters:

"select ... between ? and ? order by HRS_DATA", strBegin, strEnd

It's likely that InterBase has a similar mechanism.

Anyway, that may not be your problem, but have you tried a simpler statement
like

    select * from HOURS;

or select HRS_DATE,HRS_TIME,HRS_PIPE3,HRS_PIPE4 from HOURS;

Then try removing the columns one at a time to see which one is causing the
problem. Try it with text columns. The error message doesn't seem to say
it's a type conversion problem:

------------------------------------------------------
ERROR:
./dailyc.rbx:131: in 'execute': Column does not belong to referenced table
(Interbase::Error) from ./dailyx.rbx:131
--------------------------------------------------------------------

So if it is, the error message is misleading at least!

Regards,

Brian.

···

On Thu, Feb 27, 2003 at 05:18:54PM +0900, Vladimir wrote: