ADOQUERY执行ORACLE数据库查询的问题

Kevin928 2005-08-11 07:49:22
有这么一段代码
with Form1.OracleQuery do
begin
if Form1.OracleConnection.Connected then
begin
Close;
SQL.Clear;
SQL.Add('select count(*) from cu_exch where bank_cd=800');
Open;
Form1.Edit1.Text := inttostr(Recordcount);
SQL.Clear;
SQL.Add('select count(*) from cu_exch');
Open;
Form1.Edit2.Text := Fields[0].AsString;
end;
end;
第一个SQL语句不能成功执行,提示ORA-00937:not a single-group group function;但是在sqlplus下面可以执行;第二个SQL语句却能够执行,和第一个相比只是少了条件;我连数据库用的ADOconnection
字串Provider=MSDAORA.1;Password=oracle;User ID=bank;Data Source=db_develop;Persist Security Info=True;
高手麻烦帮我看看,愁死了。。
...全文
85 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kevin928 2005-08-12
  • 打赏
  • 举报
回复
回楼上,是整形,所以才觉得奇怪,因为用select * from cu_exch where bank_cd=800;或者select count(*) from cu_exch;都没有问题
zsjzwj 2005-08-11
  • 打赏
  • 举报
回复
SQL.Add('select count(*) from cu_exch where bank_cd=800');
你的bank_cd字段是不是数值型呀,不是当然错了

2,497

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧