如何使用 sqlapi 执行简单查询++与神谕

发布于 2024-09-03 02:11:55 字数 241 浏览 4 评论 0原文

这是代码:

cmd1.setCommandText("select * from lp. human_tb_meta_sex"); cmd1.执行();

while (cmd1.FetchNext()) { SAString sas=cmd1.Field("id").asString(); cout<<"sas id:"<

它给了我 ORA-00932 错误...我不知道为什么..?

here is the code:

cmd1.setCommandText("select * from lp.human_tb_meta_sex");
cmd1.Execute();

while (cmd1.FetchNext())
{
SAString sas=cmd1.Field("id").asString();
cout<<"sas id:"<

it gave me ORA-00932 error...I dont know why..?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花桑 2024-09-10 02:11:55

据推测“id”是主键。

如果它在数据库中定义为数字,则可能包含分数(例如 3.5)。

如果将其定义为 NUMBER(10,0) 那么它将始终是整数。

由于您试图将其作为字符串 [.asString()] 取出,因此可能会出现转换问题。

Presumably "id" is the primary key.

If it is defined as a NUMBER in the database, that could include fractions (eg 3.5).

If you define it as NUMBER(10,0) then it will always be an integer.

Since you are trying to pull it out as a String [.asString()] there could be a conversion issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文