jfarrera

How to change the table name in al query dinamically in a RDMBS interface  (for foxpro)

Discussion created by jfarrera on Feb 3, 2011
Latest reply on Feb 4, 2011 by Ahmad Fattahi

Hi,

 

 

 

I’m trying to extract data from a Fox pro database files, but this files have different names according the quarter of the year…., so I need to built a dynamic query to change the table(file) name depending of the current date.

 

 

 

I make some test using place holders in the  table name in the query, using like a place holder the value of an string type tag  (calculated) containing the table name , but the interface or the foxpro , I don’t know, take just the first character of the string, the same happens if I put the tables name In the tag descriptor and make the place holder to point to tag descriptor.

 

 

 

I feel that it is possible but I’m missing something in order to have the 8 characters  of tables names.

 

 

 

This is an example of the query

 

 

 

“Select * from _1001007  order by date_time asc;”

 

 

 

So

 

 

 

The  exdesc would be

 

 

 

/SQL=“Select * from ? order by date_time asc;” P1=’calculated string tag’/VL

 

 

 

The error that I have is

 

 

 

“The table _.dbf doesn’t exist”

 

 

 

I assume that interface or foxpro is taking just the first character of the place holder

 

 

 

 

 

Can you give some advice on this?

 

 

 

Regards,

Outcomes