Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have an MS SQL query which *must* include a semicolon, however Qlikview is treating this as the end of the SQL script. How can I prevent this?
test:
load *;
SQL
declare @i int
declare @hello nvarchar(20)
declare @hello2 nvarchar(20)
declare @code nvarchar(20)
declare @original nvarchar(20)
declare @counter nvarchar(20)
declare @rownum nvarchar(20)
declare @cachecounter nvarchar(20)
declare @iterate nvarchar(20)
set @iterate=1
set @rownum=1
set @counter=1
set @original=5158
set @code=0
select @i=2
select @cachecounter=count(1) from ErrorForms.dbo.CacheById where Type=6;
with ordered as (select ROW_NUMBER ( ) OVER (Order by Code desc ) as rownumber, Code, Id from ErrorForms.dbo.cachebyid where Type=6)
select @hello=Code from ordered where rownumber=9
That's not a query but a procedure. Create a stored procedure in your source database and call the stored procedure from qlikview
That's not a query but a procedure. Create a stored procedure in your source database and call the stored procedure from qlikview
If that is not an option, does With require a leading semicolon if it is the first expression in a SQL batch? None of the declares, sets or selects before the With do anythng as far as I can see, so if you remove those, you won't need the semicolon.
HTH
Jonathan