SNF platform from SQL Server compatible with Oracle's approach and development

Source: Internet
Author: User
Tags generator

The need for the first few days is to have the SNF platform BS version of the Foundation program fully support the Oracle database.

Look at this is a big project, because everyone knows that SQL and Oracle syntax has a lot of different, such as top, date acquisition, type, special keywords such as SQL Server will use the dbo., [] No, automatic growth, paging query and so on. So to be compatible at design time should be handled.

That's when the SNF rapid development platform was designed, so it took us 3 days to create a tablespace, create a table-structure-guided data, build a sequence, and even upgrade the original C # connection to Oracle's DLL library, with no Oracle database in place. Table structure problems with the tool navicat-> data transmission function to help solve, transmission in the past there is a problem is the table name and field name plus the "" number, and then the first time the program was discovered problems, a unified export script to "remove the re-implementation problem." After the database upgrade we also need to adjust the program, fortunately, the framework compatibility and extensibility is better, the whole test found that 10~20 at the need to adjust, is full of hardships.

After adjusting the development under the SNF framework, the following points should be noted:

    1. If you need to write SQL, do not use the dbo., [] number,
    2. Also, do not use as as long as you add a space after the from table alias. Otherwise, Oracle is not compatible.
    3. Then there is the case for field and table names, SQL Server is case-insensitive, and in Oracle, all the table names and field names are capitalized. In order to make the BS Program page call convenient for most libraries when unified we did the translation processing.

The steps to develop a new program, such as our code generator, are as follows (referred to as the BS program):

    1. Creating tables in a SQL Server database can also be used with the self-increment primary key. Table and field to write the description.
    2. Use the Snf.codegenerator code generator to generate the corresponding single-table or multi-table entity, Service layer, page, and other code. Copy to the corresponding location of the project, if there are individual codes that may need to be adjusted.
    3. After putting the program menu on, run and add personalization features.
    4. Once the development is complete, the Oracle transfer begins.

A) using Navicat-> data transmission function to copy the table structure, and then navicat the table structure to remove the "" number, and then create a table structure. Also handle the corresponding default values.

b) If it is self-growing, you need to create a serial number with the serial number named "Seq_ table name". The generated code will be compatible.

c) There is also a need to add field translations to the Basetranslation table for translating Oracle uppercase and SQL Server Pascal case names. The DataTable is case insensitive without tubes. However, the page bound fields and JS values will be useful. In order to develop multi-database support at once we need to deal with.

Note: The post-translation page uses Pascal-sized and lowercase names. such as: Id, ParentID, Sortcode and so on.

The following SQL script that functions to retrieve all table fields and Pascal case and full-size write-field names. Put it on the translation table.

Insert into Basetranslation

SELECT distinct [name], Upper ([name]) from [syscolumns] where [id] in (

Select [id] from [sysobjects] where [type] = ' u '

)

Union

SELECT distinct [name], Upper ([name]) from WORKFLOWV30. Dbo. [syscolumns] where [id] in (

Select [ID] from workflowv30.dbo. [sysobjects] where [type] = ' u '

)

Union

SELECT distinct [name], Upper ([name]) from PROJECTV30. Dbo. [syscolumns] where [id] in (

Select [ID] from projectv30.dbo. [sysobjects] where [type] = ' u '

)

SELECT * FROM Basetranslation

One more Oracle Backup and restore scripts:

Exp System/[email PROTECTED]:1521/ORCL file=d:\snf_oracle.dmp;

Exp Platform/[email PROTECTED]:1521/ORCL file=d:\snf_oracle_platform.dmp;

Wang Chuntin 2015-11-23
Author Blog:http://www.cnblogs.com/spring_wang

If you feel good, please reprint.

The list of articles in this series is as follows:

A series of articles based on the Snf-rapid development Platform framework:

SNF Rapid Development Platform 3.2--. net extensible Document number generator-snf.coderule

SNF Rapid Development Platform 3.1--Audit flow (3) Low-key luxury, simple and uncommon, example demo-snf.workflow

SNF Rapid Development Platform 3.1--Audit flow (2) process design-snf.workflow function instruction

SNF Rapid Development Platform 3.1--Audit flow (1) SNF. Introduction to Workflow Audit flow

SNF Rapid Development Platform 3.0--Perfect code generator snf.codegenerator-Quick Developer's weapon

--spring.net.frameworkv3.0 General introduction of Web development framework based on Mvc4+easyui

SNF Rapid Development Platform 3.0--MVC Printing Solution

SNF Rapid Development Platform 3.0--File batch upload-Unified Attachment Manager-Online Preview file (with Internet and no two)

SNF Rapid Development Platform 3.0--asp.net MVC4 powerful export and bulk import without uploading files to excel

SNF Rapid Development Platform 3.0 MVC Universal Control Library show-asp.net+mvc4.0+webapi+easyui+knockout

SNF Rapid Development Platform 3.0 of the BS page show and nine advantages-part of the page display effect-asp.net+mvc4.0+webapi+easyui +knockout

SNF Rapid Development Platform 3.0-interface Personalization + 10 skins + 7 Menu-asp.net+mvc4.0+webapi+easyui+knockout

SNF Rapid Development Platform 3.0-cs page-asp.net+spring.net.framework

SNF Rapid Development Platform 3.0-the role of broadcasting in the system-quickly and concisely send the message to the receiver

SNF platform from SQL Server compatible with Oracle's approach and development

Related Article

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.