发帖
 找回密码
 立即注册
搜索
14 0 0

flexsim 与odbc数据库之间SQL查询的咨询

技术交流2 14 14 2013-11-23 14:11:40
各位高手,我用SQL模式查询数据库时,如何返回查询的特定值啊?

目前我能做的只是
dbsqlquery(“select * from database”);
查询全部数据,

我希望的是能够返回一个字段的字符串,即用下面的语句返回一个值
string age=dbsqlquery(“select age from database where name=‘zhangsan’”);

结果我运行时,age=“select age from database where name=‘zhangsan’”
然后我定义为 int age=****
运行结果为: age=1

不理解,正确的方法应该是什么啊?
──── 0人觉得很赞 ────
2013-11-25 15:25:02
有谁用过吗?期待給与参考意见啊
2013-11-25 15:57:28
[b] [url=http://www.flexsim.asia/redirect.php?goto=findpost&pid=11190&ptid=4255]2#[/url] [i]missman[/i] [/b]


昝工,稍后我会让工程师尽快回复这个问题~
2013-11-25 16:40:42
[b] [url=http://www.flexsim.asia/redirect.php?goto=findpost&pid=11190&ptid=4255]2#[/url] [i]missman[/i] [/b]


昝工,您好,刚刚咨询部那边回复我,说您可以在菜单栏上-视图-最下面的“当前数据库表格”中查询,您尝试一下,有什么问题继续联系我,谢谢
2013-11-26 13:20:15
[b] [url=http://www.flexsim.asia/redirect.php?goto=findpost&pid=11192&ptid=4255]4#[/url] [i]shadowwind[/i] [/b]


好的,谢谢汪总。

确认后再咨询。
2013-12-7 10:56:03
[b] [url=http://www.flexsim.asia/redirect.php?goto=findpost&pid=11192&ptid=4255]4#[/url] [i]shadowwind[/i] [/b]


汪总,我看了,还是没有办法,具体请参考图片

备注:数据库中我的数据都为字符型。

拜托帮帮忙啊

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
2013-12-7 11:35:11
高手云集,继续跟进
2013-12-9 07:55:39
求高手
2013-12-11 16:51:49
自己顶一下。不能沉了啊
2013-12-12 08:07:37
以下是从官方技术支持处获取的回复,希望与大家分享。

When using the dbsqlquery() command with a SQL Select statement, the result does not return anything useful.  Instead, the query result is stored in memory and can be accessed using the dbgettablecell() command.  Since it looks like you are only retrieving a result with one row and one column, you can do something like this:

dbsqlquery("select...");
double c = stringtonum(dbgettablecell(1,1));

Or if you want to keep it as a string, you can do this:

dbsqlquery("select...");
string d = dbgettablecell(1,1);
您需要登录后才可以回帖 立即登录
高级模式
12下一页
技术交流2
热门问答
查看更多
1
Flexsim初级建模工程师水平标准
Flexsim初级建模工程师水平标准
62
234
2
无意中找到的资料,非常适合于初学者
无意中找到的资料,非常适合于初学者
47
229
3
厂区生产线布局优化案例!新做的!
厂区生产线布局优化案例!新做的!
46
224
4
flexsim中文教程,pdf文档已整理-重新整理
flexsim中文教程,pdf文档已整理-重新整理
37
114
5
流水作业线的仿真
流水作业线的仿真
36
83
博主榜
+ 5