inserting blob image to oracle database DB 11g

when i try to insert a blob image to my databse i got the below message :slight_smile:

ora-01465 invalid hex number insert blob

Could you please help to solve the issue

Is this the same topic as Inserting Image to oracle DB 11g? If so, please continue the conversation there - there’s no need to create multiple topics for the same issue.

No, it’s not the same , you can close or remove the previous topic.
Sorry for the inconvenience.

No problem - just wanted to understand what’s happening.

You’re trying to insert data into a field that isn’t hex-value data.

I am using Oracle DB and i would like to insert rows of images , to blob field in a table.
I google it to find a solution but my efforts went in vain .
As i understand the error says , there is a mismatch between the input and the db type .

You are correct, that is the root cause of the error.

We’d need to see the code involved (models, forms, views, etc) to figure out what you need to do to fix it.

here the code i use :
views:

def addphoto(request):
    if request.method == "POST":
        #prod=table()
        name=request.POST.get('name')
        price=request.POST.get('price')
        description=request.POST.get('description')
          if len(request.FILES)!=0:
            image=request.FILES.get('image')
             
        
        conn = connection()
        cursor = conn.cursor()
        cursor.execute("INSERT INTO GRHM.h_photos VALUES (:name ,TO_DATE(15/07/99, ‘DD/MM/YY’), :description, :image)", [name, price,description,image])
        conn.commit()
        conn.close()
        return redirect('/')
    return render(request, 'addphoto.html')

I don’ use forms and models – i have exited DB , i try to insert into it .
Thanks

See the docs at File Uploads | Django documentation | Django for handling uploaded files. Also see Uploaded Files and Upload Handlers | Django documentation | Django for more detailed information.