Select_Fonksiyonları
Select Fonksiyonları
Select1 / SelectDB
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - tableName (String): Tablo adı
- - fieldName (String): Alan adı
- - operator (String): Operatör (=, >, <, vb.)
- - value (String): Değer
- - options (Integer): Seçenekler
- Açıklama: Tek koşulla veritabanından kayıt seçer
Örnek Kullanım:
Sub Makro1()
Dim RS
' STOK00 tablosundan KOD = "STOK001" olan kayıtları seç
Set RS = Doc.Select1("STOK00", "KOD", "=", "STOK001", 0)
If Not RS Is Nothing Then
If Not RS.EOF Then
Doc.MsgBox "Stok Adı: " & RS("AD")
End If
Set RS = Nothing
End If
End Sub
Select2 / SelectRS
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Rowset'ten kayıt seçer
Örnek Kullanım:
Sub Makro1()
Dim RS
Set RS = Doc.Select2("__STOK70T_CONTROL__12345__", "STOK70T", "COMBINE_GROUP_VAL='ABC'", "", -1)
If Not RS Is Nothing Then
RS.MoveFirst
Do While Not RS.EOF
Doc.MsgBox "Kayıt: " & RS("KOD")
RS.MoveNext
Loop
Set RS = Nothing
End If
End Sub
Select3 / SelectRSNF
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Rowset'ten kayıt seçer (no form)
Örnek Kullanım:
Sub Makro1()
Dim RS
Set RS = Doc.Select3("TMP_TABLE", "STOK40T", "AKTIF=1", "KOD", 100)
If Not RS Is Nothing Then
Doc.MsgBox "Kayıt sayısı: " & RS.RecordCount
Set RS = Nothing
End If
End Sub
Select1G / SelectDBG
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - groupbystring (String): Gruplama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Gruplama ile veritabanından kayıt seçer
Örnek Kullanım:
Sub Makro1()
Dim RS, Kriter
Kriter = "AKTIF=1"
Set RS = Doc.Select1G("ABC001", "BRDR1TP2", Kriter, "", "KANUNNO,KOD", -1)
If Not RS Is Nothing Then
RS.MoveFirst
Do While Not RS.EOF
Doc.MsgBox "Grup: " & RS("KANUNNO") & " - " & RS("KOD")
RS.MoveNext
Loop
Set RS = Nothing
End If
End Sub
Select2G / SelectRSG
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - groupbystring (String): Gruplama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Gruplama ile rowset'ten kayıt seçer
Örnek Kullanım:
Sub Makro1()
Dim RS
Set RS = Doc.Select2G("TMP_RS_UBLINV1THP_GB", "UBLINV1THP", "*", "", "THU_ID", -1)
If Not RS Is Nothing Then
RS.MoveFirst
Do While Not RS.EOF
Doc.MsgBox "Grup: " & RS("THU_ID")
RS.MoveNext
Loop
Set RS = Nothing
End If
End Sub
Select3G / SelectRSNFG
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - groupbystring (String): Gruplama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Gruplama ile rowset'ten kayıt seçer (no form)
Örnek Kullanım:
Sub Makro1()
Dim RS
Set RS = Doc.Select3G("TMP_GROUP", "STOK40T", "AKTIF=1", "KOD", "DEPO_KODU", 100)
If Not RS Is Nothing Then
Doc.MsgBox "Gruplu kayıt sayısı: " & RS.RecordCount
Set RS = Nothing
End If
End Sub
Select1G_Cached / SelectDBG_Cached
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - groupbystring (String): Gruplama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- - kriterstring_Cache_Icin (String): Cache için kriter string'i
- Açıklama: Cache'li gruplama ile veritabanından kayıt seçer
Örnek Kullanım:
Sub Makro1()
Dim RS
Set RS = Doc.Select1G_Cached("CACHE_TABLE", "STOK00", "AKTIF=1", "KOD", "DEPO_KODU", -1, "AKTIF=1")
If Not RS Is Nothing Then
RS.MoveFirst
Do While Not RS.EOF
Doc.MsgBox "Stok: " & RS("KOD")
RS.MoveNext
Loop
Set RS = Nothing
End If
End Sub
Select2G_Cached / SelectRSG_Cached
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - groupbystring (String): Gruplama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- - kriterstring_Cache_Icin (String): Cache için kriter string'i
- Açıklama: Cache'li gruplama ile rowset'ten kayıt seçer
Örnek Kullanım:
Sub Makro1()
Dim RS
Set RS = Doc.Select2G_Cached("CACHE_TABLE", "STOK40T", "*", "", "DEPO_KODU", -1, "*")
If Not RS Is Nothing Then
Doc.MsgBox "Cache'li gruplu kayıtlar yüklendi"
Set RS = Nothing
End If
End Sub
Select3G_Cached / SelectRSNFG_Cached
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - groupbystring (String): Gruplama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- - kriterstring_Cache_Icin (String): Cache için kriter string'i
- Açıklama: Cache'li gruplama ile rowset'ten kayıt seçer (no form)
Örnek Kullanım:
Sub Makro1()
Dim RS
Set RS = Doc.Select3G_Cached("CACHE_TABLE", "STOK40T", "AKTIF=1", "KOD", "DEPO_KODU", 100, "AKTIF=1")
If Not RS Is Nothing Then
Doc.MsgBox "Cache'li kayıt sayısı: " & RS.RecordCount
Set RS = Nothing
End If
End Sub
Select1_ForUpdate / SelectDB_ForUpdate
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Güncelleme için veritabanından kayıt seçer
Örnek Kullanım:
Sub Makro1()
Dim RS, C_Gecici_TabloAdi
C_Gecici_TabloAdi = "TMP_BORDROK"
Set RS = Doc.Select1_ForUpdate(C_Gecici_TabloAdi, "BORDROK", "KESYDM='Y'", "", -1)
If Not RS Is Nothing Then
RS.MoveFirst
Do While Not RS.EOF
RS("DURUM") = "GÜNCELLENDI"
RS.Update
RS.MoveNext
Loop
Set RS = Nothing
End If
End Sub
Select2_ForUpdate / SelectRS_ForUpdate
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Güncelleme için rowset'ten kayıt seçer
Örnek Kullanım:
Sub Makro1()
Dim RS
Set RS = Doc.Select2_ForUpdate("TMP_UPDATE", "STOK40T", "AKTIF=1", "KOD", -1)
If Not RS Is Nothing Then
RS.MoveFirst
Do While Not RS.EOF
RS("AKTIF") = 0
RS.Update
RS.MoveNext
Loop
Set RS = Nothing
End If
End Sub
Select3_ForUpdate / SelectRSNF_ForUpdate
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Güncelleme için rowset'ten kayıt seçer (no form)
Örnek Kullanım:
Sub Makro1()
Dim RS
Set RS = Doc.Select3_ForUpdate("TMP_UPDATE", "STOK40T", "AKTIF=1", "", 100)
If Not RS Is Nothing Then
RS.MoveFirst
Do While Not RS.EOF
RS("DURUM") = "GÜNCELLENDI"
RS.Update
RS.MoveNext
Loop
Set RS = Nothing
End If
End Sub
Select1_Count / SelectDB_Count
- Dönüş Tipi: Integer
- Parametreler:
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Kayıt sayısını döndürür
Örnek Kullanım:
Sub Makro1()
Dim Kriter, KayitSayisi
Kriter = "BATCH_VOUCHERNO='FIS001'"
KayitSayisi = Doc.Select1_Count("SESS001E", Kriter, -1)
Doc.MsgBox "Kayıt Sayısı: " & KayitSayisi
End Sub
Select2_Count / SelectRS_Count
- Dönüş Tipi: Integer
- Parametreler:
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Rowset'ten kayıt sayısını döndürür
Örnek Kullanım:
Sub Makro1()
Dim Kriter, KayitSayisi
Kriter = "AKTIF=1"
KayitSayisi = Doc.Select2_Count("STOK40T", Kriter, -1)
Doc.MsgBox "Rowset Kayıt Sayısı: " & KayitSayisi
End Sub
Select3_Count / SelectRSNF_Count
- Dönüş Tipi: Integer
- Parametreler:
- - queryTable (String): Kaynak tablo adı
- - kriterstring (String): Koşul string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Rowset'ten kayıt sayısını döndürür (no form)
Örnek Kullanım:
Sub Makro1()
Dim Kriter, KayitSayisi
Kriter = "AKTIF=1 AND DEPO_KODU='DEPO01'"
KayitSayisi = Doc.Select3_Count("STOK40T", Kriter, 100)
Doc.MsgBox "Kayıt Sayısı: " & KayitSayisi
End Sub
Select1_FL / SelectDB_FL
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - returnfields (String): Döndürülecek alanlar (örn: "KOD,AD" veya "*")
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Belirli alanlarla veritabanından kayıt seçer
Örnek Kullanım:
Sub Makro1()
Dim RS
Set RS = Doc.Select1_FL("TMP_RESULT", "STOK00", "KOD,AD,MIKTAR", "AKTIF=1", "KOD", -1)
If Not RS Is Nothing Then
RS.MoveFirst
Do While Not RS.EOF
Doc.MsgBox "Stok: " & RS("KOD") & " - " & RS("AD")
RS.MoveNext
Loop
Set RS = Nothing
End If
End Sub
Select1G_FL / SelectDBG_FL
- Dönüş Tipi: COM Object (Rowset)
- Parametreler:
- - resultTable (String): Hedef tablo adı
- - queryTable (String): Kaynak tablo adı
- - returnfields (String): Döndürülecek alanlar (örn: "KOD,AD" veya "*")
- - kriterstring (String): Koşul string'i
- - sortstring (String): Sıralama string'i
- - groupbystring (String): Gruplama string'i
- - maxrows (Integer): Maksimum satır sayısı (-1 = sınırsız)
- Açıklama: Belirli alanlarla ve gruplama ile veritabanından kayıt seçer
Örnek Kullanım:
Sub Makro1()
Dim RS, Kriter
Kriter = "AKTIF=1"
Set RS = Doc.Select1G_FL("TMP_GROUP", "STOK00", "KOD,AD,TOPLAM", Kriter, "KOD", "DEPO_KODU", -1)
If Not RS Is Nothing Then
RS.MoveFirst
Do While Not RS.EOF
Doc.MsgBox "Grup: " & RS("DEPO_KODU") & " - Stok: " & RS("KOD")
RS.MoveNext
Loop
Set RS = Nothing
End If
End Sub
SelectEQ
- Dönüş Tipi: Integer
- Parametreler:
- - tableName (String): Tablo adı
- - fieldName (String): Alan adı
- - value (String): Değer
- Açıklama: Eşitlik kontrolü yapar ve eşleşen kayıt sayısını döndürür
Örnek Kullanım:
Sub Makro1()
Dim EvrakNo, KayitSayisi
EvrakNo = "FIS001"
KayitSayisi = Doc.SelectEQ("STOK60E", "EVRAKNO", EvrakNo)
If KayitSayisi > 0 Then
Doc.MsgBox "Bulunan kayıt sayısı: " & KayitSayisi
Else
Doc.MsgBox "Kayıt bulunamadı"
End If
End Sub
Add2SelectCriteria
- Dönüş Tipi: Variant (String)
- Parametreler:
- - criteria1 (String): Mevcut kriter string'i
- - fieldName0 (String): Alan adı
- - sourceValueRowset (String): Kaynak rowset/tablo adı
- - criteriaType0 (String): Kriter tipi (BETWEEN_BE, EQUAL_FIELD, LIKE_FIELD, vb.)
- - criteriaFieldName (String): Kriter alan adı (boş olabilir)
- Açıklama: Select kriterlerine yeni kriter ekler ve yeni kriter string'ini döndürür
Örnek Kullanım:
Sub Makro1()
Dim Kriter
Kriter = ""
' Tarih aralığı kriteri ekle
Kriter = Doc.Add2SelectCriteria(Kriter, "SDATE10_LOCAL", "NOTFCTN2E", "BETWEEN_BE", "")
' Alan eşitlik kriteri ekle
Kriter = Doc.Add2SelectCriteria(Kriter, "DESPATCH_METHOD", "NOTFCTN2E", "EQUAL_FIELD", "CRI_DESPATCH_METHOD")
' LIKE kriteri ekle
Kriter = Doc.Add2SelectCriteria(Kriter, "DESPATCH_SUBJECT", "NOTFCTN2E", "LIKE_FIELD", "CRI_DESPATCH_SUBJECT")
Doc.MsgBox "Oluşturulan Kriter: " & Kriter
End Sub
---