[Python] OCI NoSQL query: PREPARE: Illegal Argument: The driver or SDK being used does not...

Discussão em 'Python' iniciado por Stack, Março 22, 2025.

  1. Stack

    Stack Membro Participativo

    I try to write a query to nosql Oracle Cloud with statement have count like below

    nosql_client = oci.nosql.NosqlClient(config)
    query = """
    declare
    $orgKey string;

    SELECT count(*) FROM log_table WHERE orgKey = $orgKey
    """
    orgKey = "HV411"

    try:
    prepare_statement_response = nosql_client.prepare_statement(
    compartment_id=compartment_ocid,
    statement = query
    )
    rows_response = nosql_client.query(
    query_details=oci.nosql.models.QueryDetails(
    compartment_id=compartment_ocid,
    is_prepared = True,
    statement=prepare_statement_response.data.statement,
    consistency="EVENTUAL",
    variables = {
    '$orgKey':eek:rgKey,
    }
    ),
    )
    print(rows_response)
    except (Exception, ValueError) as ex:
    print('Failed to execute the query ' + str(ex))


    I got this error


    Failed to execute the query {'target_service': 'nosql', 'status': 400, 'code': 'InvalidParameter', 'opc-request-id': 'C1C23D2C3D22487EBD183DA8B4A27BD2', 'message': 'PREPARE: Illegal Argument: The driver or SDK being used does not support complex query.', 'operation_name': 'prepare_statement', 'timestamp': '2025-03-20T07:12:23.055327+00:00', 'client_version': 'Oracle-PythonSDK/2.149.0', 'request_endpoint': 'GET https://nosql.me-jeddah-1.oci.oraclecloud.com/20190828/query/prepare', 'logging_tips': 'To get more info on the failing request, refer to https://docs.oracle.com/en-us/iaas/tools/python/latest/logging.html for ways to log the request/response details.', 'troubleshooting_tips': "See https://docs.oracle.com/iaas/Conten...rrors.htm#apierrors_400__400_invalidparameter for more information about resolving this error. Also see https://docs.oracle.com/iaas/api/#/en/nosql-database/20190828/QueryResultCollection/PrepareStatement for details on this operation's requirements. If you are unable to resolve this nosql issue, please contact Oracle support and provide them this full error message."}
    ​

    Also the same error happens when I use group by, order by.

    Continue reading...

Compartilhe esta Página