This figure shows DBMS_SQL execution flow, starting with OPEN_CURSOR and PARSE calls and ending with a CLOSE_CURSOR call:

  1. Flow goes from OPEN_CURSOR to PARSE.

  2. After the PARSE call is a decision point: Are bind variables used?

  3. Depending on whether bind variables are used:

  4. Then comes another decision point: Is the statement a query?

The following steps describe the remaining flow if the statement is not a query:

  1. Call EXECUTE.

  2. After the EXECUTE call is a decision point: Is the statement a PL/SQL block?

  3. Depending on whether it is a PL/SQL block:

  4. The flow is then shown to loop back up to the PARSE call, the "Use bind variables?" decision point, or the "Query?" decision point as appropriate.

  5. At the end of the flow, call CLOSE_CURSOR.

The following steps describe the remaining flow if the statement is a query:

  1. Call DEFINE_COLUMN. Loop to call it as many times as necessary.

  2. Call EXECUTE.

  3. Call FETCH_ROWS.

  4. Call COLUMN_VALUE and VARIABLE_VALUE. Loop to call them as many times as necessary.

  5. After the COLUMN_VALUE and VARIABLE_VALUE calls, the flow is shown to loop back up to the EXECUTE call or the FETCH_ROWS call as appropriate.

  6. At the end of the flow, call CLOSE_CURSOR.

End of description.