Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In SQL 2012, I'm using the replace query as shown below with no problem. However, when I used in the script editor, it returned an error in Qlikview.
select
t.tpc_num,
replace(t.tpc_subject, ',',' '),
t.create_time,
t.closed_time,
s.status_name,
m.mpt_num,
c.item_type
FROM tpc t WITH(NOLOCK);
Please assist.
Thanks.
may be like this
select
t.tpc_num,
replace(t.tpc_subject, ',',' ') as tpc_subject,
t.create_time,
t.closed_time,
s.status_name,
m.mpt_num,
c.item_type
FROM tpc t WITH(NOLOCK);
Try loading the t.tpc_Subject field as is and then do the replace in a preceding load.
may be like this
select
t.tpc_num,
replace(t.tpc_subject, ',',' ') as tpc_subject,
t.create_time,
t.closed_time,
s.status_name,
m.mpt_num,
c.item_type
FROM tpc t WITH(NOLOCK);
Are you sure the problem is in replace function?
I just tried with a replace as your and I didn't get any error.
Also I've seen you have some other table alias in your code (bold) s, m, c but the table are missing.
select
t.tpc_num,
replace(t.tpc_subject, ',',' '),
t.create_time,
t.closed_time,
s.status_name,
m.mpt_num,
c.item_type
FROM tpc t WITH(NOLOCK);
It's always great to get hold of the actual error message text.
BTW the QlikView scripting engine puts everything between (SQL) SELECT and the semicolon as-is in a packet buffer and sends it unparsed to the Relational Database. It would be weird for QlikView instead of the RDBMS parser to return an error for bad SQL syntax...
Hi,
Thanks for all the feedback. Kush141087 gave me the correct working solution.