简体   繁体   English

AS400 SQL动态删除问题

[英]AS400 SQL Dynamic Delete issue

Some background... I have 20 + Files. 一些背景...我有20多个文件。
I read these file names from a prebuilt table building a subfile screen. 我从建立子文件屏幕的预建表中读取这些文件名。 I select 1 file then build another screen with the contents of file selected. 我选择一个文件,然后用所选文件的内容构建另一个屏幕。 I then select the record I want to delete, so far so good... 然后,我选择要删除的记录,到目前为止一切顺利。

eval      MySQL  = stat3 + %trimr(scrwcrd) + STAT3B   

my SQL Statement which reads in debug 我在调试中读取的SQL语句

MySQL =  DELETE FROM FILESEL WHERE K00001 = ? with NC 

PREPARE STAT3 from :MYSQL

EXECUTE STAT3 using :PROD   

where :prod is the variable supplied from Screen selection :prod是屏幕选择提供的变量

My sqlcod ends up at 100 with sqlstt = 2000 after the EXECUTE indicating ROW not found for Delete. 我的sqlcod在EXECUTE指示找不到删除的ROW后以sqlstt = 2000结束于100。 Now for a fact this is not the case. 现在事实并非如此。 I see the record on the file selected and I see the value of PROD using debug any ideas... 我看到了所选文件上的记录,并且看到了使用调试任何想法生成的PROD的值...

What datatypes and length are the K00001 field and :PROD host variable? K00001字段和:PROD主机变量是什么数据类型和长度?

Equality could be an issue. 平等可能是一个问题。 If they are character fields you may need to TRIM / %TRIM the values in order to match. 如果它们是字符字段,则可能需要对TRIM / %TRIM值进行匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM