Hi,
I am trying to import data from a Microsoft Access data table that has a table name longer than 32 characters.
proc import out = work
datatable = "verylongtablenameherexxxx xxxxxxxxx"
dbms = access replace;
dbpwd = "xxxx";
database = "pathway to mdb";
run;
I get the following error message: ERROR: TABLE value exceeds maximum length of 32 characters.
Is there a way to get around this? I tried using the SQL pass through (which I have never used before) but that also presents an error.
proc sql;
connect to access(path="pathway to .mdb"
dbpwd = "xxxx");
create table work.test as
select * from connection to access
(select * from "verylongtablenameherexxxx xxxxxxxxx");
disconnect from access;
quit;
ERROR: Prepare: Syntax error in query. Incomplete query clause.
SQL statement: select * from "Live Booster Phone calls Information"
Any ideas would be greatly appreciated.
Thank you,
Robin
Pass Through should work. I think your query is wrong though you need to use Access SQL and indicate the book and table name? I think it needs to be in braces or there's some way that Access references tables with spaces in them.
This is the part SAS doesn't like right now:
select * from "verylongtablenameherexxxx xxxxxxxxx"
@robin2 wrote:
Hi,
I am trying to import data from a Microsoft Access data table that has a table name longer than 32 characters.
proc import out = work datatable = "verylongtablenameherexxxx xxxxxxxxx" dbms = access replace; dbpwd = "xxxx"; database = "pathway to mdb"; run;
I get the following error message: ERROR: TABLE value exceeds maximum length of 32 characters.
Is there a way to get around this? I tried using the SQL pass through (which I have never used before) but that also presents an error.
proc sql; connect to access(path="pathway to .mdb" dbpwd = "xxxx"); create table work.test as select * from connection to access (select * from "verylongtablenameherexxxx xxxxxxxxx"); disconnect from access; quit;
ERROR: Prepare: Syntax error in query. Incomplete query clause.
SQL statement: select * from "Live Booster Phone calls Information"Any ideas would be greatly appreciated.
Thank you,
Robin
Hi Reeza,
Thanks for the speedy reply. You were right - I needed to put the table name in square brackets. Now the pass through works!
Thanks so much,
Robin
proc sql;
connect to access(path="pathway to .mdb"
dbpwd = "xxxx");
create table work.test as
select * from connection to access
(select * from [verylongtablenameherexxxx xxxxxxxxx]);
disconnect from access;
quit;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.