How to call DMSMyCuff.HASH? when inserting CROB into Oracle with Python

How can this be done in one operation instead of two?

< H1 >! / usr/local/bin/python3 < / H1 >

import cx_Oracle

con = cx_Oracle.connect ("scott/tiger@localhost:1512/ORCLPDB1", encoding= "UTF-8")
cursor = con.cursor ()
cursor.execute ("CREATE TABLE t (id NUMBER, script CLOB, script_hash RAW (32)")

my_text ="$" 2 * 10

statement = "INSERT INTO t (id, script) VALUES (: my_id,: my_clob)"
cursor.execute (statement, (1, my_text)

statement = "

UPDATE t 
   SET script_hash = DBMS_CRYPTO.HASH(script, 2) 
 WHERE id = :my_id"""

cursor.execute (statement, {"my_id": 1})

con.commit ()
con.close ()

This doesn"t work:

statement = "
INSERT INTO t (id, script, script_hash)
VALUES (: my_id,: my_clob, DBMS_CRYPTO.HASH (: my_clob, 2))
cursor.execute (statement, (2, my_text, my_text)

< H1 > cx_Oracle.DatabaseError: ORA-01465: invalid hex number < / H1 >

(Oracle 12.2 using Python and cx_Oracle 6.3)

Mar.18,2021

try:

statement = """
INSERT INTO t(id, script, script_hash)
VALUES (:my_id, :my_clob, DBMS_CRYPTO.HASH(UTL_RAW.CAST_TO_RAW(:my_clob), 2))"""

refer to [Making a sha1-hash of a row in Oracle
] ( https://stackoverflow.com/que.

)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37a42-2c090.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37a42-2c090.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?