SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
SQL Syntax Checker points out wrong line

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
SQL Syntax Checker points out wrong line
Author Message
birgerii



Joined: 21 Feb 2007
Posts: 29

Post SQL Syntax Checker points out wrong line Reply with quote
The SQL Syntax Checker underlines the wrong error.
SC underlines the blue part, but that line is OK, the error is found in the red part, by the last LEFT JOIN.

I'm using version 5.2.59.

SELECT pk_orr_kostnadsrader_id = COALESCE(ok.pk_orr_kostnadsrader_id, 0)
, o.orderid
, levsattkod = COALESCE(f.levsattid, o.levsattkod, '')
, levsatttext = COALESCE(ls.anmarkning,
CASE
WHEN o.levsatttext = '' THEN o.levsattkod COLLATE FINNISH_SWEDISH_CS_AS
ELSE o.levsatttext
END)
, godsmarke = COALESCE(f.godsmarke, '')
, levvillkorkod = COALESCE(fo.levvillkorid COLLATE FINNISH_SWEDISH_CS_AS, o.levvillkorkod, '')
, levvillkortext = COALESCE(xv.anmarkning,
CASE
WHEN o.levvillkortext = '' THEN o.levvillkorkod COLLATE FINNISH_SWEDISH_CS_AS
ELSE o.levvillkortext
END)
, ok.kostnadsartikel
, artikelbeskrivning = COALESCE(a.beskrivning, '')
, ok.antal Antal
, ok.pris Pris
FROM ph ph
INNER JOIN (SELECT pr.ph
, pr.gruppnr
, pr.orderid
, max(COALESCE(pr.fsid, 0)) fsid
FROM pr
WHERE pr.ph = @ph
AND pr.gruppnr = @gruppnr
GROUP BY pr.ph
, pr.gruppnr
, pr.orderid) s_pr ON
ph.ph = s_pr.ph
INNER JOIN oh o ON
s_pr.orderid = o.orderid
LEFT JOIN orr_kostnadsrader ok ON
o.orderid = ok.orderid
LEFT JOIN ar a ON
ok.kostnadsartikel = a.artnr
LEFT JOIN x_frakt_ls xl ON
o.levsattkod = xl.leveranssatt_kod
LEFT JOIN x_frakt_lv xlv ON
o.levvillkorkod = xlv.leveransvillkor_kod
LEFT JOIN fs f ON
s_pr.fsid = f.fsid
LEFT JOIN fs_oh fo ON
f.bolagid = fo.bolagid
AND f.fsid = fo.fsid
AND o.orderid = fo.orderid
LEFT JOIN x_ls ls ON
f.levsattid = ls.levsatt
LEFT JOIN x_lv xv ON
f.levvillkorid = xv.levvillkor COLLATE FINNISH_SWEDISH_CS_AS
WHERE ph.ph = @ph
AND s_pr.gruppnr = @gruppnr
ORDER BY o.orderid
, ok.kostnadsartikel
Fri Aug 12, 2011 2:12 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 5284

Post Reply with quote
The error is returned by the database server engine, not by SQL Assistant. The database error message is not very specific. It simply indicates that there is an issue with levvillkorid and no specific line number is provided. SQL Assistant finds the first reference to that text and highlights it. That is by design.
Fri Aug 12, 2011 10:39 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.