备忘:axapta view

axapta view 原来是生成sql 的视图
但有个问题折腾了n久,就是我有几个条件是不等于0(因为ax的real字段默认是插入0值的)
写了
!0
'(startCartonNo<>0)'
'!0'
期间还忘了写成什么,导致aos 崩溃:)

后来,很简单,原来是!=0
这样,生成的sql是
not ((startCartonNo=0))


补充几点
1. view 是只读的
sql server的有些视图是可以更新的,兼容oracle的代价??
2. 在发现aggregate 的一些功能时有些字段可以,有些字段就不可以,提示属性值非法,不清楚是怎么回事情
在ax 2009文档中发现

To use the aggregation functions of COUNT, AVG, or SUM, the data field must be a data type of Integer or Real. If you try to use one of these aggregation functions on a field of any other data type, you will receive an error.

这难道是兼容oracle的代价,要知道count 本身对于sql server而言没这个限制,不过我没用过 oracle,不知道这是不是oracle的限制
3. 仅支持inner join
In Microsoft Dynamics AX, views support only inner joins
这又是比较郁闷的一点
4. 仅字段级


而且,view的生成也不能符合需求,比方说有a,b,c 三个表, view生成的是a inner join b on a.x=b.x inner join c on b.x=c.x,但实际上我需要的是 a inner join b on a.x=b.x inner join c a.x=c.x. 其实ax的select 也是有如此的限制的, 在query构造时,每个datasource下也一般只能放一个子datasource ,目前我测试的代码如果放二个就会有些问题

你可能感兴趣的:(view)