pb9.0 在代码中写SQL语句,用于查某一字段,但语法有误

2024-11-16 17:41:40
推荐回答(2个)
回答1:

把代码贴上来

假如赋值字符串
string ls_result
select clo_result into :ls_result from table_name where id =:id;
if sqlca.sqlcode = -1 then
//错误
elseif sqlca.sqlcode = 100 then
//没有找到
else
//正确
end if
这样 ls_result里面有结果

回答2:

select a.TID,b.SName as name1,c.SName as name2,d.SName as name3 from stuTest a inner join stuName b on a.name1=b.SID inner join stuName c on a.name2=c.SID inner join stuName d on a.name3=d.SID以上,希望对你有所帮助!