Skip navigation links

MySQL Forums


Advanced Search

Problem running query from VBS
Posted by: Matt H ()
Date: November 18, 2008 07:04AM

I have a problem running a query from VBS. It gets to the 3rd line then says I have a problem with the syntax. Running it in QueryBrowser throws up no problems. Basically - I need to check if a filename is in the DB then carry on, but if not then add it in and update a couple of fields. I've tried if(....) IS NULL, IF(SELECT (COUNT)....)='0', <'1', always the same issue. Is it a Client-server thing? I've seen mention of it, and that running variables on the client doesn't always work because of the way variables get passed back and forth.

Alternatively, is there a way of passing values from a VBS to a server-side stored proc?

Don't know if the rest will run because I can't get past this bit! The whole thing runs as a stored proc on the server without a hitch. I'd prefer to use PHP but I'm not permitted to use it on this server so VBS is has to be.

"UPDATE jcode SET j='1', jdate = CURDATE()" &_
"WHERE jdate < DATE(CURDATE()) OR j IS NULL; " &_
--->"IF (SELECT COUNT(pub_id) from jp_tm_mapping where pub_id = '" & PCODE & "')= `1` THEN" &_
"INSERT INTO jp_tm_mapping(j_code,shortcode,iss_date,pub_id)" &_
"VALUES(@JCODE,'" & SHORTCODE & "','" & ISS_DATE & "','" & PCODE & "');" &_
"UPDATE jcode SET j=@JCODE + 1 where j = @JCODE;" &_
"END IF;"


If anyone has any better suggestions I'm all ears. This will be running fully unattended in an automated system.

Options: ReplyQuote


Subject Written By Posted
Problem running query from VBS Matt H 11/18/2008 07:04AM
Re: Problem running query from VBS - Nearly there Matt H 11/20/2008 06:21AM


Sorry, you can't reply to this topic. It has been closed.