This section describes choices you must make when creating or rebuilding a database.
Here are the steps you need to take to create a Transact-SQL-compatible database. The remainder of the section describes which options you need to set.
Start Sybase Central.
Choose Tools » SQL Anywhere 11 » Create Database.
Follow the instructions in the wizard.
When you see the button, Emulate Adaptive Server Enterprise, click it and then click Next.
Follow the remaining instructions in the wizard.
Run the following dbinit command:
dbinit -b -c -k db-name.db |
For more information about these options, see Initialization utility (dbinit).
Connect to any SQL Anywhere database.
Enter the following statement, for example, in Interactive SQL:
CREATE DATABASE 'dbname.db' ASE COMPATIBLE CASE RESPECT BLANK PADDING ON; |
In this statement, ASE COMPATIBLE means compatible with Adaptive Server Enterprise. It prevents the SYS.SYSCOLUMNS and SYS.SYSINDEXES views from being created.
By default, string comparisons in Adaptive Server Enterprise databases are case sensitive, while those in SQL Anywhere are case insensitive.
When building an Adaptive Server Enterprise-compatible database using SQL Anywhere, choose the case sensitive option.
If you are using Sybase Central, this option is in the Create Database Wizard.
If you are using the dbinit utility, specify the -c option.
When building an Adaptive Server Enterprise-compatible database using SQL Anywhere, choose the option to ignore trailing blanks in comparisons.
If you are using Sybase Central, this option is in the Create Database Wizard.
If you are using the dbinit utility, specify the -b option.
When you choose this option, Adaptive Server Enterprise and SQL Anywhere considers the following two strings equal:
'ignore the trailing blanks ' 'ignore the trailing blanks' |
If you do not choose this option, SQL Anywhere considers the two strings above different.
A side effect of choosing this option is that strings are padded with blanks when fetched by a client application.
Older versions of SQL Anywhere employed two system views whose names conflict with the Adaptive Server Enterprise system views provided for compatibility. These views include SYSCOLUMNS and SYSINDEXES. If you are using Open Client or JDBC interfaces, create your database excluding these views. You can do this with the dbinit -k option.
If you do not use this option when creating your database, executing the statement SELECT * FROM SYSCOLUMNS;
results in the error, Table name 'SYSCOLUMNS' is ambiguous
.
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |