FR4 Query with parameters
I am using FR4 VCL (although the same applies to FR Studio)
I set up an Interbase connection
I set up an Interbase query with the text
SELECT * FROM JOB_ITEM WHERE JOB_NUMBER="01200"
I set up a Master Data Band with the JOB_NUMBER field and a Detail band with a few other fields
The report shows the data I would expect.
Now, I wish to select what job I want and change the query text to:
SELECT * FROM JOB_ITEM WHERE JOB_NUMBER=:pJOB_NUMBER
also create a variable called vJOB_NUMBER
in the query parameters, I set pJOB_NUMBER as STRING and the value to be vJOB_NUMBER
in the code page I put Set('vJOB_NUMBER','01200');
The report shows no data.
Tracing through the code in frxIBXComponents.pas, params[0] seems to be being passed the value of '01200' but no data is returned.
What do you think is happening?
I set up an Interbase connection
I set up an Interbase query with the text
SELECT * FROM JOB_ITEM WHERE JOB_NUMBER="01200"
I set up a Master Data Band with the JOB_NUMBER field and a Detail band with a few other fields
The report shows the data I would expect.
Now, I wish to select what job I want and change the query text to:
SELECT * FROM JOB_ITEM WHERE JOB_NUMBER=:pJOB_NUMBER
also create a variable called vJOB_NUMBER
in the query parameters, I set pJOB_NUMBER as STRING and the value to be vJOB_NUMBER
in the code page I put Set('vJOB_NUMBER','01200');
The report shows no data.
Tracing through the code in frxIBXComponents.pas, params[0] seems to be being passed the value of '01200' but no data is returned.
What do you think is happening?
Comments
So, the answer is: To use a string value, ensure it is surrounded by double single quotes, then the program won't try to make it a number.