Sto utilizzando JSL per recuperare dati da un database MySQL. Tuttavia, ho riscontrato un problema per cui le condizioni di filtro nella mia query SQL non fanno distinzione tra maiuscole e minuscole per impostazione predefinita. Ciò significa che i risultati restituiti sono gli stessi indipendentemente dal valore del filtro.
Ecco i due script che producono gli stessi risultati:
Copione 1:
New SQL Query(
Version( 130 ),
Connection(
"ODBC:DATABASE=my_database;DSN=my_dsn;PORT=3306;PWD=my_password;SERVER=localhost;UID=my_user;"
),
QueryName( "test_data" ),
Select(
Column( "Column1", "t1" ),
Column( "Column2", "t1" ),
Column( "Column3", "t1" )
),
From( Table( "test_data", Alias( "t1" ) ) ),
Where(
Not Or(
In List(
Column( "Column1", "t1" ),
{"A"},
UI( SelectListFilter( ListBox, Base( "Categorical" ) ) )
)
)
)
) << Run;
Copione 2:
New SQL Query(
Version( 130 ),
Connection(
"ODBC:DATABASE=my_database;DSN=my_dsn;PORT=3306;PWD=my_password;SERVER=localhost;UID=my_user;"
),
QueryName( "test_data" ),
Select(
Column( "Column1", "t1" ),
Column( "Column2", "t1" ),
Column( "Column3", "t1" )
),
From( Table( "test_data", Alias( "t1" ) ) ),
Where(
Not Or(
In List(
Column( "Column1", "t1" ),
{"a"},
UI( SelectListFilter( ListBox, Base( "Categorical" ) ) )
)
)
)
) << Run;
How can I modify the New SQL Query function in my JSL scripts to make the filtering conditions case-sensitive?
Grazie per l'aiuto!
Qualcuno di JMP molto probabilmente lo sa meglio, ma sai come appare la query SQL? Penso che tu possa vederlo convertendo in SQL personalizzato

Inoltre, come è configurato il tuo database? Se esegui la query in qualche altra applicazione ottieni gli stessi risultati? Non ho familiarità con MySQL ma forse quelli non fanno distinzione tra maiuscole e minuscole per impostazione predefinita https://dev.mysql.com/doc/refman/8.4/en/case-sensitivity.html
L'istruzione SQL è simile a questa:
SELECT t1.`Column1`, t1.`Column2`, t1.`Column3`
FROM test_data t1
WHERE ( NOT ( ( ( t1.`Column1` IN ( 'A' ) ) ) ) ) ;
I know that adding the BINARY keyword in SQL can enforce case sensitivity, for example:
SELECT `Column1`, `Column2`, `Column3`
FROM `test_data` AS `t1`
WHERE BINARY `Column1` NOT IN ('A');And using the open Database function, I can execute SQL statements directly. However, I am particularly interested in whether the New SQL Query function in JSL can achieve the same case-sensitive effect.
Grazie per il vostro aiuto!
Penso che potresti dover aggiungere un'espressione personalizzata per gestire situazioni del genere

O


Got it, that would be similar to referencing SQL statements in open Databasefunzione. Grazie!