天天看點

NULL和INITIAL的差別 and database interface

在用INSERT語句往database table裡插入entry時,對于description field(CHAR類型的),如果 不指定任何value,和手動給該field assign value 類似

Ls-description = space, 這兩種情況插入到database後的效果一樣麼?

搞清楚SE11裡這個勾是拿來做什麼的?

如果table structure append了一個新的structure,那麼後面append的對應的字段就會為NULL。就是下面這個link上有個人回複的。我覺得,前半部分是make sense的,但是,他說,這個is null隻在where 語句中有效,如果是資料已經選取出來了,放在了internal table裡面了,那麼就都是initial了。。。

[外鍊圖檔轉存失敗(img-e14KI5kJ-1563802589007)(https://user-images.githubusercontent.com/5669954/32713336-cd09cb64-c883-11e7-95b2-f9db76f1743b.png)]

關于NULL和INITIAL的,做了個實驗:

建立一個新的database table:

[外鍊圖檔轉存失敗(img-V4r9ftA0-1563802589008)(https://user-images.githubusercontent.com/5669954/32713338-cd3e92a4-c883-11e7-8231-d393dd17d8e3.png)]

插入兩條資料:

[外鍊圖檔轉存失敗(img-pHrG2dkZ-1563802589008)(https://user-images.githubusercontent.com/5669954/32713339-cd75812e-c883-11e7-93e4-e1c7bf52fcc4.png)]

插入一個include structure, initial value未勾上:

[外鍊圖檔轉存失敗(img-zNwgxUhc-1563802589009)(https://user-images.githubusercontent.com/5669954/32713340-cdae61ba-c883-11e7-9ae1-1ecc1333919d.png)]

測試:

[外鍊圖檔轉存失敗(img-zdUUZm66-1563802589009)(https://user-images.githubusercontent.com/5669954/32713341-cde1c424-c883-11e7-8628-0c9e24433639.png)]

執行結果:

[外鍊圖檔轉存失敗(img-rKP2l2rV-1563802589010)(https://user-images.githubusercontent.com/5669954/32713342-ce186a74-c883-11e7-958d-5b6d0409c110.png)]

[外鍊圖檔轉存失敗(img-fpCotxAj-1563802589010)(https://user-images.githubusercontent.com/5669954/32713343-ce5025d6-c883-11e7-8721-256b3e8d7a4f.png)]

注:

NULL和INITIAL的差別 and database interface

我猜想“在HANA studio裡觀察preview的結果”和“在ABAP裡使用open SQL将資料取回internal table裡”,這兩件事不是一回事吧?

ABAP裡 寫代碼去database server取資料要通過database interface:http://help.sap.com/saphelp_nw04s/helpdata/en/fc/eb3976358411d1829f0000e829fbfe/content.htm