From 525c4349eb203149dcfc684186c6c3100c3e7d52 Mon Sep 17 00:00:00 2001 From: David Wicinas <93669463+dwicinas@users.noreply.github.com> Date: Wed, 20 Sep 2023 08:57:40 -0400 Subject: [PATCH] several fixes suggested by Himanshu --- .../17_dbms_sql/11a_describe_columns2.mdx | 10 ++--- .../17_dbms_sql/11b_describe_columns3.mdx | 40 ++++++++++--------- .../17_dbms_sql/19_to_cursor_number.mdx | 14 ++++++- 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/11a_describe_columns2.mdx b/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/11a_describe_columns2.mdx index 65f6e364e49..ac338be78ec 100644 --- a/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/11a_describe_columns2.mdx +++ b/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/11a_describe_columns2.mdx @@ -2,11 +2,11 @@ title: "DESCRIBE_COLUMNS2" --- -The `DESCRIBE_COLUMNS2` procedure describes specified columns returned by a cursor. This procedure provides an alternative to 'DESCRIBE_COLUMN' and can be used for migration. +The `DESCRIBE_COLUMNS2` procedure describes specified columns returned by a cursor. This procedure provides an alternative to `DESCRIBE_COLUMN`. ```sql -DESCRIBE_COLUMNS2( IN NUMBER, OUT NUMBER, OUT - DESC_TAB); +DESCRIBE_COLUMNS2( IN NUMBER, OUT NUMBER, OUT + DESC_TAB2); ``` ## Parameters @@ -19,9 +19,9 @@ DESCRIBE_COLUMNS2( IN NUMBER, OUT NUMBER, OUT The number of columns in the cursor result set. -`desc_tab` +`desc_tab2` - The table that contains a description of each column returned by the cursor. The descriptions are of type `DESC_REC` and contain the following values: + The table that contains a description of each column returned by the cursor. The descriptions are of type `DESC_REC2` and contain the following values: | Column name | Type | | --------------------- | --------------- | diff --git a/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/11b_describe_columns3.mdx b/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/11b_describe_columns3.mdx index c44751ca2c5..eeaa76877d1 100644 --- a/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/11b_describe_columns3.mdx +++ b/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/11b_describe_columns3.mdx @@ -2,11 +2,12 @@ title: "DESCRIBE_COLUMNS3" --- -The `DESCRIBE_COLUMNS3` procedure describes specified columns returned by a cursor. This procedure provides an alternative to 'DESCRIBE_COLUMN' and can be used for migration. +The `DESCRIBE_COLUMNS3` procedure describes specified columns returned by a cursor. This procedure provides an alternative to `DESCRIBE_COLUMN`. + ```sql -DESCRIBE_COLUMNS3( IN NUMBER, OUT NUMBER, OUT - DESC_TAB); +DESCRIBE_COLUMNS3( IN NUMBER, OUT NUMBER, OUT + DESC_TAB3); ``` ## Parameters @@ -19,23 +20,26 @@ DESCRIBE_COLUMNS3( IN NUMBER, OUT NUMBER, OUT The number of columns in the cursor result set. -`desc_tab` +`desc_tab3` + + The table that contains a description of each column returned by the cursor. The descriptions are of type `DESC_REC3` and contain the following values: - The table that contains a description of each column returned by the cursor. The descriptions are of type `DESC_REC` and contain the following values: +| Column name | Type | +| --------------------- | ----------------- | +| `col_type` | `INTEGER` | +| `col_max_len` | `INTEGER` | +| `col_name` | `VARCHAR2(128)` | +| `col_name_len` | `INTEGER` | +| `col_schema_name` | `VARCHAR2(128)` | +| `col_schema_name_len` | `INTEGER` | +| `col_precision` | `INTEGER` | +| `col_scale` | `INTEGER` | +| `col_charsetid` | `INTEGER` | +| `col_charsetform` | `INTEGER` | +| `col_null_ok` | `BOOLEAN` | +| `col_type_name` | `VARCHAR2(32767)` | +| `col_type_name_len` | `INTEGER` | -| Column name | Type | -| --------------------- | --------------- | -| `col_type` | `INTEGER` | -| `col_max_len` | `INTEGER` | -| `col_name` | `VARCHAR2(128)` | -| `col_name_len` | `INTEGER` | -| `col_schema_name` | `VARCHAR2(128)` | -| `col_schema_name_len` | `INTEGER` | -| `col_precision` | `INTEGER` | -| `col_scale` | `INTEGER` | -| `col_charsetid` | `INTEGER` | -| `col_charsetform` | `INTEGER` | -| `col_null_ok` | `BOOLEAN` | ### Examples diff --git a/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/19_to_cursor_number.mdx b/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/19_to_cursor_number.mdx index 24611b093b9..bf095161868 100644 --- a/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/19_to_cursor_number.mdx +++ b/product_docs/docs/epas/16/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/17_dbms_sql/19_to_cursor_number.mdx @@ -31,5 +31,17 @@ DECLARE col2_data VARCHAR(30); BEGIN OPEN cur1 FOR 'SELECT * FROM test_tbl_tbl'; - cur_id:= dbms_sql.TO_CURSOR_NUMBER + cur_id:= dbms_sql.to_cursor_number(cur1); + + dbms_sql.define_column(cur_id, 1, tbl_desc.col1); + dbms_sql.define_column(cur_id, 2, tbl_desc.col2); + + LOOP + ret := dbms_sql.FETCH_ROWS(cur_id); + EXIT WHEN ret = 0; + dbms_sql.column_value(cur_id, 1, tbl_desc.col1); + dbms_sql.column_value(cur_id, 2, tbl_desc.col2); + dbms_output.put_line('Col1: ' || tbl_desc.col1 || ' Col2: ' || tbl_desc.col2); + END LOOP; +END; ``` \ No newline at end of file