[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

AW: sql if exists

Subject: AW: sql if exists
From: "Szabo, Patrick \(LNG-VIE\)" <patrick.szabo@xxxxxxxxxxxxx>
Date: Wed, 15 Apr 2009 10:22:45 +0200
AW:  sql if exists
Sorry but i donB4t really understand what you mean.

Dou you mean...

<xsl:choose>
  <xsl:when test="exists("SELECT STATEMENT")">
    <...>
  </xsl:when>
  <xsl:otherwise>
    <...>
  </xsl:otherwise>
</xsl:choose>

???

I think i didnB4t make myself clear.

What i want to do:

First i want to check if a certain row already exists in the DB.
If that is not the case i want to insert that row.

cheers

Patrick Szabo
EPD / XSLT Konvertierung
Tel.: +43-1-534 52-1573
Fax.: +43-1-534 52-1573
patrick.szabo@xxxxxxxxxxxxx

LexisNexis Verlag ARD Orac GmbH & Co KG
Marxergasse 25, 1030 Wien
FN 8333f, Handelsgericht Wien
www.lexisnexis.at






Patrick Szabo
XSLT-Entwickler

Tel.: +43 (1) 534 52 - 1573
Fax: +43 (1) 534 52 - 146

Patrick.Szabo@xxxxxxxxxxxxx

LexisNexis Verlag ARD Orac GmbH & Co KG
Marxergasse 25, 1030 Wien
FN 8333f, Handelsgericht Wien
http://www.lexisnexis.at/

-----UrsprC<ngliche Nachricht-----

Von: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Gesendet: Mittwoch, 15. April 2009 10:09
An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: RE:  sql if exists

Sure. You can do it at the XSLT level

<xsl:choose>
  <xsl:when test="exists(/a/b/c)">
    <...>
  </xsl:when>
  <xsl:otherwise>
    <...>
  </xsl:otherwise>
</xsl:choose>

or at the XPath level:

select="if (exists(/a/b/c)) then ... else ..."

In practice people often leave out the call to exists() because the effective
boolean value of a node-sequence is true if it's non-empty, so this is
equivalent to test="/a/b/c".

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Szabo, Patrick (LNG-VIE) [mailto:patrick.szabo@xxxxxxxxxxxxx]
> Sent: 15 April 2009 08:32
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  sql if exists
>
> Hi,
>
> IB4m using saxon 9 and xslt 2.
>
> I want to insert data into a database with my xslt-sheet which is no
> problem. The problem is that i only want to do that under certain
> conditions.
>
> In SQL thatB4d look like this:
>
> "IF EXISTS ( select * from...)
> 	Do something
> ELSE
> 	do something else"
>
> Is there a way to use that code in my xslt-sheet ?!
>
> Currently iB4m using
> "java:/net.sf.saxon.sql.SQLElementFactory" to insert something at all.
>
> Thx already
>
> cheers
>
> Patrick Szabo
> EPD / XSLT Konvertierung
> Tel.: +43-1-534 52-1573
> Fax.: +43-1-534 52-1573
> patrick.szabo@xxxxxxxxxxxxx
>
> LexisNexis Verlag ARD Orac GmbH & Co KG Marxergasse 25, 1030 Wien FN
> 8333f, Handelsgericht Wien www.lexisnexis.at
> <http://www.lexisnexis.at/>
>
>  <file://C:\Dokumente und
> Einstellungen\szaboP\Anwendungsdaten\Microsoft\Signatures\LN
> Vienna signature-Dateien\image001.jpg>
>
>
>
>
> Patrick Szabo
> XSLT-Entwickler
>
> Tel.: +43 (1) 534 52 - 1573
> Fax: +43 (1) 534 52 - 146
>
> Patrick.Szabo@xxxxxxxxxxxxx
>
> LexisNexis Verlag ARD Orac GmbH & Co KG
> Marxergasse 25, 1030 Wien
> FN 8333f, Handelsgericht Wien
> http://www.lexisnexis.at/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.