Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我必须将日期类型的参数传递给子例程并在 where 子句中使用它。这是正确的方法吗? 我正在使用date='d_date';
date='d_date';
你需要使用glb_date = @d_date
glb_date = @d_date
首先,您需要更改参数在定义中的CREATE PROCEDURE定义方式,例如:
CREATE PROCEDURE
CREATE PROCEDURE prac ( @d_date in DATE )
注意@
@
然后更改您的WHERE子句以使用该变量:
WHERE
where glb_date= @d_date;