Purpose
This view displays the text source of all stored objects in the current tenant. The columns in this view are the same as those in ALL_SOURCE.
Applicability
This view is available starting with OceanBase Database.
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 corresponding to 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
Query the text source of all stored objects accessible to the current user: ALL_SOURCE
Query the text source of stored objects owned by the current user: USER_SOURCE