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 Metoer SQL


  • Subject: RE: xQL Metoer SQL
  • From: "Neil Frost" <neil@xxxxxxxxxxxxx>
  • Date: Mon, 28 Feb 2005 14:48:26 -0000


A couple of questions on this script re-write....

As I am creating globals with the same names for both incoming calls and
outgoing calls, my xQL calls for both are identical.
The globals i am creating are:

Call_Type
Call_Start
Call_ID
Call_Complete

so my xql looks like this:
strmsg="Command=OPEN" & chr(10)
strmsg=strmsg+"SQLID=1" & chr(10)
strmsg=strmsg+"SQL=SELECT * FROM '"Telephone Calls"'"
& chr(10)
call
xpl.sendmsg("","TONYT-XQL.MASTER","DB.XQL",strmsg)

strmsg="Command=ADD" & chr(10)
strmsg=strmsg+"SQLID=1" & chr(10)
strmsg=strmsg+"Type=" & sys.value("Call_Type")
& chr(10)
strmsg=strmsg+"CALL=" & sys.value("Call_Start")
& chr(10)
strmsg=strmsg+"CID=" & sys.value("Call_ID") &
chr(10)
strmsg=strmsg+"COMPLETE=" sys.value("Call_Complete")
& chr(10)
call
xpl.sendmsg("","TONYT-XQL.MASTER","DB.XQL",strmsg)

and so is the same for both incoming and outgoing.

Can I move that out into a sub and then call that? if so how? would it be a
case of:

call sub_writesql()

with

sub_writesql()
strmsg="Command=OPEN" & chr(10)
strmsg=strmsg+"SQLID=1" & chr(10)
strmsg=strmsg+"SQL=SELECT * FROM '"Telephone Calls"'"
& chr(10)
call
xpl.sendmsg("","TONYT-XQL.MASTER","DB.XQL",strmsg)

strmsg="Command=ADD" & chr(10)
strmsg=strmsg+"SQLID=1" & chr(10)
strmsg=strmsg+"Type=" & sys.value("Call_Type")
& chr(10)
strmsg=strmsg+"CALL=" & sys.value("Call_Start")
& chr(10)
strmsg=strmsg+"CID=" & sys.value("Call_ID") &
chr(10)
strmsg=strmsg+"COMPLETE=" sys.value("Call_Complete")
& chr(10)
call
xpl.sendmsg("","TONYT-XQL.MASTER","DB.XQL",strmsg)
end sub

ALSO

to reomve the [] around the table name, does my line look like this now?

strmsg=strmsg+"SQL=SELECT * FROM '"Telephone Calls"'"
& chr(10)

instead of

strmsg=strmsg+"SQL=SELECT * FROM [Telephone Calls]" & chr(10)

Thanks
Neil

________________________________

From: steve.cooper@xxxxxxx [mailto:steve.cooper@xxxxxxx]
Sent: Mon 28/02/2005 12:13
To: ukha_xpl@xxxxxxx
Subject: RE: [ukha_xpl] xQL Metoer SQL





The one thing I would check is the date and time inputs.  SQL can be very
particular about it's datetime formats.  For the time being try

strmsg=strmsg+"call="+ cstr(NOW()) + chr(10)

That will elimate this from the problem.

S.



"Tony Tofts"
<tony@xplhal.        To:     <ukha_xpl@xxxxxxx>
com>                 cc:
Subject:     RE: [ukha_xpl] xQL Metoer SQL
28/02/2005
11:30
Please
respond to
ukha_xpl






> Trouble is I'm having trouble with the script... Could
> someone have a look at the Complete Case below and tell me if
> it makes sense... It opens the record on the monitor but thats it....

Generally looks ok

Do all 3 messages get sent by the script ok?

I tend to use " & " rather than "+" in the string
building

Also the use of [] causes problems in mysql, maybe in sql too?

Regards
Tony



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.