Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sona_sa
Creator II
Creator II

SQL QUERY to QLIKVIEW

Hi,

I want to convert the sql query to QlikView Script. Below are the mentioned query. Also if it possible to convert into VB macro, it is also helpful for me to execute it by QV macro.

DECLARE @LLNO BIGINT;

DECLARE @LLBK BIGINT

SET @LLNO = 1;

WHILE  @LLNO<=100

BEGIN

SET @LLBK =(SELECT DISTINCT LOID FROM [dbCertifiedInventory_Live].[dbo].QLIKVIEW_LOTID_IDENTITY WHERE SR_NO =@LLNO)

exec [dbo].[SP_QLIKVIEW_SINGLE_LOT_INSERT] @LLBK,'','','0','0','0','01-Mar-2013','31-Dec-2014',''

print 'success';

SET @LLNO = (@LLNO+1);

end;


Regards,

Amit Kumar

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

That's not an sql query, but a block of code that appears to execute a loop that executes a stored procedure that inserts data into some table. This cannot be converted to Qlikview script. The best you can do is create a stored procedure that executes that block of code and call that stored procedure from the qlikview script: SQL EXEC [dbo].[MyNewSP];


talk is cheap, supply exceeds demand