13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

320 DBTYPE= Data Set Option 4 Chapter 11SyntaxDBTYPE=(column-name-1=DBMS-type)Syntax Descriptioncolumn-namespecifies a DBMS column name.DBMS-typespecifies a DBMS data type. See the documentation <strong>for</strong> your <strong>SAS</strong>/<strong>ACCESS</strong> interface<strong>for</strong> the default data types <strong>for</strong> your DBMS.DetailsBy default, the <strong>SAS</strong>/<strong>ACCESS</strong> interface <strong>for</strong> your DBMS converts each <strong>SAS</strong> data type to apredetermined DBMS data type when it outputs data to your DBMS. When you need adifferent data type, use DBTYPE= to override the default data type chosen by the<strong>SAS</strong>/<strong>ACCESS</strong> engine.You can also use this option to specify column modifiers. The allowable syntax <strong>for</strong>these modifiers is generally DBMS-specific. For more in<strong>for</strong>mation, see the SQLreference <strong>for</strong> your database.MySQL: All text strings are passed as is to the MySQL server. MySQL truncates textstrings to fit the maximum length of the field without generating an error message.Teradata: In Teradata, you can use DBTYPE= to specify data attributes <strong>for</strong> a column.See your Teradata CREATE TABLE documentation <strong>for</strong> in<strong>for</strong>mation about the data typeattributes that you can specify. If you specify DBNULL=NO <strong>for</strong> a column, do not alsouse DBTYPE= to specify NOT NULL <strong>for</strong> that column. If you do, ’NOT NULL’ is insertedtwice in the column definition. This causes Teradata to generate an error message.ExamplesIn this example, DBTYPE= specifies the data types to use when you create columnsin the DBMS table.data mydblib.newdept(dbtype=(deptno=’number(10,2)’ city=’char(25)’));set mydblib.dept;run;This next example creates a new Teradata table, NEWDEPT, specifying the Teradatadata types <strong>for</strong> the DEPTNO and CITY columns.data mydblib.newdept(dbtype=(deptno=’byteint’ city=’char(25)’));set dept;run;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!