The primary functionality of the CData ADO.NET Provider for UPS lies in its stored procedures, which interact directly with the available services for UPS. However, many of these stored procedures rely on information stored in the provider's tables. These tables must be populated by the user and will contain all of the information that certain stored procedures will need. Among the most important stored procedures that will rely on these tables are CalculateRates, GenerateLabels, GenerateReturnLabels, and SchedulePickup. Among the tables that the stored procedures will rely on are Senders, Recipients, Packages, and Shipments. See the queries below for an example of some basic preparation needed for use of the GenerateLabels stored procedure:
INSERT INTO Senders (SenderId, FirstName, LastName, Company, Phone, Address1, City, State, ZipCode, CountryCode) VALUES (1, 'John', 'Doe', 'Sample Company', '919-544-7070', '5007 southpark Drive', 'Chapel Hill', 'NC', '27713', 'US') INSERT INTO Recipients (RecipientId, FirstName, LastName, Company, Phone, Address1, City, State, ZipCode, CountryCode) VALUES (1, 'Jane', 'Smith', 'Sample Company', '336-111-0377', '4 New York Plaza', 'New York', 'NY', '10004', 'US') INSERT INTO Packages (PackageId, PackagingType, Weight, Length, Width, Height) VALUES (1, 'YOURPACKAGING', 34.3, 48, 24, 12) INSERT INTO Packages (PackageId, PackagingType, Weight, Length, Width, Height) VALUES (2, 'YOURPACKAGING', 13.37, 24, 24, 24) INSERT INTO Shipments (ShipmentId, SenderId, RecipientId, PackageId) VALUES (1, 1, 1, '1,2')
Once the needed input data is present, one can execute a stored procedure like GenerateLabels by running an Execute statement. The example below will use the data provided in earlier insert examples:
EXECUTE GenerateLabels ServiceType = 'Ground', ShipmentId = 1
In addition to the input tables are tables that will accumulate the output of subsequent runs of a stored procedure. Among these tables are LabelHistory, RateHistory, and TrackHistory. A user may query these tables at any time to review the contents of successful stored procedures. Additionally, a user may join them with related a input table such as Recipients or Packages.
All of the tables will be stored in an underlying database in the local machine. The database's exact location will be determined by the CacheConnection connection property. For more information on all of the available tables, stored procedures, and the relationships between them, see the データモデル.