Created
November 27, 2012 01:14
-
-
Save Benjit87/4151759 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Assign the library named SAMPLE to the ODBC data source * | |
* the library sample will contain the tables of the database */ | |
LIBNAME SAMPLE ODBC DATASRC=mysqlData; | |
/* Use SQL query to create a dataset in Work.Sample * | |
* using sample1 table from the SAMPLE library which is defined as * | |
* the ODBC datasource */ | |
PROC SQL outobs=10; *Limit output to 10 only; | |
CREATE TABLE Work.Sample AS | |
SELECT t1.Id, | |
t1.POBOX, | |
t1.Name, | |
t1.Country | |
FROM SAMPLE.sample1 t1; | |
QUIT; | |
/* Alternative is to use SQL Passthrough */ | |
PROC SQL; | |
CONNECT TO ODBC as con1 | |
( user="benji" pw="XXXXXX" datasrc="mysqlData"); | |
SELECT * | |
FROM CONNECTION TO con1 ( | |
SELECT * | |
FROM sample1); | |
DISCONNECT FROM con1; | |
QUIT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment