🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.xml
Article #10010

xquery prosze o pomoc

#10010
From: aja74
Date: Fri, 10 Oct 2008 09:48
26 lines
1649 bytes
Hi

mam problem z XQuery w mssql 2005:

wszystko dzialalo dopuki nie  zaistniala potrzeba  dodania "WHERE"

DECLARE @xVar XML
SET @xVar = (SELECT * FROM exportyXML FOR XML AUTO,TYPE)
SELECT
tab.col.value('date[1]', ' nvarchar(50)') As Date,
tab.col.value('sartindex[1]', 'nvarchar(50)') As sartindex,
...
from @xVar.nodes('//body//entities//art') tab(col)
WHERE @xVar.exist ('./entities[@type = "zwroty opakowan"]') = 1

No i  "WHERE" nie dziala?

w pliku xml mam:
 <entities type="zwroty opakowan" approx_count="1"><art>...</art>
<entities type="obroty opakowan" approx_count="5"><art>...</art>

powinienem otrzymac jeden rekord (bo tyle bylo zwrotow opakowan) a nie 
otrzymuje ani jednego. Jak to rozwiazac? approx_cont bedzie inne w innym 
pliku wiec  po polu approx_count nie moge

AJA
Technical Details
Message-ID: <gcn8d5$833$1@inews.gazeta.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: "aja74" <ajanospam74@gmail.com>
Newsgroups: pl.comp.xml
Subject: xquery prosze o pomoc
Date: Fri, 10 Oct 2008 11:48:23 +0200
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 30
Message-ID: <gcn8d5$833$1@inews.gazeta.pl>
NNTP-Posting-Host: xdsl-2307.zgora.dialog.net.pl
X-Trace: inews.gazeta.pl 1223632101 8291 81.168.237.3 (10 Oct 2008 09:48:21 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Fri, 10 Oct 2008 09:48:21 +0000 (UTC)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-Priority: 3
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-User: aja74
X-MSMail-Priority: Normal
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit