ShipRush SQL: Accessing the Database

ShipRush uses ADO to connect to databases. ADO has been part of Windows for several years, and is the successor to ODBC. ADO is the perfect method to connect to SQL Server, Access, Oracle, MySQL and nearly all other contemporary database systems.

 

ADO can also be used to access ODBC data sources that accept regular SQL syntax (e.g. SELECT / UPDATE / INSERT / DELETE queries).

 

A confusing element is that ADO is not called ADO in Windows itself. If you have ever seen this screen, you were actually configuring an ADO data source:

 

 

Fetching Data From Your Database

 

The ShipRush metaphor is simple: Simply return fields with the names ShipRush expects. Say you have a field in your database named 'Company.' ShipRush wants this field termed 'CompanyName' so your SQL simply reads:

 

select Company as CompanyName from ...

 

ShipRush will only 'see' data that conforms to its expected field names.

 

The actual fields in the database can have any name.

 

Posting Data Back to Your Database

 

Writing to the database is more flexible, as multiple SQL statements can be used. When multiple SQL statements are used, each statement must be separated by the 'GO' command on its own line. (This mechanism is supported on all database systems, not just SQL Server.)

 

The Glue Holding All Together

 

ShipRush 'merge codes' hold the whole story together. These merge codes are placed into your SQL statements, and they allow simple SQL to do real work. For example, if a new GUID is needed when inserting a new record, you simply use the %GUID% merge code. This causes ShipRush to generate a new GUID and merge it into the SQL statement at run time. For example, if SQL to post back the tracking number is created like this:

 

update orders set ShippingTrackingNumber = '%TRACKINGNUMBER%'

where ordernumber = %RecordID%

 

ShipRush will perform merging and will pass something like this to the database:

 

uppdate orders set ShippingTrackingNumber = '76938493898’

where ordernumber = 1001

 

In a Microsoft SQL Server environment, you can also use Transact-SQL scripts in the write history SQL. Here is an example script.

 

 

Next: How ShipRush Gets Data