摘要 |
The embodiment of the invention discloses a method and a device for translating database language; a method for pre-setting and storing the translation logic comprises the following steps: acquiring source SQL (Structured Query Language) code, source SQL database type and object SQL database type; compiling the source SQL code, acquiring the key word and the grammar logic in the source SQL code; searching the translation logic according to the source SQL database type and the object SQL database type, acquiring the key word and the grammar logic in the object SQL database corresponding to thecompiled key word and grammar logic; and acquiring other codes in the key word and the source SQL code except the key word according to the grammar logic composition in the object SQL database, and generating the object SQL code. The source SQL code can be automatically translated into the object SQL code according to the translation logic, thereby improving the developing efficiency of the database and reducing the load of the developer. |