Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to load a SQL which is stored in a column called statement of another Table.
The output from all SQL statements in the table needs to be concatenated.
I am using the following code
[ code ]
ODBC CONNECT TO XXXXX;
[SQLCODE]:
LOAD `sqlcode`,
statement,
title,
description,
dropoffpct,
avgsettlevalue,
avgpctcomp;
SQL SELECT *
FROM misql;
LET vLoop=noofrows('SQLCODE');
FOR i = 0 to $(vLoop)-1
LET vSQL = peek('statement',$(i),SQLCODE);
SQL $(vSQL);
NEXT i
[ /code ]
---------------------------------------
Error Msg
---------------------------------------
ODBC read failed
SQL SELECT *
FROM midata d, mirejections r
WHERE d.archstatus = 'Live'
AND d.rejectedreasons = r.type
AND d.claimtypedesc LIKE '%fast track%'
AND d.dmclaimtypedesc LIKE '%car accident%'
AND r.wipinc = '1'
AND d.feeearnerdesc NOT
IN (
'Allocation Manager PI', 'Allocation Manager SM'
)
AND d.feteamname NOT
IN (
'Assessment Team', 'Hera'
)
ORDER BY d.fileopened DESC
---------------------------------------
What could be going wrong?
Any help is greatly appreciated!!
It would help to see what is in vSQL when it fails.
I'm guessing that when you are passing through the SQL - you have a SQL SQL Select going.
wshpuntoff wrote:
It would help to see what is in vSQL when it fails.
I'm guessing that when you are passing through the SQL - you have a SQL SQL Select going.
<div></div>
Thanks... but it seems issue is with the SQL. (the one given in ERROR message.
when I run that statement directly in MySQL it s running fine. I tried running it Directly in Script, still it gves the same error in Qlikview.
Other simple queries are running fine.
Hi,
Does this part run?
SQL SELECT *
FROM midata d, mirejections r
I'm thinking the problem might be the column names here. Try encapsulating them in " " or [ ], "midata d" for example.