You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi,
I am trying to learn and use Script runner database picker field. I tried the query and used unique field for filtering and tried with some conditions as well.
But everytime I get an error "The SQL statement should have exactly one parameter marker" as in the picture. Any help is appreciated.
Database connection working fine for Elements connect section and trying to use the same database and table here.
Tried both query individually but got same error.
select CustomerID, FirstName from tblcustomer where lower(CustomerID) like '2%'
SELECT CustomerID, FirstName from tblcustomer
I am responding to your latest comment:
I created table with simple ID & name. Query accepted but no results popup with I type few letters of ID or Name.
select CustomerID,LastName from tblCustomer where CustomerID = cast(? as numeric)
select CustomerID,LastName from tblCustomer where lower(CustomerID) = concat(lower(?), '%')
For the Search SQL, you are searching against the 'CustomerID', not 'LastName' and the format seems different than the ones in our documentation.
Can you try changing it to:
select CustomerID,LastName from tblCustomer where lower(LastName) like lower(?) || '%'
If that doesn't help, may I know what database are you using?
Cheers,
Helmy
Hi,
2nd parameter is not accepting "||"
select CustomerID,LastName from tblCustomer where LastName = ?
select CustomerID,LastName from tblCustomer where lower(LastName) like lower(?) || '%'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
SQL Info:
SQL Server Management Studio 15.0.18142.0
Microsoft Analysis Services Client Tools 15.0.1389.0
Microsoft Data Access Components (MDAC) 10.0.19041.2006
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.11.19041.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 10.0.19042
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh,
I understand you are using Microsoft SQL Server. To concatenate strings, you would have to use the concat keyword.
Please can you try the following?
select CustomerID,LastName from tblCustomer where CustomerID = cast(? as numeric)
select CustomerID,LastName from tblCustomer where lower(LastName) like concat(lower(?),'%')
You should use LIKE operator instead of EQUAL(=) operator. For the retrieval SQL, if the ID column is alphanumeric, you don't have to cast it.
Cheers,
Helmy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh Srini ,
The error message indicates that both queries , Retrieval/validation SQL and Search SQL are expecting a single parameter "marker" in the query which is represented with "?". To help you , you can check one example here:
I hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is. Thank you.
Partially done. however 2nd Query is not seems to be accepted. This is my temporary tables and I have data. AgencyORI is "char" field type.
SELECT AgencyORI,AgencyName FROM AgencyLookup where AgencyORI =?
SELECT AgencyORI,AgencyName FROM AgencyLookup where lower(AgencyORI) like 'mn%'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Joaquin Fernández MoralesI am able to have the 2nd query also accepted without any error. However the results are not showing up.
I created table with simple ID & name. Query accepted but no results popup with I type few letters of ID or Name.
select CustomerID,LastName from tblCustomer where CustomerID = cast(? as numeric)
select CustomerID,LastName from tblCustomer where lower(CustomerID) = concat(lower(?), '%')
Any help would be much appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.