VFP 愛用者社區 首頁 VFP 愛用者社區
本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
 
 常見問題常見問題   搜尋搜尋   會員列表會員列表   會員群組會員群組   會員註冊會員註冊 
 個人資料個人資料   登入檢查您的私人訊息登入檢查您的私人訊息   登入登入

cursor 能join嗎?
前往頁面 上一頁  1, 2
 
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區
上一篇主題 :: 下一篇主題  
發表人 內容
garfield
Site Admin


註冊時間: 2003-01-30
文章: 2157


第 16 樓

發表發表於: 星期二 五月 02, 2006 2:01 am    文章主題: 引言回覆

在我的vfp裡是不須要用 NOFILTER 就可以正確執行,
我猜可能是某個設定值所影響,
但試不出來是那個設定值.

_________________
利用>>搜尋<<的功能會比問的還要快得到答案.
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件
小賴



註冊時間: 2004-12-27
文章: 470


第 17 樓

發表發表於: 星期二 五月 02, 2006 8:53 am    文章主題: 引言回覆

這裹有答案 ; 可惜是英文
http://www.ml-consult.co.uk/foxst-09.htm
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件
小賴



註冊時間: 2004-12-27
文章: 470


第 18 樓

發表發表於: 星期二 五月 02, 2006 9:22 am    文章主題: 引言回覆

總算了解 !
依該文指示, 如果第一個select符合下列三個條件

(i) it is based on a single table;
(ii) it contains no calculated fields;
(iii) it is fully Rushmore optimisable.

VFP將不產生臨時表, 此時就必須使用NOFILTER參數
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件
syntech



註冊時間: 2003-05-16
文章: 4212
來自: Taipei,Taiwan

第 19 樓

發表發表於: 星期二 五月 02, 2006 9:37 am    文章主題: 引言回覆

章立民 中文程式設計---應用實務篇 6.X
PAGE 8-17

代碼:

如果您希望將某一查詢結果的Cursor作為另外一道SQL SELECT 命令的查詢來源,
必須於希望作為查詢來源之INTO CURSOR引數中插入關鍵字 NOFILTER,
然不諱言,由於插入關鍵字NOFILTER後依會在磁碟中建立暫存檔,這會稍稍降低查詢的速度.


由VFP6HELP:
代碼:

CURSOR CursorName [NOFILTER], which stores query results in a cursor. If you specify the name of an open table, Visual FoxPro generates an error message. After SELECT is executed, the temporary cursor remains open and is active but is read-only. Once you close this temporary cursor, it is deleted. Cursors may exist as a temporary file on the drive or volume specified by SORTWORK.
Include NOFILTER to create a cursor that can be used in subsequent queries. In previous versions of Visual FoxPro, it was necessary to include an extra constant or expression as a filter to create a cursor that could be used in subsequent queries. For example, adding a logical true as a filter expression created a query that could be used in subsequent queries:

SELECT *, .T. FROM customers INTO CURSOR myquery

Including NOFILTER can reduce query performance because a temporary table is created on disk. The temporary table is deleted from disk when the cursor is closed.



由VFP7HELP:
代碼:

CURSOR CursorName [NOFILTER | READWRITE], which stores query results in a cursor. If you specify the name of an open table, Visual FoxPro generates an error message. After SELECT is executed, the temporary cursor remains open and is active but is read-only. Once you close this temporary cursor, it is deleted. Cursors may exist as a temporary file on the drive or volume specified by SORTWORK.
Include NOFILTER to create a cursor that can be used in subsequent queries. In previous versions of Visual FoxPro, it was necessary to include an extra constant or expression as a filter to create a cursor that could be used in subsequent queries. For example, adding a logical true as a filter expression created a query that could be used in subsequent queries:

SELECT *, .T. FROM customers INTO CURSOR myquery
Including NOFILTER can reduce query performance because a temporary table is created on disk. The temporary table is deleted from disk when the cursor is closed.

The READWRITE clause specifies that the cursor is temporary and modifiable.


由VFP9HELP:
代碼:

NOFILTER creates a cursor that can be used in subsequent queries.

Note 
Including NOFILTER can reduce query performance because it creates a temporary table on disk. When the cursor is closed, the temporary table is deleted from disk.

READWRITE specifies that the temporary cursor is modifiable. If the source table or tables use auto-incrementing, the cursor created with READWRITE does not inherit those settings. You can create more than one structural index on a cursor using the READWRITE argument.
 


INTO CURSOR 所產生的通常是READONLY的,
只有在真正在磁碟中建立暫存檔時,才有機會再利用為其他CURSOR的來源.
這是章立民先生在書中的說法.

VFP6 的HELP提示如果不使用NOFILTER,
就作一個假欄位逼使VFP會建立一個實體暫存檔.

_________________
如果公司有下列困擾:
1. 找不到便宜,快速,簡易的 生產排程軟體
2. 不知道如何快速排定 採購計劃
3. 成本抓不準,自己算比軟體算有用
4. 想學習系統規劃,想找系統架構的顧問

請聯絡我們,也許我們幫得上忙
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件 AIM Address
區榮熾



註冊時間: 2005-11-14
文章: 191


第 20 樓

發表發表於: 星期四 五月 04, 2006 5:51 pm    文章主題: CURSOR 的種類有二種..... 引言回覆

小賴 寫到:
第一次閱讀有關NOFILTER參數是在
章立民 中文程式設計---應用實務篇 6.X
PAGE 8-17 看到

Syntech兄你有這本書, 能不能談談測試結果 ?
只有朱兄和Syntech兄回應; 是大家都不會有這個問題 ?
還是我反應了一個笨問題 ?


在VFP6 的CURSOR 有二種, 可以像table一樣的操作並寫入硬碟,另一種則不可以.
Create Cursor ......是可以的.....要怎樣操作都可以(僅限該程式(序)),但不寫入硬碟.
INTO Cursor ......不可以的.(可以Brows)
所以當要將Select後續要如何時,就請先選擇好 CURSOR的種類,以利程式進行..
回頂端
檢視會員個人資料 發送私人訊息
從之前的文章開始顯示:   
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區 所有的時間均為 台北時間 (GMT + 8 小時)
前往頁面 上一頁  1, 2
2頁(共2頁)

 
前往:  
無法 在這個版面發表文章
無法 在這個版面回覆文章
無法 在這個版面編輯文章
無法 在這個版面刪除文章
無法 在這個版面進行投票
無法 在這個版面附加檔案
無法 在這個版面下載檔案


Powered by phpBB © 2001, 2005 phpBB Group
正體中文語系由 phpbb-tw 維護製作