[Python] Executing and retrieving stored procedure returns in python with oracle db

Discussão em 'Python' iniciado por Stack, Abril 11, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to run


    plsql = """
    DECLARE
    l_zip BLOB;
    BEGIN
    l_zip := apex_export.zip( p_source_files => apex_export.get_workspace:)1),
    p_extra_files => apex_t_export_files( apex_t_export_file( name => 'README.md', contents => 'Merch Read Write Workspace Contents.'),
    apex_t_export_file( name => 'LICENSE.txt', contents => 'The Universal Permissive License (UPL), Version 1.0'))
    );
    :2 := l_zip;
    END;
    """

    zip_var = cursor.var(oracledb.DB_TYPE_BLOB)

    cursor.execute(plsql, [workspace_id, zip_var])


    with open("workspace_export.zip", "wb") as f:
    f.write(zip_data)



    I always get the error

    oracledb.exceptions.NotSupportedError: DPY-3002: Python value of type "tuple" is not supported

    in the line cursor.execute(plsql, [workspace_id, zip_var])

    Continue reading...

Compartilhe esta Página