![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, I am new to U2 so please excuse me while I get my head around this paradigm shift from conventional RDMS. I am trying to list a subset of the customer records (eg Accountbalance>500) The Uniobject NET doco shows examples that read the entire db (in VB) us1 = UniObjects.OpenSession("localhost", "ZZZ", "xxxx", "HS.SALES", "uvcs") Dim sl As UniSelectList = us1.CreateUniSelectList(2) ' open customer file fl = us1.CreateUniFile("CUSTOMER") sl.Select(fl) Dim lLastRecord As Boolean = sl.LastRecordRead While Not (lLastRecord) Dim s As String = sl.Next() Console.WriteLine("Record ID:" + s) lLastRecord = sl.LastRecordRead End While ' read select list as string array sl.ClearList() sl.Select(fl) Dim str_array() As String = sl.ReadListAsStringArray() Dim uSet As UniDataSet = fl.ReadRecords(str_array) ' use for each statement to print the record Dim item As UniRecord For Each item In uSet Console.WriteLine(item.ToString()) Next item But I want only a limited number of records returned. In SQL this would be: Select Surname from Customer where AccountBalance>500 What is the corresponding action in U2? I thought it would ba a SlectList, but it appears the Selectlist only accepts a UniFile as a parameter. Do I use a UniCommand? If so then would someone provide me with an example of the syntax. Thanks Terry |
#3
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |