Results 1 to 6 of 6

Thread: Retrieve Oracle blob via vbscript

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    4

    Retrieve Oracle blob via vbscript

    I want to retrieve/store a blob(s) from an Oracle db onto the harddrive. Most of these blobs are .doc or .txt files.
    Any suggestions on an efficient way to do this via script?
    Everything I have read seems to be very complicated.
    Thanks!

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    4

    Re: Retrieve Oracle blob via vbscript

    I should mention that I can connect to the db through sqlplus and retrieve information already. I am looking for simple retrieval logic only.

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Retrieve Oracle blob via vbscript

    you want to just save the files or save the contents into a local database?

    you can use fso to save files to whatever folder you want, there will be many examples of creating a scripting object and fso.getfolder

    another option is to use api URLdownloadtofile quite a simple api to use
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    4

    Re: Retrieve Oracle blob via vbscript

    I am working at the retrieval logic for getting the blob.
    I have used FSO without issue. I am just not sure of the commands to retrieve the blob.
    I am not using http, rather pure vbscript.

    Thanks!

  5. #5
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Retrieve Oracle blob via vbscript

    Not sure it cvan be done in vbscript. But look at this:

    http://www.planet-source-code.com/UR...ue/Posting.htm

    or:
    http://www.oracle.com/technology/sam...ock/index.html

    I think in both cases you will need to convert to a bitstream and append the steam together before tying to wite to a file.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    4

    Re: Retrieve Oracle blob via vbscript

    I have found lots of information on this process, but I keep stumbling at the query. Maybe it is a fileblock size problem?

    Utilizing adodb connection and commands,

    vb Code:
    1. rs.Open "SELECT id, blob FROM attachments WHERE id = 673", conn

    produces;

    run time error -2147467259(80004005)':
    unspecified error


    Any thoughts?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width