Author |
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: December 11 2007 at 21:50 | IP Logged
|
|
|
This is what happened when I import. Did I miss something?...
[Sybase][ODBC Driver][Adaptive Server Anywhere]Syntax error or access violation: near ';' in ..., 0))', 0, '')[;] ...
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
jeffw_00 Super User
Joined: June 30 2007
Online Status: Offline Posts: 929
|
Posted: December 11 2007 at 21:52 | IP Logged
|
|
|
I would copy/paste it into the multi-editor window and then eyeball it for extraneous characters, <CR>s, or spaces
/j
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: December 11 2007 at 22:11 | IP Logged
|
|
|
OK, I give so... I was on the beach too long tonight.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
mustangcoupe Super User
Joined: August 08 2003 Location: United States
Online Status: Offline Posts: 308
|
Posted: December 11 2007 at 22:18 | IP Logged
|
|
|
try this.... there was alot of extra spaces also my direct import choked with the .sql on the insert into ...
Code:
INSERT INTO macrodetail VALUES ('SEND_INSTEON',1,38,'',0,'if([LOCAL2] = 0, ph_insteon( "[LOCAL1]", ifastoff, 0), ph_insteon( "[LOCAL1]", ifaston, 0))', 0, '');
INSERT INTO macrodetail VALUES ('SEND_INSTEON',2,31,'',NULL,'5', 0, '');
INSERT INTO macrodetail VALUES ('SEND_INSTEON',3,16,'',NULL,'if(ph_getinsteonstat("[LOCAL1]") = ph_addtovar(1,2,1),999,1)', 0, '');
INSERT INTO macrodetail VALUES ('SEND_INSTEON',4,38,'',0,'if([LOCAL2] = 0, ph_insteon( "[LOCAL1]", ifastoff, 0), ph_insteon( "[LOCAL1]", ifaston, 0))', 0, '');
INSERT INTO macrodetail VALUES ('SEND_INSTEON',5,16,'',NULL,'if((ph_getvar_n(1,3)) = 1,4,1)', 0, '');
INSERT INTO macrodetail VALUES ('SEND_INSTEON',6,16,'',NULL,'if(ph_getinsteonstat("[LOCAL1]") = ph_addtovar(1,2,1),999,1)', 0, '');
INSERT INTO macrodetail VALUES ('SEND_INSTEON',7,31,'',NULL,'60', 0, '');
INSERT INTO macrodetail VALUES ('SEND_INSTEON',8,38,'',0,'if([LOCAL2] = 0, ph_insteon( "[LOCAL1]", ifastoff, 0), ph_insteon( "[LOCAL1]", ifaston, 0))', 0, '');
INSERT INTO macrodetail VALUES ('SEND_INSTEON',9,31,'',NULL,'5', 0, '');
INSERT INTO macrodetail VALUES ('SEND_INSTEON',10,16,'',NULL,'if(ph_getinsteonstat("[LOCAL1]") = ph_addtovar(1,2,1),999,1)', 0, '');
INSERT INTO macrodetail VALUES ('SEND_INSTEON',11,38,'',0,'ph_addtoglobal("IERROR",1)', 0, '');
|
|
|
__________________ Todd Hannemann
HA newbie
PowerHome - UPB - ELK
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: December 11 2007 at 22:36 | IP Logged
|
|
|
Thks.. That got it.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
jeffw_00 Super User
Joined: June 30 2007
Online Status: Offline Posts: 929
|
Posted: December 12 2007 at 00:24 | IP Logged
|
|
|
Cool - except I noticed tonight it has a bug! Can you find it?
try this instead 8-}
/j
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 1, 36, '', NULL, '"CALLED WITH: " + ph_getvar_s(1,1) + " | " + ph_getvar_n(1,2) + " | " + ph_getvar_n(1,3) ', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 2, 16, '', NULL, 'if(ph_getinsteonstat("[LOCAL1]") = (ph_getvar_n(1,2)+1),999,1)', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 3, 38, '', 0, 'if([LOCAL2] = 0, ph_insteon( "[LOCAL1]", ifastoff, 0), ph_insteon( "[LOCAL1]", ifaston, 0))', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 4, 31, '', NULL, '5', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 5, 16, '', NULL, 'if(ph_getinsteonstat("[LOCAL1]") = (ph_getvar_n(1,2)+1),999,1)', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 6, 36, '', NULL, '"INSTEON RETRY: " + ph_getvar_s(1,1) + " | " + ph_getvar_n(1,2) + " | " + ph_getvar_n(1,3)', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 7, 38, '', 0, 'if([LOCAL2] = 0, ph_insteon( "[LOCAL1]", ifastoff, 0), ph_insteon( "[LOCAL1]", ifaston, 0))', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 8, 31, '', NULL, '5', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 9, 16, '', NULL, 'if(ph_getinsteonstat("[LOCAL1]") = (ph_getvar_n(1,2)+1),999,1)', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 10, 16, '', NULL, 'if((ph_getvar_n(1,3)) = 1,999,1)', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 11, 31, '', NULL, '60', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 12, 16, '', NULL, 'if(ph_getinsteonstat("[LOCAL1]") = (ph_getvar_n(1,2)+1),999,1)', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 13, 36, '', NULL, '"INSTEON RETRY: " + ph_getvar_s(1,1) + " | " + ph_getvar_n(1,2) + " | " + ph_getvar_n(1,3)', 0, '');
INSERT INTO macrodetail VALUES ( 'SEND_INSTEON', 14, 38, '', 0, 'if([LOCAL2] = 0, ph_insteon( "[LOCAL1]", ifastoff, 0), ph_insteon( "[LOCAL1]", ifaston, 0))', 0, '');
Edited by jeffw_00 - December 12 2007 at 00:27
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: December 12 2007 at 09:33 | IP Logged
|
|
|
OK, I’ve got a mystery. After importing the “SEND_INSTEON” macro I can not find it. If I do a Database Search Report it shows up. I still can’t find it in PH explorer. This is the 2nd macro I’ve seen this happen to. Any thoughts??
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 12 2007 at 10:28 | IP Logged
|
|
|
It's because the export data is not complete. If you look at the posted SQL, there are only macrodetail statements and there needs to also be a macroheader statement.
Since the PowerHome Explorer is working top-down, a macro consists of a single record in the macroheader table with 1 or more macrodetail records. If you insert just the macrodetail records, the PowerHome Explorer won't display them because there isnt a macroheader statement.
To fix, you could get the appropriate macroheader SQL and import it, or you can just go to the Explorer and create a new macro with the same name ("SEND_INSTEON" in this case). As soon as you click to view the macro detail, you'll see all of the macrodetail records that were inserted.
Not sure why the macroheader SQL wasnt posted. It's possible Ive got a bug and it's not being generated, or it may be a copy and paste error, or it may be the method being used to create the SQL.
HTH,
Dave.
|
Back to Top |
|
|
jeffw_00 Super User
Joined: June 30 2007
Online Status: Offline Posts: 929
|
Posted: December 12 2007 at 10:39 | IP Logged
|
|
|
sorry - I'm still learning how to post this stuff. It was late last night and I wanted to flag the bug (did anyone figure it out? It's really nefarious).
Sometime in the next couple of days I will add comments and re-post. What I'm doing, Dave, is
1) select * from macrodetail
2) export to SQL file
3) I have a perl script that 'flattens' the SQL file (converts to one line per statement, and sorts it).
4) copy/paste the lines that start with SEND_INSTEON.
clearly I also have to copy/paste the top line of the file. Will do so.
BTW: if there's an easy way to select just the macro that would be cool too.
/j
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: December 12 2007 at 10:41 | IP Logged
|
|
|
OK Dave, what are you doing when you’re not playing genius? That fix it. Interesting, I did not observe an error when I executed the script although there may have been one and I didn’t recognize it.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 12 2007 at 11:53 | IP Logged
|
|
|
Jeff,
I suspected that may have been the way you were exporting (and it will work ), it's just bringing the detail rows though and you would have to also run a "select * from macroheader" and save the appropriate SQL line for the header.
However, PowerHome provides a much easier way to export macros (and other PH elements). From the PowerHome Explorer, to export a macro complete with header and detail, just go to the Macros screen (the screen that lists the header information), right click the macro of interest and select "Export". You'll get a dialog to pick the filename to save to and PowerHome will create a .SQL file with both the header and detail SQL statements.
Pete,
Nope, no error would have been generated during this import as it's perfectly legitimate to import data into the detail table without the header table. Of course, in a true database environment, you would setup constraints to maintain referential integrity and you wouldnt be allowed to have data in a detail table that did not have a matching parent record in the header table. However, due to the fact that the royalty-free edition of Adaptive Server Anywhere excludes these features (they're available in the full version, but then PowerHome would have to be about $140.00 more expensive), we've got to make due the best we can .
Dave.
|
Back to Top |
|
|
jeffw_00 Super User
Joined: June 30 2007
Online Status: Offline Posts: 929
|
Posted: December 12 2007 at 12:53 | IP Logged
|
|
|
"click the macro of interest and select "Export"."
Duh! 8-}(sigh) - very cool dave.
I'll post something clean in the next day or two
/j
Edited by jeffw_00 - December 12 2007 at 12:54
|
Back to Top |
|
|
jeffw_00 Super User
Joined: June 30 2007
Online Status: Offline Posts: 929
|
Posted: December 12 2007 at 17:56 | IP Logged
|
|
|
continued to the better-named thread
http://www.myx10.com/forum/forum_posts.asp?TID=1557&PN=1&TPN =1
|
Back to Top |
|
|
|
|