cancel
Showing results for 
Search instead for 
Did you mean: 

Native Sql Query error

vito16
Champ in-the-making
Champ in-the-making
Im need query user task list  and with some variable what link this task.
when i running following sql :

SELECT
t.ID_,
t.REV_,
t.EXECUTION_ID_,
t.PROC_INST_ID_,
t.PROC_DEF_ID_,
t.NAME_,
va1.TEXT_,
va2.TEXT_
FROM
dbo.ACT_RU_TASK AS t
INNER JOIN dbo.ACT_RU_EXECUTION AS e ON t.EXECUTION_ID_ = e.ID_
INNER JOIN dbo.ACT_RU_VARIABLE AS va1 ON va1.EXECUTION_ID_ = t.EXECUTION_ID_
INNER JOIN dbo.ACT_RU_VARIABLE AS va2 ON va2.EXECUTION_ID_ = t.EXECUTION_ID_
INNER JOIN dbo.ACT_RU_IDENTITYLINK AS idlink ON idlink.TASK_ID_ = t.ID_
WHERE
idlink.USER_ID_ = 3 AND
va1.NAME_ = 'companyID' AND
va2.NAME_ = 'processType'

im getting this error:
<code>
[Err] 22018 - [SQL Server]Conversion failed when converting the nvarchar value 'Order' to data type int.
<code>
3 REPLIES 3

liowbot
Champ in-the-making
Champ in-the-making
USER_ID_ should be in character form. Enclose 3 in a quotation mark:

idlink.USER_ID_ = '3'

vito16
Champ in-the-making
Champ in-the-making
thank u!
Problem solved.

liowbot
Champ in-the-making
Champ in-the-making
You're welcome.