SQL syntax

Home Forums Scripting Windows Script Host SQL syntax

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    h0ndzik
    Member
    #158927

    Hi all, I have VBScript down bellow which send SQL command to database.
    But I get error about syntax. I think problem will be with “apostrophe” in line with sql command.
    Any idea?
    Best regards


    sSQL = “CALL INS.RUN_PROBE(‘RULELESS_EVENTS’,’RESULT’);”
    Set oRS = oConn.Execute( sSQL )
    While Not oRS.EOF And Not oRS.BOF
    out= vbcrlf & oRS.Fields(0).Value
    oRS.MoveNext
    wend[/CODE]…

    [QUOTE]error:0 ‘SQL0104: Token ; was not valid. Valid tokens: .
    Cause . . . . . : A syntax error was detected at token ;. Token ; is not a valid token. A partial list of valid tokens is
    . This list assumes that the statement is correct up to the token. The error may be earlier in the statement, but the syntax of the statement appears to be valid up to this point. Recovery . . . : Do one or more of the following and try the request again: — Verify the SQL statement in the area of the token ;. Correct the statement. The error could be a missing comma or quotation mark, it could be a misspelled word, or it could be related to the order of clauses. — If the error token is , correct the SQL statement because it does not end with a valid clause.'[/QUOTE][CODE]sSQL = “CALL INS.RUN_PROBE(‘RULELESS_EVENTS’,’RESULT’);”
    Set oRS = oConn.Execute( sSQL )
    While Not oRS.EOF And Not oRS.BOF
    out= vbcrlf & oRS.Fields(0).Value
    oRS.MoveNext
    wend[/CODE]…

    Quote:
    error:0 ‘SQL0104: Token ; was not valid. Valid tokens: .
    Cause . . . . . : A syntax error was detected at token ;. Token ; is not a valid token. A partial list of valid tokens is
    . This list assumes that the statement is correct up to the token. The error may be earlier in the statement, but the syntax of the statement appears to be valid up to this point. Recovery . . . : Do one or more of the following and try the request again: — Verify the SQL statement in the area of the token ;. Correct the statement. The error could be a missing comma or quotation mark, it could be a misspelled word, or it could be related to the order of clauses. — If the error token is , correct the SQL statement because it does not end with a valid clause.’

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.