{"id":223,"date":"2010-07-16T03:12:47","date_gmt":"2010-07-16T08:12:47","guid":{"rendered":"http:\/\/www.dpriver.com\/blog\/?page_id=223"},"modified":"2011-09-28T21:29:50","modified_gmt":"2011-09-29T02:29:50","slug":"vendor-specific-offline-sql-syntax-check","status":"publish","type":"page","link":"https:\/\/www.dpriver.com\/blog\/list-of-demos-illustrate-how-to-use-general-sql-parser\/vendor-specific-offline-sql-syntax-check\/","title":{"rendered":"vendor-specific offline SQL syntax check"},"content":{"rendered":"

SQL syntax check can be done without being connected to the database server and syntax errors can be found before executing SQL on your production database server. Database supports the following:\u00a0 Oracle(PLSQL), SQL Server, MySQL, DB2 and Access.<\/p>\n

Code in Java:<\/p>\n

    TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvoracle);\r\nsqlparser.sqlfilename\u00a0 = args[0];\r\n\r\nint ret = sqlparser.parse();\r\nif (ret == 0){\r\nSystem.out.println(\"Check syntax ok!\");\r\n}else{\r\nSystem.out.println(sqlparser.getErrormessage());\r\n}<\/pre>\nDownload this demo: Java version<\/a>, C# version<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"SQL syntax check can be done without being connected to the database server and syntax errors can be found before executing SQL on your production database server. Database supports the following:\u00a0 Oracle(PLSQL), SQL Server, MySQL, DB2 and Access. Code in Java: TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvoracle); sqlparser.sqlfilename\u00a0 = args[0]; int ret = sqlparser.parse(); if (ret == 0){ System.out.println(“Check syntax ok!”); }else{ System.out.println(sqlparser.getErrormessage()); } Download this demo: Java version, C# version<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":235,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"gsp_feature_page_tt.php","meta":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"yoast_head":"\nHelp you to make better use of General SQL Parser<\/title>\n\n\n\n\n\n\n\n\n\n\n\n