We are currently migrating our data extraction queries from our current sql program to PASW. It appears that PASW requires the use of apostrophes (“ “) on each factor within the sql statement (see below for an excerpt from the SPSS knowledge base on this issue). We have several complex sql statements that run multiple pages, inserting the apostrophes would be highly laborious and error prone.
Is there a way to use a macro or python to execute the sql statement as is (without the apostrophes on each factor) after the database connection is made?
David,
(from the SPSS knowledge base):
Using the wizard created syntax, delete everything after /SQL= . Then append your own SQL code. However, you will need to surround each line of SQL with apostrophes, as follows:
GET DATA /TYPE=ODBC /CONNECT=
'DSN=hqtechpdc;UID=SCOTT;PWD=#[''}"F,z-`'
/SQL =
'SELECT "T5"."DEPTNO" AS "DEPTNO", "T5"."DNAME" AS "DNAME", "T5"."LOC" '
'AS "LOC" FROM "SCOTT"."DEPT" "T5"'
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@... (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD