[seasar-dotnet:1717] Re: [dbflute Procedure Generation Error]

kubo [E-MAIL ADDRESS DELETED]
2010年 6月 11日 (金) 04:34:27 JST


Good morning, thomas

I've got it! Thank you.
I remembered SQLServer's function
and it can return a table type.

I could get the same exception in my environment.
I'm surprised:

The method, getString("DATA_TYPE")
of DatabaseMetaData.getProcedureColumns(),
throws NumberFormatException from JDBC driver
(getInt("DATA_TYPE") throws NullPointerException)
if it's SQLServer's function that returns a table type.

Please use DBFlute-0.9.7.1-07-SNAPSHOT
which is fixed about it.
(if the Exception occurred, DBFlute ignores it)
And also DBFlute.NET-0.8.9.17-07-SNAPSHOT
is fixed about it.

By the way, I remembered how to call procedures through outside-SQL.
If a procedure has no OUT parameter, you can call like this:

https://www.seasar.org/svn/sandbox/dbflute/trunk/dbflute-sqlserver-example/src/main/resources/com/example/dbflute/sqlserver/dbflute/exbhv/various/vendorcheck/VendorCheckBhv_callProcReturnResultSetMore.sql
/= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
-- #df:entity#

-- !df:pmb!
-- !!String memberStatusCode:cls(MemberStatus)!!

SP_RETURN_RESULT_SET_MORE @statusCode=/*$pmb.memberStatusCode*/'WDL'
= = = = = = = = = =/

https://www.seasar.org/svn/sandbox/dbflute/trunk/dbflute-sqlserver-example/src/main/resources/com/example/dbflute/sqlserver/dbflute/exbhv/various/vendorcheck/VendorCheckBhv_selectSimpleTableFunction.sql
/= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
-- #df:entity#

-- !df:pmb!
-- !!String memberStatusCode:cls(MemberStatus)!!

select * from FN_RETURN_TABLE(/*pmb.memberStatusCode*/'FML')
= = = = = = = = = =/

https://www.seasar.org/svn/sandbox/dbflute/trunk/dbflute-sqlserver-example/src/test/java/com/example/dbflute/sqlserver/dbflute/topic/ProcedureTest.java
/= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
String path = VendorCheckBhv.PATH_various_vendorcheck_callProcReturnResultSetMore;
ProcReturnResultSetMorePmb pmb = new ProcReturnResultSetMorePmb();
pmb.setMemberStatusCode_Formalized();
Class<ProcReturnResultSetMore> entityType = ProcReturnResultSetMore.class;

ListResultBean<ProcReturnResultSetMore> memberList
    = vendorCheckBhv.outsideSql().selectList(path, pmb, entityType);

// If you don't use OUT parameter, you can call procedures like this.
// But you cannot get second result set. (first result set only)
= = = = = = = = = =/
/= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
String path = VendorCheckBhv.PATH_various_vendorcheck_callProcReturnResultSetMore;
SimpleTableFunctionPmb pmb = new SimpleTableFunctionPmb();
pmb.setMemberStatusCode_Formalized();
Class<SimpleTableFunction> entityType = SimpleTableFunction.class;

// ## Act ##
ListResultBean<SimpleTableFunction> memberList =
vendorCheckBhv.outsideSql().selectList(path, pmb, entityType);
= = = = = = = = = =/

However I didn't confirm it in DBFlute.NET environment.
(It works in DBFlute(Java) environment)


Thanks,
Kubo (jflute)


seasar-dotnet メーリングリストの案内