Development status:
New development
Information status: Updated
Repository:
http://svn.code.sf.net/p/tango-ds/code/DeviceClasses/Communication/SQLServer
Contact:
Class Description
- Device Server for SQLServer Database Access
- This device requires Fandango module to be available in the PYTHONPATH.
Families: Communication
Key words:
Language: Python
Contact:
Class interface
Attributes:
Name | Description |
---|---|
LastUpdateScalar: DevString | — |
Commands:
Name | Description |
---|---|
StateInput: DevVoid Output: State |
This command gets the device state (stored in its device_state data member) and returns it to the caller. |
StatusInput: DevVoid Output: DevString |
This command gets the device status (stored in its device_status data member) and returns it to the caller. |
QueryInput: DevString Output: DevVarStringArray |
None. |
Pipes:
Properties:
Name | Description |
---|---|
HostDevString | SQLServer host |
DataBaseDevString | SQL database |
DBTypeDevString | SQLServer or MySQL |
PortDevString | SQLServer port |
UserDevString | — |
PasswordDevString | — |
UseLocalTimeDevBoolean | — |
Please log in to comment.
Generated
README
b'=======================\nSQLServer Device Server\n=======================\n\nDescription\n-----------\n\nDevice Server for SQLServer Database Access\n\nDeveloped at ALBA by Sergi Rubio: http://www.tango-controls.org/Members/srubio\nThis device server requires fandango: http://www.tango-controls.org/Documents/tools/fandango\nIt is based on DynamicAttributes: http://www.tango-controls.org/howtos/dynamicattributes\n\n\nUsage\n-----\n\nTo use the device you must initialize the following properties: \n\n Host, Port, DataBase, User, Password\n\n\nThen, you can use the device directly executing the Query() command:\n\n value1 = PyTango.DeviceProxy(\'my/sql/server\').Query("select TOP 1 value from db.table1 where name in (\'value1\') order by ts DESC")</pre>\n\n\nOr create a DynamicAttributes property that read attribute values from the database using the QUERY keyword:\n\n Value1=QUERY("select TOP 1 value from db.table1 where name in (\'value1\') order by ts DESC")[0][0]\n\n\nYou can define intermediate variables to have shorter syntax or string substitution:\n\n QLAST=str("select TOP 1 value from db.table1 where name in (\'%s\') order by ts DESC")\n Value1=QUERY(str(QLAST)%\'Value1\')[0][0]</pre>\n\n\nThe T_ATTR keyword allows to set both timestamp and value for the attribute from a time,value row:\n\n Value1=DevDouble(T_ATTR(QUERY("select TOP 1 ts,value from db.table1 where name in (\'value1\') order by ts DESC")[0]))\n'