Method and system for analyzing dynamic SQL (Structured Query Language) of OpenGauss database

The invention provides a method and a system for analyzing a dynamic SQL (Structured Query Language) of an OpenGauss database, and the method for analyzing the dynamic SQL of the OpenGauss database comprises the following steps: declaring a global data structure for storing data of a cursor, and ini...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: HUANG XIAOTAO, ZONG WEI
Format: Patent
Sprache:chi ; eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:The invention provides a method and a system for analyzing a dynamic SQL (Structured Query Language) of an OpenGauss database, and the method for analyzing the dynamic SQL of the OpenGauss database comprises the following steps: declaring a global data structure for storing data of a cursor, and initializing variables in the global data structure; storing an SQL statement to be executed into a querybuf field of the global data structure, and constructing an executable statement according to the SQL statement; and calling a software development interface in an OpenGauss database to execute theexecutable statement. According to the method, the dynamic SQL can be analyzed in the OpenGauss database, the execution efficiency is superior to that of a local dynamic SQL statement, and the flexibility of the dynamic SQL can be guaranteed. 本发明提供一种用于OpenGauss数据库的解析动态SQL的方法及系统,该用于OpenGauss数据库的解析动态SQL的方法包括:声明一个全局性数据结构用于存储游标的数据,初始化所述全局性数据结构中的变量;将待执行的SQL语句保存到所述全局性数据结构的querybuf字段,根据所述SQL语句构建可执行语句;调用OpenGauss数据库中的软件开发接口执行所述可执