Ask Your Question

Error Invalid data type for setstring

asked 2019-09-18 09:52:38 +0100

hermanv gravatar image

updated 2019-09-18 18:10:12 +0100

Ratslinger gravatar image

LibreOffice Base 6.3 using Firebird. I have a table "Gezinnen" with 3 columns:

gezinsid int autonum primary key
title varchar
huwelijksdatum date

I can do a query succesfully:

 select gezinsid, titel, extract(month from huwelijksdatum) from Gezinnen (with the appropriate "'s)

But when I do

select gezinsid, titel, extract(month from huwelijksdatum) from Gezinnen where extract(month from huwelijksdatum)=:mndnr

The dialogue box for the input appears, but no matter how I try to format the answer, I get the error HY004 Invalid data type for setString. I know this error comes from firebird, but how can I get rid of this problem? I tried to save the first select as a query and then open a second query with the first as its source and just add the input parameter, but the error remains the same.

Edited for clarity - @Ratslinger

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2019-09-18 19:23:37 +0100

Ratslinger gravatar image

updated 2019-09-18 19:24:55 +0100


In testing this can be duplicated. If parameter is replaced with a value the statement works. Must be a bug with parameter usage.

I can get to work with the following SQL:

Select gezinsid, title, ext_month From (select gezinsid, title, Cast(extract(MONTH from huwelijksdatum) as varchar(2)) as ext_month from Gezinnen) where ext_month = :mndnr

You may want to report the error -> Bugzilla

edit flag offensive delete link more


Note: Do not enter leading zero for month in parameter entry where it is a single digit - January = 1 for parameter not 01.

Can probably adjust SQL if needed.

Ratslinger gravatar imageRatslinger ( 2019-09-18 19:52:34 +0100 )edit

Bug 127657 submitted.

hermanv gravatar imagehermanv ( 2019-09-20 09:57:39 +0100 )edit

answered 2019-09-19 20:20:26 +0100

hermanv gravatar image

updated 2019-09-19 20:21:42 +0100

I never used leading zero's, so that's not the point. In the mean time I tried to cast the month expression to varchar(2) and then the query works. So I'll write a bug on this issue soon.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-09-18 09:52:38 +0100

Seen: 264 times

Last updated: Sep 19 '19