Skip to content

Issues with procedures containing multiple queries. #8

Open

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.

Activity

  1. JimmyAustin commented on Aug 1, 2016

    @JimmyAustin
    Author

    I should note that Tokenize works perfectly on the above queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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