Skip to content

Issues with procedures containing multiple queries. #8

@JimmyAustin

Description

@JimmyAustin

Hi,

I've been having issues with queries with multiple statements. I tested using the java library and got the expected output.

Example Code

import sqlparser

query = """select * from table1;
    select * from table24"""

parser = sqlparser.Parser()

if parser.check_syntax(query) == 0:
    for i in xrange(0,parser.get_statement_count(query)):
        print(i)
        stmt = parser.get_statement(i)
        root = stmt.get_root()
        print(root.get_text())

Expected output

0
select * from table1
1
select * from table2

Actual output

0
select * from table1
1
ct * from table1;

I've had a look at the source, but haven't had much luck getting started on finding the issue. Do you have any guidance for me?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions