czchlong
czchlong

Reputation: 2584

How to export custom data types from one Sybase DB and import to another?

There are several hundred custom data types in a source Sybase DB need to be in a new, freshly created destination Sybase DB.

Through some fidgeting, I was able to create a script to extract and add all the custom data types from the source DB into the destination DB. However, I keep getting the following error:

Number (257) Severity (16) State (1) Server (ASED052) Implicit conversion from datatype 'NUMERIC' to 'VARCHAR' is not allowed. Use the CONVERT function to run this query.

I checked and double checked that all the types matched (though types of CHAR in source is made to be VARCHAR in destination, I think this is an OKAY implicit conversion?)

Is there a way to create a script that would allow me to export all custom data types from the source DB and import them into a destination DB such that the types will match and there will be no conversion issues?

Upvotes: 0

Views: 504

Answers (1)

Mike Gardner
Mike Gardner

Reputation: 6651

Look into the ddlgen utility included with sybase, ususally found in the Sybase Central directory, or the $SYBASE/ASEP/bin. The syntax may vary slightly between Sybase versions, but you should be able to generate scripts to create all of the database objects including user-defined datatypes (UDD), indexes, stored procedures, etc.

If you only want the user-defined datatypes, look into the "-T" flag, which allows you to select specific object types.

Upvotes: 1

Related Questions