- 論壇徽章:
- 0
|
我的一個plpgsql程序,我想讓一個字段的值in我輸入的字符串中.但是我不知怎么寫才能生效.我的部份程序是這樣的.
begin
open cur1 for select * from ddxx where dd_jgh in (i_jgh) ;
fetch cur1 into dd;
if not found then
raise NOTICE '%',i_jgh;
return -1;
end if;
.........
其中第二行的i_jgh 是我傳進(jìn)來的,我是這樣運(yùn)行的
select test($$00000,00001$$)不行,找不到
select test($$'00000','00001'$$)也一樣
select test($$'00000,00001'$$)都不行.
我定義的輸入類型是varchar ,
我把那行程序改為
open cur1 for select * from ddxx where dd_jgh in ('00000','00001') ;
就好使!唉,新手求助
我該怎么辦才能讓其好用呀.(是我輸入的數(shù)據(jù)類型不對,還是什么其他的原因......,我不想構(gòu)造動態(tài)SQL語句,謝謝)
[ 本帖最后由 wkl 于 2007-12-9 18:53 編輯 ] |
|