on ‎2011 Jul 29 1:43 PM
Hi,
I have 2 fixed queries and not returning any values when I execute them though the data exists in tables.
1. SELECT '[Param.2]' AS name,
ShiftDefinition.idShiftDefinition AS idShiftDefinition
FROM ShiftDefinition
INNER JOIN ShiftDefinition_lang
ON ShiftDefinition_lang.idFactory = ShiftDefinition.idFactory
AND ShiftDefinition_lang.idShiftDefinition = ShiftDefinition.idShiftDefinition
WHERE ShiftDefinition.idFactory = '[Param.1]'
order by ShiftDefinition.timeBegin asc
2. SELECT Team.idTeam, Team.teamName
FROM Team
WHERE (Team.idFactory = '[Param.1]')
ORDER BY Team.teamOrder ASC
Can someone help guide why I am not able to retrieve any result after execution.
Thanks,
Raveen
Request clarification before answering.
Hi Raveen,
What is the datatype of Team.idFactory? If you are using the '\[Param.X\]' syntax, you may not need the quotes, which are for string datatypes. When testing, do you have a default parameter set on the Parameters screen? Does the query work if you substitute \[Param.X\]' with an actual value?
Kind Regards,
Diana Hoppe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raveen,
If you want to test the query in the Workbench, you would need to have a default parameter set on the Parameters screen when using \[Param.X], otherwise the query will fail. This parameter can be overwritten at runtime, for example, you link in a new value from a web page or BLS transaction.
- Diana
Hi Raveen,
Looking at the query, I assume that Param.2 is a placeholder for a column name. Generally, whenever you would use quotes when hardcoding the entire query, you would need to use the quotes with the placholder ('\[Param.1\]'). Since a column name is not usually quoted, you don't need the quotes in this case, even though the column name is a string.
SELECT \[Param.2\] AS name,
ShiftDefinition.idShiftDefinition AS idShiftDefinition
FROM ShiftDefinition
INNER JOIN ShiftDefinition_lang
ON ShiftDefinition_lang.idFactory = ShiftDefinition.idFactory
AND ShiftDefinition_lang.idShiftDefinition = ShiftDefinition.idShiftDefinition
WHERE ShiftDefinition.idFactory = \[Param.1\]
order by ShiftDefinition.timeBegin asc
Let me know if that does the trick
- Diana
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.