Skip to main content
Question

Python module cx_oracle

  • February 17, 2015
  • 8 replies
  • 62 views

I have a python script which uses cx_oracle. It works fine on desktop but when I publish it to fme server, gives me an error. Reason being no cx_Oralce module on server.

 

 

I don't have access to fme server linux box. I came to know from fme documentation that you can upload module as a resource. Which file should I upload as a resource? Is it cx_Oracle.so or some other.

 

 

Cheers

 

John

8 replies

david_r
Celebrity
  • February 17, 2015
Hi,

 

 

unless you're already on FME Server 2015, I think you'll have to install the modules "the old fashioned way". If I'm not mistaken, modules as resources was introduced in FME 2015.0

 

 

More info here: http://fmepedia.safe.com/articles/How_To/Python-on-FME-Server

 

 

David

  • Author
  • February 17, 2015
Same article says for FME 2014 & Previous "If you do not have access to the FME Server install directory on the server, you can upload the module to the server using the following procedure:?Publish the workspace to the server. Make sure you select the module file as a resource file to upload to the server when publishing"

david_r
Celebrity
  • February 17, 2015
I suspect installing cx_Oracle on Linux might be a bit more involved than just uploading a couple of files...

 

 

Some info here: http://stackoverflow.com/questions/4307479/install-cx-oracle-for-python

 

 

Unless somebody else can chime in here with specific details I recommend contacting Safe support.

 

 

But rather than using cx_Oracle, why not use fmeobjects.FMEUniversalReader/Writer?

 

 

David

  • Author
  • February 17, 2015
I am trying to read list of tables from Oracle as suggested here (example 2)

 

 

http://fmepedia.safe.com/articles/How_To/Pass-a-List-of-Tables-or-Layers-to-an-FME-Reader-using-Python-Scripted-Parameters#heading_toc_j_5

 

 

Is there any better way?

david_r
Celebrity
  • February 17, 2015
Personally, I'd recommend example 3 on that page. That way you won't need cx_Oracle or any other customizations on the Server.

 

 

David

  • Author
  • February 17, 2015
But I am not able to read Oracle table using Schema(Any format). Any idea how to read?

david_r
Celebrity
  • February 17, 2015
You need to add an Oracle reader as a workspace resource, where you specify the connection details: http://docs.safe.com/fme/html/FME_Workbench/FME_Workbench.htm#Workbench/reader_adding_as_resource.htm

 

 

You then tell the "Schema (any format)" reader to use this resource for the connection. Just tested on my machine and it works as advertised.

 

 

David

  • Author
  • February 18, 2015
I am trying convert list of table in oracle spatial to any spatial format.

 

 

Say I have to convert 3 tables A,B,C. I have another table, LIST which has list of table I want to convert in this case A,B,C. Using the python script I was able to converts all tables mentioned in the table LIST.

 

 

But now I am not able to convert with the schema reader.

 

 

Could you please explain further.

 

 

Cheers.

 

 

 

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