The better solution is after getting the blob from the database, release the handle and then write to a file which can be displayed as an image.
I used db_0or1row to get the blob data in my tcl file and then open a file ( [open tmp_file w] ) in write mode. Then I put the blob data in the file using "puts" command. After the data is written to the file, I used ns_returnfile to display the file.
Here I am getting just a blank page. I checked ns_returnfile with a static image existing on my hard disk and it works fine. So the problem is while putting the blob data in the file.
Looking for some comments on it.