1 Reply Latest reply: Apr 6, 2014 11:44 AM by Gysbert Wassenaar RSS

    How can i read from a qvd the fields and store the data into an oracle table

    gou geo

      Hello.

       

      A few days ago i found the solution how to insert data from an input box into an oracle table with the vbscript module below.

       

      sub oracle

       

      set myStore = ActiveDocument.Variables("STORE")

      insStore = myStore.GetContent.String

      set mySales = ActiveDocument.Variables("SALES")

      insSales = mySales.GetContent.String

       

      set db = CreateObject("ADODB.Connection")

      db.open "DSN=xxx;UID=xxx;PWD=xxx"

       

      set Orderfile = db.execute("INSERT INTO QLIKVIEW3 (STORE, SALES) VALUES (' " & insStore & " ', ' " & insSales & " ');")

      set Orderfile = db.execute("COMMIT;")

       

      db.Close

       

      end sub

       

      Now i'm trying to find how can i store the data that the fields of a qvd have into an oracle table with the script below but does not pass.

       

      sub oracle

       

      set myStoreid = ActiveDocument.Fields("STORE_ID")

      set mySalesid = ActiveDocument.Fields("SALES_ID")

       

      set db = CreateObject("ADODB.Connection")

      db.open "DSN=xxx;UID=xxx;PWD=xxx"

       

      set Orderfile = db.execute("INSERT INTO QLIKVIEW4 (STORE, SALES) VALUES (' " & myStoreid & " ', ' " & mySalesid & " ');")

      set Orderfile = db.execute("COMMIT;")

       

      db.Close

       

      end sub

       

      Has anyone any idea how this can be done ?

       

      Thank you in advance.