0 Replies Latest reply: Aug 17, 2011 11:10 AM by Paolo Rena RSS

    STORE results in an oracle db

    Paolo Rena

      Hi to all.

      i need your help for build a query to store results in an Oracle DB.

       

      The steps i would like to implements with macro are:

      1) DB connection to Oracle

      2) store in Oracle the value of the Object called 'Result' (site on a dashboard).

       

      The connection works. I need some help for the second step.

      With SetAnalysis I build a straight table called  'RESULT'. So i have to connect on Oracle,

      bring the SheetObject (RESULT) and build an insert.

       

       

      sub test

                     dim sConn, oConn

                     Set oConn = CreateObject("ADODB.Connection")

       

              oConn.Open "Driver={Microsoft ODBC for Oracle};" & _

                        " Server=SNAME;uid=user;pwd=pass;"

       

              ???  What is the correct syntax for:

              set obj = ActivateDocument.getObject('RESULT')

              for ...

                     sSQLStr = "INSERT INTO DHZ7DA1000.TMP_CLI(CONSUMER_ID, EDV_CODE)

                                       VALUES (obj.getvalue(1), obj.getvalue(2))"

       

              oConn.Execute sSQLStr

                     oConn.Close

                     Set oConn = Nothing

      end sub

       

       

      Thanks to all...