SAP Knowledge Base Article - Preview

2604264 - DDLGEN output is incorrect for a column level check constraint

Symptom

  • DDLGEN option -TR generates a DDL for a table level check constraint.
  • The generated output does not provide complete syntax needed to create it
  • The syntax it uses to drop the DDL is incorrect and intended for an explicitly created rule.

    ddlgen -Usa -P<password> -S<servername> -TR -N tempdb.dbo.testtab_col_chkstr

-----------------------------------------------------------------------------
-- DDL for Rule 'tempdb.dbo.testtab_col_chkstr'
-----------------------------------------------------------------------------

print '<<<<< CREATING Rule - "tempdb.dbo.testtab_col_chkstr" >>>>>'
go

use tempdb
go

IF EXISTS (SELECT 1 FROM sysobjects o, sysusers u WHERE o.uid=u.uid AND o.name = 'testtab_col_chkstr' AND u.name = 'dbo' AND o.type = 'R')
BEGIN
        setuser 'dbo'
        drop rule testtab_col_chkstr            <<< Incorrect

END
go

IF (@@error != 0)
BEGIN
        PRINT 'Error dropping Rule tempdb.dbo.testtab_col_chkstr'
        SELECT syb_quit()
END
go

setuser 'dbo'
go
                      
<<< missing here is the create constraint information >>>

CONSTRAINT testtab_col_chkstr CHECK (c3 in("AAA", "BBB", "CCC"))
go

setuser
go


Read more...

Environment

Adaptive Server Enterprise (ASE) 16.0

 

Product

SAP Adaptive Server Enterprise 16.0

Keywords

KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.