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.png

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

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