1 Reply Latest reply on Nov 17, 2017 1:33 PM by chall

    Need to retrieve some documents from Database dump




      We need to retrieve some documents from a database dump. We have followed the below steps on accessing the information. I was able to run successfully the below queries but, how do i actually download the file?


      1. SELECT * FROM jivedocument where documentid ilike 'DOC-XXXX'; then use the internaldocid results in query number 2
      2. SELECT * FROM jivedocbodyversion where internaldocid= <>; use the bodyid results for number 3
      3. SELECT * FROM jivedocumentbody where bodyid in (bodyid from other querey  )




      P.S Jive SDS 5.0.1 version

        • Re: Need to retrieve some documents from Database dump

          something like this?


          cursor.execute("SELECT  internaldocid from jivedocument where documentid like 'DOC-1284'")

          internaldoc_id = str(cursor.fetchone()[0])

          print 'internaldoc id:',internaldoc_id

          cursor.execute("SELECT bodyid FROM jivedocbodyversion where internaldocid= "+internaldoc_id+"")

          body_id = str(cursor.fetchone()[0])

          print 'body_id:',body_id

          cursor.execute("SELECT * FROM jivedocumentbody where bodyid = "+body_id+"")

          result = cursor.fetchall()

          print result