BookmarkSubscribeRSS Feed
robin2
Calcite | Level 5

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

2 REPLIES 2
Reeza
Super User

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


 

robin2
Calcite | Level 5

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;

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 802 views
  • 4 likes
  • 2 in conversation