sqlServer数据库
<select id="checkTemplateScript" resultType="java.lang.Integer" databaseId="sqlserver">
SELECT COUNT(*) FROM SYSOBJECTS WHERE ID = OBJECT_ID(#{processName,jdbcType=VARCHAR}) AND OBJECTPROPERTY(ID, 'ISPROCEDURE')=1;
</select>
Oracle数据库
<select id="checkTemplateScript" resultType="java.lang.Integer" databaseId="oracle">
SELECT COUNT(*) FROM Dba_Objects WHERE owner = #{dbName,jdbcType=VARCHAR} AND object_type ='PROCEDURE' AND OBJECT_NAME=#{processName,jdbcType=VARCHAR};
</select>
查询数据中是否存在某名称的存储过程
最新推荐文章于 2022-05-25 01:51:45 发布