Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL Parser from Fusion Middleware - javatools-nodeps.jar

kowwal-JavaNetMar 5 2017 — edited Mar 7 2017

Hi All,

I would like to ask about proper PL\SQL parsing method by means of javatools-nodeps.jar library taken from sqldeveloper/modules folder. I have created simple eclipse project and java source file as follows

public class PLSQL {

  public static void main(String[] args) {

       String plsql = "declare\nn number;\nbegin\ndbms_output.put_line(message);\nend;\n";

      

      oracle.javatools.buffer.ReadTextBuffer buffer = new oracle.javatools.buffer.CharArrayReadTextBuffer(plsql.toCharArray());

      oracle.javatools.parser.plsql.syntax.PlsqlDriver d = new oracle.javatools.parser.plsql.syntax.PlsqlDriver();

      d.setTextBuffer(buffer);

      PlsqlRoot c = d.ph1drv();

  }

}

The parser properly reads variable  n number in declaration, but next PtNod is empty (kind = 26). Could anyone help me with this issue?

Best regards,

JKowwal

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2017
Added on Mar 5 2017
7 comments
840 views