Hello everyone,
I was wondering if it's possible in the Pythoncaller to check based on an user parameter (for example “database”) whether the database is avaibable in the user's database connections (FME Options > Database connections). I was looking at Connections — Python FME API FME 2026.1 b26103 documentation, but I don't really get wiser which functions to use.
Solved
Pythoncaller: how check if a oracle database connection is available
Best answer by david_r
Sure, do something like this:
import fmewebservices
connection_name = "My database connection name"
ncm = fmewebservices.FMENamedConnectionManager()
fme_conn = ncm.getNamedConnection(connection_name)
if fme_conn is None:
raise Exception(f"Connection '{connection_name}' not found")
connection_params = fme_conn.getNameValues()
print("User name:", connection_params.get("USER_NAME"))
print("Server:", connection_params.get("SERVER"))Up until line 9 will work for both database and web connections, thereafter it depends on the type of connection that was returned.
Notes:
connection_nameis case sensitive- the resulting
connection_paramsdict contents may differ depending on the connection type
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
Login to the community
No account yet? Create an account
An FME Account is required to contribute
LoginEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.


