Lo_export problem

Hi,

i’m trying to store a picture from the DB to the filesystem.
i’ve used the function lo_export like that:

res = conn.query(“SELECT nome,physical_image FROM images;”)

i=0
while(res[i]!=nil)
conn.lo_export(res[i][1].to_i,’/home/andrea/senior/public/images/#{res[i][0]}.jpg’)
i+=1

end

conn.close())

there’re not errors, the script run…
The problem is that no files are created and i don’t know why.
Can somebody help me??

thanks in advance…

On Jul 4, 2007, at 5:48 AM, incoroneta wrote:

conn.lo_export(res[i][1].to_i,’/home/andrea/senior/public/images/#
Can somebody help me??

thanks in advance…


Posted via http://www.ruby-forum.com/.

Check out the IO and File libraries.
ri File
ri IO
also, in Ruby it’s a good idea to put spaces before and after
operators…
i += 1

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs