Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5 and v7 MSSQL error with lookup field #304

Open
caccia86 opened this issue Mar 29, 2024 · 1 comment
Open

V5 and v7 MSSQL error with lookup field #304

caccia86 opened this issue Mar 29, 2024 · 1 comment

Comments

@caccia86
Copy link
Contributor

caccia86 commented Mar 29, 2024

Hi,
I'm working with a MSSQL database and in my project I also use a lookup field. I encount a problem with the filter function avaible in jam.py interface.
The error it's show below:

image

image

image

With the SQL profiler I saw an incorrect query and I report it below:

SELECT b."id",
       b."deleted",
       b."campo2",
       b."descr",
       campo2_lookup
FROM   (SELECT "test_tabella_slave"."id",
               "test_tabella_slave"."deleted",
               "test_tabella_slave"."campo2",
               "test_tabella_slave"."descr",
               TEST_TABELLA_MASTER_10."campo1"         AS CAMPO2_LOOKUP,
               Row_number()
                 OVER (
                   ORDER BY "test_tabella_slave"."id") AS RowNum
        FROM   "test_tabella_slave" AS "TEST_TABELLA_SLAVE"
               LEFT OUTER JOIN "test_tabella_master" AS TEST_TABELLA_MASTER_10
                            ON "test_tabella_slave"."campo2" =
                               TEST_TABELLA_MASTER_10."id"
        WHERE  Cast(Cast(TEST_TABELLA_MASTER_10."campo1" AS DECIMAL(20, 10)) AS
                    VARCHAR
                    (20))
               LIKE '%sda%'
               AND "test_tabella_slave"."deleted" = 0) AS b
WHERE  rownum >= 1
       AND rownum < 24
ORDER  BY rownum 

I think the problem is this istruction

WHERE Cast(Cast(TEST_TABELLA_MASTER_10."campo1" AS DECIMAL(20, 10)) AS VARCHAR (20))

For the MSSQL databases it could be necessary to fix the convert_like function.
Thanks in advance.

@platipusica
Copy link
Collaborator

I concur with this, reported here as well:

https://groups.google.com/g/jam-py/c/oH36stjvtMk

@platipusica platipusica changed the title V5 MSSQL error with lookup field V5 and v7 MSSQL error with lookup field Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants