MySQL Forums
Forum List  »  MySQL Workbench

Re: [Python] How to parse Sql statement
Posted by: Louis de Gaulle
Date: November 02, 2015 08:03AM

I wish something like this:
for schema in grt.root.wb.doc.physicalModels[0].catalog.schemata:
    print schema.name
    for view in schema.views:
        for table in view.tables:
            print table.joinType

But it seems it will be otherwise (My title was prescient)

import grt
from grt.modules import MysqlSqlFacade

sql = "SELECT * FROM test"
token_list = MysqlSqlFacade.parseAstFromSqlScript(sql)
print(token_list)

Options: ReplyQuote


Subject
Views
Written By
Posted
1267
November 02, 2015 06:57AM
Re: [Python] How to parse Sql statement
718
November 02, 2015 08:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.