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.

150 IN= LIBNAME Option 4 Chapter 10DetailsSeveral databases include data types that can be read-only, such as the data type of theMicrosoft SQL Server timestamp. Several databases also have properties that allowcertain data types to be read-only, such as the Microsoft SQL Server identity property.When IGNORE_READ_ONLY_COLUMNS=NO and a DBMS table contains a columnthat is read-only, an error is returned indicating that the data could not be modified <strong>for</strong>that column.ExampleFor the following example, a database that contains the table Products is createdwith two columns: ID and PRODUCT_NAME. The ID column is defined by a read-onlydata type and PRODUCT_NAME is a character column.CREATE TABLE products (id int IDENTITY PRIMARY KEY, product_name varchar(40))Assume you have a <strong>SAS</strong> data set that contains the name of your products, and youwould like to insert the data into the Products table:data work.products;id=1;product_name=’screwdriver’;output;id=2;product_name=’hammer’;output;id=3;product_name=’saw’;output;id=4;product_name=’shovel’;output;run;With IGNORE_READ_ONLY_COLUMNS=NO (the default), an error is returned bythe database because in this example the ID column cannot be updated. However, ifyou set the option to YES and execute a PROC APPEND, the append succeeds, and theSQL statement that is generated does not contain the ID column.libname x odbc uid=dbitest pwd=dbigrp1 dsn=lupinssignore_read_only_columns=yes;options sastrace=’,,,d’ sastraceloc=saslog nostsuffix;proc append base=x.PRODUCTS data=work.products;run;See AlsoTo apply this option to an individual data set, see the “IGNORE_READ_ONLY_COLUMNS= Data Set Option” on page 328.IN= LIBNAME OptionAllows specification of the database and tablespace in which you want to create a new table.

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

Saved successfully!

Ooh no, something went wrong!