Skip to main content
Solved

Rename MS/SQL table names from MapInfo file names ?

  • February 20, 2018
  • 4 replies
  • 24 views

lifalin2016
Contributor
Forum|alt.badge.img+29

Hi,

I've been given a set of 20+ MapInfo tables, of which most have a period (.) in the file names.

I need to convert these tables into MS/SQL, but this presents a problem, since periods are no-go in MS/SQL, and I need to control the schema.

I'm trying to write using a dynamic writer, but I simply cannot figure out the combination of parameters, that'll allow me to replace the periods with underscores before writing into the database. No matter what I do, I loose the connection to the "schema", and nothing gets converted.

Please help me out. This ought to be a no-brainer, but I'm stumped.

Cheers.

Best answer by david_r

Create a copy of fme_feature_type (e.g. "fixed_fme_feature_type") in which you replace the period with something else.

On the output feature type, specify "fixed_fme_feature_type" as the table name and set "fme_feature_type" as the schema definition name.

View original
Did this help you find an answer to your question?

4 replies

david_r
Evangelist
  • Best Answer
  • February 20, 2018

Create a copy of fme_feature_type (e.g. "fixed_fme_feature_type") in which you replace the period with something else.

On the output feature type, specify "fixed_fme_feature_type" as the table name and set "fme_feature_type" as the schema definition name.


lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • February 21, 2018

I solved it in a different way.

I added a reader of schemas, and did a string replacement in its "fme_feature_type" attribute.

Then I did the same string replacement in the dynamic writer, and pointed its schema input to the schema reader output instead.

That seems to work, although I end up with a small and unwanted table "schema".

I'll try your suggestion for future implementations though. Thanks.

Cheers


lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • February 21, 2018
david_r wrote:

Create a copy of fme_feature_type (e.g. "fixed_fme_feature_type") in which you replace the period with something else.

On the output feature type, specify "fixed_fme_feature_type" as the table name and set "fme_feature_type" as the schema definition name.

Hi David,

 

It seems to work.

 

But can you explain to me, why <<specify "fixed_fme_feature_type" as the table name>> (i.e. to (a)Value(fixed_fme_feature_type) ) works, where as setting the table name to the expression (a)ReplaceString((a)Value(fme_feature_type),".","_") does not ?

 

 


david_r
Evangelist
  • February 21, 2018
lifalin2016 wrote:
Hi David,

 

It seems to work.

 

But can you explain to me, why <<specify "fixed_fme_feature_type" as the table name>> (i.e. to (a)Value(fixed_fme_feature_type) ) works, where as setting the table name to the expression (a)ReplaceString((a)Value(fme_feature_type),".","_") does not ?

 

 

That's an excellent question, unfortunately I have no idea why it doesn't work :-)

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings