130 likes | 256 Views
2009 Spring Conference Luis I. Gomez SQLISAM.EXE provided by Mills Enterprise. SQLISAM.EXE USING SQL DATA SOURCES in BR. Using SQL Data Sources in BR. ODBC and DSN data s ources SQL - What is it? Northwind.mdb Practical application “Custom Request” SQLISAM.exe – What is it?
E N D
2009 Spring Conference Luis I. Gomez SQLISAM.EXE provided by Mills Enterprise SQLISAM.EXEUSING SQL DATA SOURCES in BR
Using SQL Data Sources in BR • ODBC and DSN data sources • SQL - What is it? • Northwind.mdb • Practical application “Custom Request” • SQLISAM.exe – What is it? • CONTEXT.wb – What is it? • Solution using BR and SQLISAM
ODBC and DSN Data Sources • What is it? • (O)pen (D)ata(B)ase (C)onnectivity • Interface provided by MS Windows • Provides connectivity to many database engines • MS Access • SQL Server , Oracle • MySql, Firebird and many others • (D)atabase (S)ource (N)ame • The actual configuration mechanism in MS Windows • User DSN • System DSN
SQL - What is it? • Structured Query Language • Set of commands used to use a database • Examples: • Select CustomerID, CompanyName, Phone, Country, PostalCodefrom Customers • Select CustomerID, Freight, ExtendedPrice, Productname, OrderID, OrderDate, ShippedDatefrom Invoices where CustomerID = 'ALFKI‘ • Most modern languages use SQL commands.
Northwind.mdb • North Wind Traders • Fictitious company • Sample database provided by Microsoft • Available for MS Access and MS SQL
Northwind.mdb • Create a Northwind DSN (Windows XP) • [See Northwindfolder] • Control Panel • Administrative Tools • Data Sources (ODBC) • Select either User or System DSN • Click Add • Select Microsoft Access driver • Enter database details • Data source name = Northwind • Description = North Wind Traders • Click on “Select…” and find Northwind.mdb
Practical Application “Custom Request” • Application in Business Rules! • Northwinddatabase • Select a customer • Select … from Customers • Display customer demographics • Retrieve itemized order details • Select … from Invoices • Display grid containing order details
Practical Application “Custom Request” • Retrieve a list of all customers from “Customers” table. • Select CustomerID, CompanyName, Phone, Country, PostalCodefrom Customers.
Practical Application “Custom Request” • Retrieve a list of orders from “Invoices” query for selected customer (ALFKI). • Select CustomerID, Freight, ExtendedPrice,Productname, OrderID, OrderDate,ShippedDate from Invoices where CustomerID = ‘ALFKI’
SQLISAM.EXE – What is it? • First released BRG fall 2008 • Simple application • Performs SQL query against • Any ODBC source • MS Access databases • Excel tables • Creates a text file describing the results • Creates a BR “Internal Data File” with results • [See SQLISAM\Demofolder]
CONTEXT.wb • FNOPEN_SQL • Library to interface with SQLISAM.exe • FNGETHANDLE • Library to assign next available line number • FNGET_VAR$ • Library to assign local BR variables from SQL field names
Solution Using BR and SQLISAM • DEMO.WB