Kaseya Community

Incrementing Systeminfo column value fails!

  • I have a field in SystemInfo called MalwareScans, it is either empty ("") or has a value greater than 0 in it. I am trying to script pulling that value and incrementing it by one. (counting the # of scans done)
    
    Here is the part of my script statment that fails
    ---------------------------------------------------------------------
    
    <Statement description="" name="GetVariable" continueOnFail="false">
    <Parameter xsi:type="EnumParameter" name="VariableType" value="ExpressionValue" /> 
    <Parameter xsi:type="StringParameter" name="SourceContent" value="#SqlViewName.MalwareScans# + 1" /> 
    <Parameter xsi:type="StringParameter" name="VariableName" value="completescans" /> 
    </Statement>
    
    ---------------------------------------------------------------------
    
    My script continues to fail at this step, anyone have a clue why?
    
    In help documents it says:
    Note: - Automatic SQL View Data Variables - SQL view parameters are available as automatically declared procedure variables. Automatic variables enable you to skip using the GetVariable command with the SQL View Data option. Use the format #SqlViewName.ColumnName# in a procedure to return the value of a dbo.SqlView.Column for the agent executing the procedure.
    
    
    Then just below that it says:
    Expression Value - Specify an expression that consists of procedure variables and six mathematical operators +, -, *, /, (, and ) that are evaluated and assigned to a new procedure variable. For example, ((#variable1# + #variable2#) + 17.4) / (#variable3# * 4). The procedure variables must contain numeric values.
    
    
    
    Is there a better way of doing what I want to do or can anyone spot what I might have done wrong in this statment?

    Legacy Forum Name: Incrementing Systeminfo column value fails!,
    Legacy Posted By Username: Cubert


    [edited by: Brendan Cosgrove at 5:44 PM (GMT -8) on 12-20-2010] .
  • Try changing this part

    "#SqlViewName.MalwareScans# + 1"

    to this

    ="#vSystemInfo.MalwareScans# + 1"

    Legacy Forum Name: Kaseya2 Scripts,
    Legacy Posted By Username: kcears
  • Nice... Please dont duplicate post like that... it makes us forum trolls think we're going crazy...

    Legacy Forum Name: Kaseya2 Scripts,
    Legacy Posted By Username: thirteentwenty
  • kcears
    Try changing this part

    "#SqlViewName.MalwareScans# + 1"

    to this

    ="#vSystemInfo.MalwareScans# + 1"


    Doh, Actually I was using #SystemInfo.MalwareScans# with out the "v" and that was failing my script..


    Big Smile

    Legacy Forum Name: Kaseya2 Scripts,
    Legacy Posted By Username: Cubert