1

Konu: left join de .Null. problemi

Herkese Merhabalar,

WITH ThisForm.locatorgrid2
.csql = "crsh.fisno,crsh.kod,crsh.giris,crsh.cikis,firma.firma,crsh.sipno,crsh.irsaliye, "+;
"crsh.tarihirs,crsh.fiyat,crsh.emirno,crsh.sevkno,crsh.tur,crsh.ckod "+;
"FROM crsh left join firma on crsh.ckod=firma.ckod order by fisno"
.init()
.Width = 950
.Height = 480
.columncount = 13
.visible = .t.
ENDWITH

Şeklinde bir kod yazdım , çalışıyor ama ckod hanesi boş olan yerler de (.Null.)yazıyor , .Null yerine o satırlarda birşey yazmaması için ne yapmalıyım ?

şimdiden herkese teşekkür ederim,

Kader, beyaz kağıda sütle yazılmış yazı
Elindeyse beyazdan, gel de sıyır beyazı. (NFK)

2

Re: left join de .Null. problemi

tarik yazdı:

Herkese Merhabalar,

WITH ThisForm.locatorgrid2
.csql = "crsh.fisno,crsh.kod,crsh.giris,crsh.cikis,firma.firma,crsh.sipno,crsh.irsaliye, "+;
"crsh.tarihirs,crsh.fiyat,crsh.emirno,crsh.sevkno,crsh.tur,crsh.ckod "+;
"FROM crsh left join firma on crsh.ckod=firma.ckod order by fisno"
.init()
.Width = 950
.Height = 480
.columncount = 13
.visible = .t.
ENDWITH

Şeklinde bir kod yazdım , çalışıyor ama ckod hanesi boş olan yerler de (.Null.)yazıyor , .Null yerine o satırlarda birşey yazmaması için ne yapmalıyım ?

şimdiden herkese teşekkür ederim,


NVL() kullan .cSQL satirini asagidaki degistir

Visual Fox Pro
.csql = "crsh.fisno,crsh.kod,crsh.giris,crsh.cikis,firma.firma,crsh.sipno,crsh.irsaliye, "+;

"crsh.tarihirs,crsh.fiyat,crsh.emirno,crsh.sevkno,crsh.tur,NVL(crsh.ckod,"") AS ckod "+;
"FROM crsh left join firma on crsh.ckod=firma.ckod order by fisno"

3

Re: left join de .Null. problemi

set nulldisp to ""
komutu da bir çözüm

Haksızlıklar karşısında susanlar, dilsiz şeytanlardır!
www.metinemre.com

4

Re: left join de .Null. problemi

sorumda bir hata var özür dilerim ckod hanesi boş olan satırlarda firma yerine .Null. yazıyor

.csql = "crsh.fisno,crsh.kod,crsh.giris,crsh.cikis,NVL(firma.firma,"")as firma,crsh.sipno,crsh.irsaliye, "+;
"crsh.tarihirs,crsh.fiyat,crsh.emirno,crsh.sevkno,crsh.tur,crsh.ckod "+;
"FROM crsh left join firma on crsh.ckod=firma.ckod order by fisno"

şeklinde yazdım ama syntax error veriyor

Kader, beyaz kağıda sütle yazılmış yazı
Elindeyse beyazdan, gel de sıyır beyazı. (NFK)

5

Re: left join de .Null. problemi

set nulldisp to ""
sorunu çözdü
teşekkür ederim

Kader, beyaz kağıda sütle yazılmış yazı
Elindeyse beyazdan, gel de sıyır beyazı. (NFK)

6

Re: left join de .Null. problemi

tarik yazdı:

sorumda bir hata var özür dilerim ckod hanesi boş olan satırlarda firma yerine .Null. yazıyor

.csql = "crsh.fisno,crsh.kod,crsh.giris,crsh.cikis,NVL(firma.firma,"")as firma,crsh.sipno,crsh.irsaliye, "+;
"crsh.tarihirs,crsh.fiyat,crsh.emirno,crsh.sevkno,crsh.tur,crsh.ckod "+;
"FROM crsh left join firma on crsh.ckod=firma.ckod order by fisno"

şeklinde yazdım ama syntax error veriyor


Visual Fox Pro
NVL(firma.firma,"") as firma

seklinde dene

7

Re: left join de .Null. problemi

Tarik,
" .... Nvl(firma.firma,'') as Firma ... "

Cift tirnaklar arasinda ikinci kez cift tirnak kullanmissin.
Bu arada bence de "set nulldisplay" daha iyi ve basit bir cozum.

8

Re: left join de .Null. problemi

Bu arada ben kolaylik olsun diye soyle yapiyorum ( Form.Init kod ornegi ):

Visual Fox Pro
Local lcSQL

Text to m.lcSQL noshow
Select customer.*, orders.order_date ;
      from customer ;
      left join orders on customer.cust_id = orders.cust_id ;
      order by customer.Company, orders.order_date descending
EndText
With this.locatorGrid1
   .cSQL     = ;
      Substr(Alltrim(Chrtran(m.lcSQL,Chr(9)+';'+Chr(13)+Chr(10),Space(2))),Len('select')+2)
   .Init()
endwith


Avantaji kodu yazarken text...endtext arasini secip right clickle "Execute selection" ile hatam var mi, istedigim bu mu vs kontrol edebiliyorum.

9

Re: left join de .Null. problemi

Tarik,
Kucuk sinav:) - Tum FoxyClasses kullanicilarina.

Visual Fox Pro
Public oForm

oForm = Createobject('myForm')
oForm.Show()
 
Define Class myForm As Form
  DataSession = 2
  Height = 400
  Width = 600
  Add Object myGrid As myGrid With Height = 400, Width = 600
 
  Procedure Load
    Use (_samples+'data\customer') In 0
    Use (_samples+'data\orders') In 0
  Endproc
 
  Procedure Init
    Local lcSQL
    TEXT to m.lcSQL noshow
Select customer.*, orders.order_date ;
      from customer ;
      left join orders on customer.cust_id = orders.cust_id ;
      order by customer.Company, orders.order_date descending
    ENDTEXT
    With This.myGrid
      .cSQL     = ;
        Substr(Alltrim(Chrtran(m.lcSQL,Chr(9)+';'+Chr(13)+Chr(10),Space(2))),Len('select')+2)
      .Init()
    Endwith
  Endproc
Enddefine
 
Define Class myGrid As "locatorgrid" Of "d:\FoxyClasses\Classes\Grids.vcx"
Enddefine

Bu kodda hicbir degisiklik yapmadan (Foxyclasses ve _samples folderlari disinda - gerekirse) sadece Country = USA olanlari nasil gosterirsin.

Ipucu: Soru locatorgridde var olmasina ragmen fark edilmeyen ozelliklerden biriyle ilgili:)

10

Re: left join de .Null. problemi

grid üzerinde right click
filter on this value kullanarak mı ?

Kader, beyaz kağıda sütle yazılmış yazı
Elindeyse beyazdan, gel de sıyır beyazı. (NFK)

11

Re: left join de .Null. problemi

Evet:) Bilinmedigini saniyordum:)