refs #731: fix autonomous vector example storage

This commit is contained in:
devmrko
2026-07-24 15:53:47 +09:00
parent 8e4d2f656f
commit c8fa6af679
2 changed files with 10 additions and 0 deletions

View File

@@ -94,6 +94,7 @@ CREATE OR REPLACE FUNCTION sg_qa_vector_store(
) RETURN NUMBER
AUTHID DEFINER
IS
PRAGMA AUTONOMOUS_TRANSACTION;
v_input CLOB;
v_embedding VECTOR;
v_example_id NUMBER;
@@ -116,7 +117,12 @@ BEGIN
p_question, p_answer_sql, p_answer, v_input, v_embedding, 'cohere.embed-v4.0'
) RETURNING example_id INTO v_example_id;
COMMIT;
RETURN v_example_id;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
RAISE;
END;
/