java调用存储过程返回数字

<select id="jimuReportNumber" resultType="java.lang.Integer">
        exec jimu_report_number #{reportIdPdf}
    select>
ALTER PROCEDURE [dbo].[jimu_report_number]
  @reportId AS varchar(32) 
AS
BEGIN
		create table #tmp(
		number int
	)

	DECLARE @sqlMain NVARCHAR(4000)

	-- routine body goes here, e.g.
	-- SELECT 'Navicat for SQL Server'
	SELECT @sqlMain = db_dyn_sql FROM jimu_report_db WHERE jimu_report_id = @reportId and db_ch_name = 'ao'
	insert into #tmp execute sp_executesql @sqlMain
	select number from  #tmp
END

你可能感兴趣的:(java,数据库,开发语言)