MINI MINI MANI MO
<?xml version="1.0"?>
<!--
Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
NAME
kusseqd.xsl
DESCRIPTION
Convert SEQUENCE document (SXML) to creation DDL.
MODIFIED MM/DD/YY
bwright 03/24/15 - Bug 20771546: Support for scalable sequence
dvekaria 03/27/14 - Bug 18401399: Generate SESSION attributes.
lbarton 02/11/14 - bug 17943479: import kustablc
rapayne 08/21/11 - project 36780: Identity Column support.
slynn 04/11/11 - Project 25215: Sequence enhancements.
sdavidso 11/02/05 - fix inconsistent stylesheet format
lbarton 08/10/05 - lbarton_mddiff
htseng 03/23/05 - Initial version
-->
<xsl:stylesheet version="1.0" xmlns:sxml="http://xmlns.oracle.com/ku" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Top level imports -->
<xsl:import href="kuscommd.xsl"/>
<xsl:import href="kustablc.xsl"/>
<!-- Top-level parameters -->
<!-- Parameters for DDL generation -->
<xsl:param name="PRETTY">1</xsl:param>
<xsl:param name="SQLTERMINATOR">0</xsl:param>
<!-- *******************************************************************
Template: SEQUENCE - top-level template for tables.
This template puts out
- CREATE SEQUENCE name
******************************************************************** -->
<xsl:template match="sxml:SEQUENCE">
<xsl:text> CREATE SEQUENCE </xsl:text>
<xsl:call-template name="SchemaName">
<xsl:with-param name="ParentNode" select="."/>
</xsl:call-template>
<!-- generate sequence attributes. Note: this is common between
sequence objects and tables with identity columns.
-->
<xsl:call-template name="doSeqOptions">
<xsl:with-param name="seqNode" select="."/>
</xsl:call-template>
<xsl:if test="($VERSION>=1200000000) and sxml:KEEP">
<xsl:text> KEEP </xsl:text>
</xsl:if>
<!-- Place SCALE between KEEP and SESSION/GLOBAL both here and
when generating directly from XML (kuseq.xsl) -->
<xsl:if test="$VERSION>=1202000000 and sxml:SCALE">
<xsl:choose>
<xsl:when test="sxml:SCALE='NOSCALE'">
<xsl:text> NOSCALE </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> SCALE </xsl:text>
<xsl:value-of select="sxml:SCALE"/>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<!-- Bug 18401399: Generate SESSION if SESSION attribute defined -->
<xsl:if test="($VERSION>=1200000000) and sxml:SESSION">
<xsl:text> SESSION </xsl:text>
</xsl:if>
<xsl:if test="$SQLTERMINATOR=1">
<xsl:text>;</xsl:text>
<!-- Terminate the SQL statement -->
</xsl:if>
</xsl:template>
</xsl:stylesheet>
OHA YOOOO