8000 sample sql and pic · sqlparser/python_data_lineage@0a2b34c · GitHub
[go: up one dir, main page]

Skip to content
10000

Commit 0a2b34c

Browse files
committed
sample sql and pic
1 parent 9d034a8 commit 0a2b34c

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
lines changed

README_cn.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ WHERE o.customer_id = c.customer_id;
5858
并可视化为:
5959
![Oracle data lineage sample](samples/images/oracle_data_lineage.png)
6060

61+
### Oracle PL/SQL Data Lineage
62+
```
63+
python dlineage.py /t oracle /f samlples/oracle_plsql.sql /graph
64+
```
65+
66+
![Oracle PL/SQL data lineage sample](samples/images/oracle_plsql_data_lineage.png)
67+
68+
The [source code of this sample Oracle PL/SQL](samlples/oracle_plsql.sql).
6169

6270
### 分析 DDL, 自动画出 ER Diagram
6371

@@ -70,7 +78,7 @@ python dlineage.py /t sqlserver /f samples/sqlserver_er.sql /graph /er
7078

7179
![SQL Sever ER Diagram sample](samples/images/sqlserver_er_diagram.png)
7280

73-
the [DDL script of the above ER diagram is here](samples/sqlserver_er.sql).
81+
The [DDL script of the above ER diagram is here](samples/sqlserver_er.sql).
7482

7583
### step 1 环境准备
7684
* 安装python3
@@ -158,4 +166,4 @@ the [DDL script of the above ER diagram is here](samples/sqlserver_er.sql).
158166
### 从各种数据库中导出元数据
159167
[SQLFlow ingester](https://github.com/sqlparser/sqlflow_public/releases) 可以中数据库中导出元数据,交给 Gudu SQLFlow 进行数据血缘分析。
160168

161-
SQLFlow ingester 的使用文档链接在哪里?
169+
SQLFlow ingester [使用文档](https://docs.gudusoft.com/6.-sqlflow-ingester/introduction)
33.9 KB
Loading

samples/oracle_plsql.sql

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
DECLARE
2+
z_empid employees.employee_id%TYPE;
3+
z_depid employees.department_id%TYPE;
4+
z_firstname employees.first_name%TYPE;
5+
z_lastname employees.last_name%TYPE;
6+
7+
CURSOR cur_stclerk IS
8+
SELECT employee_id,
9+
department_id,
10+
first_name,
11+
last_name
12+
FROM employees
13+
WHERE job_id = 'ST_CLERK';
14+
BEGIN
15+
OPEN cur_stclerk;
16+
LOOP
17+
FETCH cur_stclerk INTO z_empid,z_depid,z_firstname,
18+
z_lastname;
19+
EXIT WHEN cur_stclerk%NOTFOUND;
20+
21+
INSERT INTO emp_temp
22+
(employee_id,
23+
department_id,
24+
job_id)
25+
VALUES (z_empid,
26+
z_depid,
27+
'ST_CLERK');
28+
29+
INSERT INTO emp_detls_temp
30+
(employee_id,
31+
empname)
32+
VALUES (z_empid,
33+
z_firstname
34+
|| ' '
35+
|| z_lastname);
36+
END LOOP;
37+
38+
CLOSE cur_stclerk;
39+
COMMIT;
40+
END;

widget/json/lineageGraph.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
0