為什么下列代碼對(duì)數(shù)據(jù)庫進(jìn)行插入數(shù)據(jù),順序卻不對(duì)? [金字塔]
- 咨詢內(nèi)容:
代碼如下:
if kk then
BEGIN
if mark>0 then
tsell(1,lots,lmt,c-hd*mindiff),ORDERQUEUE; //如果有持多單則賣出
tbuyshort(1,lots,lmt,c-hd*mindiff),ORDERQUEUE;
if mark>0 then
dbexecute('insert into tradedetail(StockDate,StrId,StrName,StockCode,MyHoldings,OrderPrice,Operation) values (now(),"zzsd","pursuev2-if","IF",0,'+ numtostr(dynainfo(7),2) + ',"平多") ');
DBEXECUTE('update pursueextrem set remark=-1 where stockcode = "IF"');
dbexecute('insert into tradedetail(StockDate,StrId,StrName,StockCode,MyHoldings,OrderPrice,Direction,Operation) values (now(),"zzsd","pursuev2-if","IF",' + numtostr((-1)*lots,0) + ',' +numtostr(dynainfo(7),2) + ',' + numtostr(-1,0) + ',"開空")');
end;
此主題相關(guān)圖片如下:02191.png
此主題相關(guān)圖片如下:02192.png
- 金字塔客服:
數(shù)據(jù)庫的數(shù)據(jù)插入是有他自己的規(guī)則算法,不能保證一定是順序存放
如果你希望數(shù)據(jù)在調(diào)用時(shí)能夠按照順序,那么你應(yīng)該在數(shù)據(jù)庫中加入一個(gè)索引字段,比如ACCESS有自增的類型或者你自己通過數(shù)值相加的等等.在讀取數(shù)據(jù)庫數(shù)據(jù)時(shí),用SQL 的ORDER BY 排序語法讀取數(shù)據(jù)
- 用戶回復(fù):
哦,這樣啊,那請(qǐng)問一下,有沒有關(guān)于數(shù)據(jù)庫與Pel語言交互計(jì)算的相關(guān)規(guī)則的說明?
- 網(wǎng)友回復(fù): 沒有具體說明,遇到問題請(qǐng)隨時(shí)論壇提交
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 262069696 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容