Description of the basic template in codebuilder

Source: Internet
Author: User

Template. fbbase in codebuilder is a basic template based on XML syntax. It consists of defkeys, functions, parts, and sections.

Code

<? XML version = "1.0" encoding = "UTF-8" ?>
<! -- This file is defined by faib studio and Version 1.0 -->
<! --  
Language: The generatedCodeLanguage SQL | csharptext and so on
Convert: data type conversion dictionary Configuration
-->
< Config Name = "Generate MSSQL scripts" Language = "SQL" Convert = "Csconvert. config" >
<! -- Defines some constants. These constants are also referenced using $ key $. -->
< Defkeys >
< Key Name = "Author" > Faib </ Key >
</ Defkeys >
<! --
Define some external functions
Language: The Language type of the code file CSHARP | vbasic
File: code file
-->
< Functions >
< Function Name = "Columnsql" Language = "CSHARP" File = "Code \ sqlcolumn. cs"   />
</ Functions >
<! -- Structure: Parts \ part \ sections \ Section -->
<! -- Note the definition of the Call Sequence -->
< Parts >
< Part Name = "SQL" File = "Design \ create. SQL" Loop = "NONE" >
< Sections >
< Section Name = "Tablecreate" Loop = "Tables" >
< Sections >
< Section Name = "Columnarray" Loop = "Columns" Endchar = "," >
[$ Columnname $] $ getcolumnsql () $ </ Section >
< Section Name = "Columdescript" Loop = "Columns" >
<! [CDATA [ $ Addcolumndescription () $
Go
]>
</ Section >
< Section Name = "Primarycreate" Loop = "Primarykeys" >
<! [CDATA [ Alter table $ tablename $
Add constraint pK _ $ tablename $ _ $ columnname $ primary key ($ columnname $)
Go
]>
</ Section >
</ Sections >
< Body >
<! [CDATA [
Create Table [$ tablename $] ($ columnarray $
)
Go

$ Primarycreate $

-- Region add description
$ Addtabledescription () $
Go

$ Columdescript $
-- Endregion
]>
</ Body >
</ Section >
< Section Name = "Referencedelete" Loop = "Tables" >
< Sections >
< Section Name = "Referencedelete1" Loop = "Refobjects" >
<! [CDATA [ If exists (select 1
From sysobjects
Where id = object_id ('fk _ $ fktablename $ _ $ pktablename $ ')
And type = 'F ')
Alter table $ fktablename $
Drop constraint FK _ $ fktablename $ _ $ pktablename $
Go
]>
</ Section >
</ Sections >
< Body >
<! [CDATA [ $ Referencedelete1 $ ]>
</ Body >
</ Section >
< Section Name = "Referencecreate" Loop = "Tables" >
< Sections >
< Section Name = "Referencecreate1" Loop = "Refobjects" >
<! [CDATA [ Alter table $ fktablename $
Add constraint FK _ $ fktablename $ _ $ pktablename $ foreign key ($ fkcolumnname $)
References $ pktablename $ ($ pkcolumnname $)
Go
]>
</ Section >
</ Sections >
< Body >
<! [CDATA [ $ Referencecreate1 $ ]>
</ Body >
</ Section >
< Section Name = "Tabledelete" Loop = "Tables" >
<! [CDATA [
If exists (select 1
From sysobjects
Where id = object_id ('$ tablename $ ')
And type = 'U ')
Drop table [$ tablename $]
Go
]>
</ Section >
</ Sections >
< Body >
<! [CDATA [
-- ===================================================== ======================
-- This script is generated by the codebuilder tool.
-- Copyright: (c) faib studio 2009
--
-- Creator: $ author $
-- Creation Time: $ now $
-- ===================================================== ======================

-- Region
$ Referencedelete $
-- End region

-- Region: delete a table
$ Tabledelete $
-- End region

-- Region
$ Tablecreate $
-- End region

-- Region
$ Referencecreate $
-- End region
]>
</Body>
</Part>
</Parts>
</Config>

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.