Create Database using Python
I am trying to create a database using python. The example shows setting a Name string and a Properties object containing Directory=. ; Use class methods to create an instance %SYS>s Name="ABC" %SYS>s Properties("Directory")="c:\abc\" %SYS>s Status=##Class(Config.Databases).Create(Name,.Properties) %SYS>i '$$$ISOK(Status) w !,"Error="_$SYSTEM.Status.GetErrorText(Status)
How do I update and pass the Directory property using Python?
You can either
1. You can use object access from Python so this code can be invoked via Native API for Python:2. Use SQL via xDBC connection (CREATE DATABASE).
Eduard,
Thanks for the reply.
The challenge is that I cannot find a way to use the Python interface to pass a properties object to ClassMethodValue, and I don't see another appropriate function.
As I said use object access instead.I have written a code sample which can be used with Native API for Python(although the first part with directory creation should probably just be called from PYTHON as is if you're on a same machine).Locals are not supported by Native API for Python.