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


