select_single error

GuyRich

New member
Hi, I'm fairly new to Dadabik, so apologies if I'm missing something, but I can't get the select single to work at all.
I have set up a table called "crafttest" with "id" as serial and "lookup" as select_single.
It doesn't matter what table I choose to look up the values, I always get an error. I wondered if it could be the data in one of my tables, so I used the dadabik_groups table and still got the error below.

[08] Error: during query execution. SELECT COUNT(*) FROM "crafttest" LEFT JOIN "dadabik_groups" AS "dadabik_groups____1" ON "crafttest"."lookup" = "dadabik_groups____1"."id_group"
The DBMS server said: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: character varying = integer LINE 1: ... AS "dadabik_groups____1" ON "crafttest"."lookup" = "dadabik... ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts.

The lookup seems to work fine in the preview, but once I exit admin and try to view the table, I get the above.

Any help would be greatly appreciated.
Thanks.

System info:
You are using DaDaBIK version 11.7-Elba platinum, installed on 11-14-2022 (installation code: ), the latest version of DaDaBIK is 11.7-Elba released on 08-18-2022

You are running the latest release of DaDaBIK

System info​

PHP Version: 7.3.33

postgres version: 12.12 (Ubuntu 12.12-0ubuntu0.20.04.1)

Web server: LiteSpeed

Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.42
 

GuyRich

New member
OK, I think I've got it.
The "select_single" needs to be an int on the looked-up table AND on the table doing the lookup.
This was confusing me as with the multi lookup, it's an int on the looked-up table, but a varchar on the lookup table...
 

eugenio

Administrator
Staff member
Hello,
yes, that's correct. With select single, the lookup field type must be the same of the PK of the lookup table, because you store in the lookup field exactly that PK value.
select_multiple is totally different: it stores the values separated by ~ so it's a varchar.

Best
 
Top