Sybase database when migrating to Sql script changes

Removed after the cascade constraints drop statement
For example: drop table tbl1 cascade constraints;

Read: drop table tbl1;

Remove the semicolon between statements
Sybase Sql statement does not allow to end with a semicolon. For example:

Long integer by the number (19) to numeric (19,0); varchar2 to varchar
Serial number used in the primary key with identity tags, and the field of data type can only scale 0 numeric. When a foreign key of a table, the field types to the same example:

Short integer primary key: q_id numeric (5,0) identity not null,

Integer primary key: w_id numeric (10,0) identity not null,

Long integer primary key: e_id numeric (19,0) identity not null,

Must show whether the null field
Allow for empty fields must write null, otherwise the default of the field is not empty.

For example: w_type VARCHAR (40) default -1 null,

INSERT statements for all table names and field names are all built the table by writing the name, case sensitive. Do not give marks for the identity of the primary key assignment, sybase will automatically start from an order by a

Modify hbm
Hbm file has a schema = "public", change the schema = "user name"

Modify the sql statement java
1) top10 statement

In oracle you can use:

select * from (select * from tble order by tt_id desc) where rownum <= 10

Id get tble table top 10 records

In sybase the change:

set rowcount 10 select * from tble order by model_id desc

2) the rounding function

Trunc by the round (to return to the specified number of rounds after a given number of decimal places from the value) alternative. Reference the following information:

3)

Are:

1. On the issue since the growth of id, if you need to manually insert the part of the initial data, it should be set on the first identiy_insert

set insert_identity tblname on

And a session can only be set on a table, if there are multiple tables, have to fall off the current, then open the other.

2. Sybase command terminator is a go, so a number of statements in one go after the best plus

3. Use SET ROWCOUNT (similar to the top 10) of the attention, this command take effect immediately and affect the current session, that is, a session with the SET ROWCOUNT affects all queries, the solution: in which statement added SET ROWCOUNT 0 remove this restriction

SET ROWCOUNT 10

select * from fnms_param_infor

SET ROWCOUNT 0

4. Adjust the character set

(1) character set the server to adjust all of the Server requirements nocase the utf8, please click the following manner:
Among the options in the config server language> default character / sort and then save and restart the service. May not be successful, but reboot the machine on it.
(2) to adjust the client character set the client character to cp936
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Sybase database when migrating to Sql script changes

  • Hibernate configuration parameter table

    # # Auto schema export # hibernate.hbm2ddl.auto create-drop # hibernate.hbm2ddl.auto create # hibernate.hbm2ddl.auto update # hibernate.hbm2ddl.auto validate The first is to create a table in the delete the original data, we can insert data, delete p ...

  • Hibernate II Study Notes

    11. Many-to-many Of many that can be converted to two one-to-many <set name="students" table="teacher_student"> <key column="techer_id"/> <many-to-many column="student_id"/> </set> many-to-many data only from one end of the mainten

  • org.hibernate.MappingException: Unknown entity error

    Today, a new table, with a good mapping file, pojo, as well as the dao service Finally, insert the records, reported org.hibernate.MappingException: Unknown entity error. Initially suspected to be of no property and table field names correspond to double-

  • How the primary key agent-hibernate

    Existing Table A, B Statement: A, B field id-based keys. A: [id, name] B: [id, Aid, title] B and A's set up a many-to-one relationship because of A, B two tables are the primary key id field so add B when Hibernate will automatically retrieve id ...

  • Hibernate primary key strategy-sequence

    Today, the use of hibernate in the company encountered a troublesome problem, the use of hibernate when the primary key generation strategy set sequence, but always reported in the implementation could not get next sequence value of the error, then o ...

  • Memo hibernate problem

    hibernate using myeclipse automatically generated HBM mapping file will be schema ="***" catalog ="***" Separately are the database instance name and database name, but in fact has been stated jdbc url connection database, are the ...

  • Spring + Hibernate to use Glassfish Database Connection Pool

    applicationContext.xml file content <? xml version = "1.0" encoding = "UTF-8"?> <beans xmlns = " http://www.springframework.org/schema/beans " xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance " ...

  • Spring2.0 + hibernate3.1 + log4j + mysql demo

    applicationContext.xml Non-attachment jar package, necessary friends can send an email to todd.liangt @ gmail.com

  • Hibernate annotation using notebook

    These are the basic common @Entity --Declared an entity bean @Table(name="promotion_info") --For the entity bean mapping for the specified table (Table name ="promotion_info) @Id --Declare that the identifying attribute of the entity bean @GeneratedValue

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries