Yogesh Sarode

How to use "Tag" In Indusoft Scada VBscript query

2 posts in this topic

Facing some problem while developing SCADA. Kinldy give some solution for below problems. 1) While using Update statement I want to use tag instead of values e.g $DBUpdate("sajja","MFG1_EMPTY_DETAILS", $Date ,"MFG1_EMPTY_DATE") $DBUpdate("sajja","MFG1_EMPTY_DETAILS", $Time ,"MFG1_EMPTY_TIME") Its showing “Script is OK “ but it is not showing the current date and time in DB.It copying same $Date and $Time in DB 2) using Delete statement I want to use tag instead of values e.g Query 1: $DBDelete( "sajja", "Recipe", "REC_Product_Code = $RECIPE_SEL[1]", "" ) Query 2: Dim A A= "Delete from Recipe where REC_Product_Code = $RECIPE_SEL[1] " $DBExecute("sajja",A) Its showing “Script is OK “ but not working. If I use product code directly instead of $RECIPE_SEL[1] then it I working Ok.

Share this post


Link to post
Share on other sites
Hi, Hopefully you've already been able to solve these issues, but I'll leave my comments anyway. 1) I'm not sure what the issue is with this item. I don't see any obvious issues although it wasn't quite clear to me from your discription what is actually happening. As it is written, it should update the date/time columns for every row in the table (because the DBUpdate optStrCondition isn't being used) - not sure if that was your intention or not. Also, I found the InduSoft provided DB functions to be too limiting and actually re-implemented them in VBScript myself. It takes a bit of doing, but if you're familiar with SQL and VBScript it is worth doing in the long run. 2) You just need a minor adjustment in syntax. The tag needs to be concatenated with the string and not included inside it. So change it from: A= "Delete from Recipe where REC_Product_Code = $RECIPE_SEL[1] " to A= "Delete from Recipe where REC_Product_Code = " & $RECIPE_SEL[1]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now