Writing back to Teradata DB from Qlikview

    Inserting Data:

     

    sub Idea

    Set objConn = CreateObject("ADODB.Connection")
    set Name1 = ActiveDocument.Variables("Variable1")
    set Name2 = ActiveDocument.Variables("Variable2")
    GetUserid = Name1.GetContent.String
    GetUserpassword = Name2.GetContent.String

    'Establish a connection
    objConn.Open "PROVIDER=MSDASQL;" &  "DRIVER={Teradata};" &  "DBCName=IP or TD Name;" &  "Database=Dbname;" & "Uid=Userid;" & "Pwd=Password"



    'Set SQL
    strSQL="insert into
    Dbname.Tablename(User_ID,PSWD) values('" & GetUserid & "','" & GetUserpassword & "')"

    'Begin Transaction
    objConn.BeginTrans

    'Execute Transaction
    objConn.Execute strSQL, iAffected

    objConn.CommitTrans
    objConn.Close

    end sub