Skip to main content
Question

Problem with using a parameter for a PostGIS table name in a windows batch file


Forum|alt.badge.img

I would like to use a user parameter to create the name of a PostGIS table.

 

I have created the parameter (named Vn_PostGIS), and I have added it to the writer - in my example the table name is added to the writer as:

table_$(Vn_PostGIS)_polys

I can run the workspace within FME GUI and add the parameter name in the Translation Parameter Values dialog, and it works fine. If however I run it from a windows batch file, it ignores the parameter value in the table name, and tries to create a table named

table__polys

 

I am passing the parameter in the batch file using --VnPostGIS vn2.

 

I also pass the filename of the file to be read, and that works fine. I can see from the log file that FME has taken the value of the parameter on the line "FME Configuration: Command line arguments are". It states that the value is the same as I have in my bat file. However when it gets to checking for the exisitence of the table, it fails as it drops the value of my parameter, so the table name is wrong.

 

Any ideas of what I am doing wrong

 

 

6 replies

Forum|alt.badge.img

forgot to add, using FME 2019.1.2.0 build 19630 WIN64


itay
Supporter
Forum|alt.badge.img+16
  • Supporter
  • October 4, 2019

Hi @jamesstott1,

Try adding quotes to the parameter value in the batch : --tablename "MyTable" and make sure you have one line:

"C:\Program Files\FME20191\fme.exe" C:\temp\none2postgres.fmw --tablename "MyTable"

0684Q00000ArJg1QAF.png


Forum|alt.badge.img
itay wrote:

Hi @jamesstott1,

Try adding quotes to the parameter value in the batch : --tablename "MyTable" and make sure you have one line:

"C:\Program Files\FME20191\fme.exe" C:\temp\none2postgres.fmw --tablename "MyTable"

0684Q00000ArJg1QAF.png

Thanks for the response. 

I have tried with and without quotes on both the parameter name and the parameter value and it doesnt work either way.


itay
Supporter
Forum|alt.badge.img+16
  • Supporter
  • October 4, 2019
jamesstott1 wrote:

Thanks for the response.

I have tried with and without quotes on both the parameter name and the parameter value and it doesnt work either way.

How does your bat file look like? Can you share it?


Forum|alt.badge.img

OK, this can be filed under "add a question on a forum and find out that its your fault and not the software" . I didnt have the same name for the parameter in both FME and the batch file :( Sorry for the noise. Would seem that the weekend is much needed...


itay
Supporter
Forum|alt.badge.img+16
  • Supporter
  • October 4, 2019
jamesstott1 wrote:

OK, this can be filed under "add a question on a forum and find out that its your fault and not the software" . I didnt have the same name for the parameter in both FME and the batch file :( Sorry for the noise. Would seem that the weekend is much needed...

Happens to us all...have a nice one (weekend)


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