| 发表于:2007-11-29 10:34:134楼 得分:0 |
我在plc 里面测试也没有问题,可能是你的程序里面标记符号的问题, 注意 结束符等 strcpy(id,"101"); strcpy(name,"null"); EXEC sql select count(*) into :inum from t_log where p_id=:id and action = case :name when 'null' then action else :name end ; printf("case 1 inum=%2d\n",inum); strcpy(id,"101"); strcpy(name,"insert"); EXEC sql select count(*) into :inum from t_log where p_id=:id and action = case :name when 'null' then action else :name end ; printf("case 2 inum=%2d\n",inum); 运行结果: case 1 inum= 3 case 2 inum= 1 | | |
|