net.sourceforge.squirrel_sql.plugins.netezza.tab
Class NetezzaProcedureFormator

java.lang.Object
  extended by net.sourceforge.squirrel_sql.plugins.netezza.tab.NetezzaProcedureFormator
All Implemented Interfaces:
ICodeReformator

public class NetezzaProcedureFormator
extends Object
implements ICodeReformator

The goal of this class is to format the stored procedure source code which comes from Netezza. For example, this nicely formatted stored procedure: CREATE OR REPLACE PROCEDURE num() RETURNS BOOL LANGUAGE NZPLSQL AS BEGIN_PROC DECLARE n NUMERIC; BEGIN n := 2147483647; RAISE NOTICE 'n is %', n; n := 2147483647 + 1; RAISE NOTICE 'n is %', n; n := 2147483647::numeric + 1; RAISE NOTICE 'n is %', n; n := 2147483647::bigint + 1; RAISE NOTICE 'n is %', n; n := 2147483647; n := n + 1; RAISE NOTICE 'n is %', n; END; END_PROC; comes out of the "proceduresource" column of the _v_procedure system table looking like this: CREATE OR REPLACE PROCEDURE num() RETURNS BOOL LANGUAGE NZPLSQL AS BEGIN_PROC /nDECLARE/n n NUMERIC; BEGIN/n n := 2147483647;RAISE NOTICE 'n is %', n;n := 2147483647 + 1;RAISE NOTICE 'n is %', n;n := 2147483647::numeric + 1;RAISE NOTICE 'n is %', n;n := 2147483647::bigint + 1;RAISE NOTICE 'n is %', n;n := 2147483647;n := n + 1;RAISE NOTICE 'n is %', n;END;END_PROC; (Just one long line)


Constructor Summary
NetezzaProcedureFormator(String stmtSep)
           
 
Method Summary
 String reformat(String in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetezzaProcedureFormator

public NetezzaProcedureFormator(String stmtSep)
Method Detail

reformat

public String reformat(String in)
Specified by:
reformat in interface ICodeReformator
See Also:
ICodeReformator.reformat(java.lang.String)


Copyright © 2001-2013. All Rights Reserved.