SQL Query Action Syntax Error

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
RRing
Posts: 39
Joined: Wed Aug 16, 2006 9:14 am

SQL Query Action Syntax Error

Post by RRing »

I am trying to substring the insert of the reply field as per below and keep getting an error. I know the ODBC insert replaces the quotes in some manner, but cannot get the below query to work. Can ypou please let me know what I am doing wrong?

Insert into UserCapacity (Eventtime,Folder,Reply) Values (Getdate(),'%Folder%','Substring(%Reply%,CharIndex('Participants=',%Reply%)+13,Charindex('|Conferences=',%Reply%)-charindex('Participants=',%Reply%)-13)')

When Using the following query
Insert into HMCapacity (Eventtime,Folder,Reply) Values (Getdate(),'%Folder%','%Reply%')

Here are results
ACK|Command=ConfCount|MessageNumber=0|Participants=0|Conferences=0|Returned=Success|\r\n\r\n
Last edited by RRing on Thu Feb 25, 2010 11:30 am, edited 1 time in total.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

You should use quotation marks for %Reply% variable

Regards
Alex
RRing
Posts: 39
Joined: Wed Aug 16, 2006 9:14 am

SQL Query Action Syntax Error

Post by RRing »

Thanks Alex- I missed that. Looks like I had that wrong, and also had to remove the quotes around the complete substring command. All works good now. Thanks you for your quick reply.
Post Reply