KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

SQL Query Action Syntax Error

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
RRing



Joined: 16 Aug 2006
Posts: 39

PostPosted: Thu Feb 25, 2010 11:25 am    Post subject: SQL Query Action Syntax Error Reply with quote

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
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12807
Location: USA

PostPosted: Thu Feb 25, 2010 11:29 am    Post subject: Reply with quote

You should use quotation marks for %Reply% variable

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
RRing



Joined: 16 Aug 2006
Posts: 39

PostPosted: Thu Feb 25, 2010 11:41 am    Post subject: SQL Query Action Syntax Error Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index