Note
This view is available starting with V2.2.30.
Purpose
This view displays the text source of all stored objects in the current tenant. The columns are the same as those in the ALL_SOURCE view.
Applicability
This view applies only to OceanBase Database in Oracle mode.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| OWNER | VARCHAR2(30) | NO | The owner of the object. |
| NAME | VARCHAR2(30) | NO | The name of the object. |
| TYPE | VARCHAR2(12) | NO | The type of the object. |
| LINE | NUMBER | NO | The line number in the source code of the TEXT field. |
| TEXT | CLOB | NO | The source code of the current line. |
| ORIGIN_CON_ID | NUMBER(38) | NO | The tenant ID of the tenant to which the object belongs. If the object is a system package, the value is 0. |
Sample query
Query the text source of all stored objects in the current tenant and display the first two records.
obclient [SYS]> SELECT * FROM SYS.DBA_SOURCE WHERE ROWNUM<=2\G
The query result is as follows:
*************************** 1. row ***************************
OWNER: SYS
NAME: JOB_UTILS
TYPE: PACKAGE
LINE: 1
TEXT: PACKAGE JOB_UTILS IS
PROCEDURE insert_date;
PROCEDURE insert_date_program ( job IN VARCHAR2, job_name IN VARCHAR2);
END;
ORIGIN_CON_ID: 1004
*************************** 2. row ***************************
OWNER: SYS
NAME: JOB_UTILS
TYPE: PACKAGE BODY
LINE: 1
TEXT: PACKAGE BODY JOB_UTILS IS
PROCEDURE insert_date IS
BEGIN
INSERT INTO DBMS_SCHEDULER_T1 VALUES(TO_CHAR(sysdate));
COMMIT;
END;
PROCEDURE insert_date_program ( job IN VARCHAR2, job_name IN VARCHAR2) IS
BEGIN
INSERT INTO DBMS_SCHEDULER_T2 VALUES(sysdate, job, job_name);
COMMIT;
END;
END;
ORIGIN_CON_ID: 1004
2 rows in set
References
ALL_SOURCE: This view displays the text source of all stored objects that the current user can access.
USER_SOURCE: This view displays the text source of all stored objects owned by the current user.