The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

RE: xQL Edits - DB.xql


  • Subject: RE: xQL Edits - DB.xql
  • From: "Tony Tofts" <tony@xxxxxxxxxx>
  • Date: Sat, 26 Feb 2005 06:46:45 -0000


Hi Neil,

> Just tried editing SQL with a determinator and that works...

It's odd you should have problems, as OLE DB should be consistent.

> One thing I did notice in the monitor is that the determinator uses
> sqlid=51 whereas the meteor script uses sqlid=1 don't know if
> that's significant but will try and amend and see...

There are 2 types of sqlid,

1 to 50 means it is user specified in the message. Use this for complex
multi-command (multi-xpl messages) functions.

51 to 256 are one-shot. You specify a sqlid of 0 (or don't specify at all)
and xql assigns a sqlid automatically but it is only used for the 1 xpl
command.

It's slightly more complicated than that in reality, the code below
controls
it:

Regards
Tony

strMsg = ""
strCommand = e.XplMsg.GetParam(1, "command").ToUpper.Trim
SQLID = Val(e.XplMsg.GetParam(1, "sqlid"))
strSQL = e.XplMsg.GetParam(1, "sql").Trim
IsOneShot = False
If strSQL <> "" And SQLID = 0 Then IsOneShot = True
If SQLID >= 0 And SQLID <= 256 Then
Select Case strCommand
Case "LOOKUP"
If strSQL <> "" Then strMsg = LookupSQL(strSQL)
Case "OPEN"
If strSQL <> "" Then strMsg = OpenSQL(strSQL, SQLID)
Case "CLOSE"
If SQLID <> 0 Then Call CloseSQL(SQLID)
Case "COUNT"
If SQLID > 50 Then strMsg = CountSQL(SQLID)
Case "MOVE"
If SQLID > 50 Then strMsg = MoveSQL(SQLID,
e.XplMsg.GetParam(1, "how").ToUpper.Trim)
Case "ADD"
If IsOneShot Then SQLID = OneShotSQL(strSQL)
If SQLID <> 0 Then strMsg = AddSQL(SQLID, e.XplMsg)
If IsOneShot And SQLID <> 0 Then Call CloseSQL(SQLID)
Case "EDIT"
If IsOneShot Then SQLID = OneShotSQL(strSQL)
If SQLID <> 0 Then strMsg = EditSQL(SQLID, e.XplMsg)
If IsOneShot And SQLID <> 0 Then Call CloseSQL(SQLID)
Case "FIND"
If IsOneShot Then SQLID = OneShotSQL(strSQL)
If SQLID > 50 Then strMsg = FindSQL(SQLID,
e.XplMsg.GetParam(1, "how").ToUpper.Trim, e.XplMsg.GetParam(1,
"where"))
If IsOneShot And SQLID <> 0 Then Call CloseSQL(SQLID)
Case "DELETE"
If SQLID > 50 Then strMsg = DeleteSQL(SQLID)
Case "ADJUST"
If strSQL <> "" Then strMsg = AdjustSQL(strSQL,
e.XplMsg)
End Select
End If

' generate response
If strMsg <> "" Then
' send response
strTag = e.XplMsg.GetParam(1, "tag")
If strTag <> "" Then strMsg = strMsg + "TAG="
& strTag & Chr(10)
Call xPLListen.SendMessage("xpl-stat", e.XplMsg.GetParam(0,
"source"), e.XplMsg.XPL_Msg(1).Section, strMsg)
End If



xPL Links: http://www.xplproject.org.uk http://www.xplhal.com http://www.xpl.myby.co.uk
To Post a Message: ukha_xpl@xxxxxxx
To Subscribe:  ukha_xpl-subscribe@xxxxxxx
To Unsubscribe:  ukha_xpl-unsubscribe@xxxxxxx

xPL Main Index | xPL Thread Index | xPL Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.