All posts by Stephen Ball

Stephen is a Charted IT Professional and the Associate Product Manager for InterBase at Embarcadero. He is also a Product Evangelist for RAD Studio, regularly speaking across EMEA. @DelphiABall

InterBase XE7 – Update 3

InterBase XE7 – Update 3

InterBase XE7 update 3 is now available for general release.

What’s new in InterBase XE7 – Update 3?

In my post about InterBase XE7 Update 2 I mentioned about the new reserve words that are used by Change Views and how to work with reserved words by using “quotes”.

  • CHANGE,
  • CHANGED,
  • INSERTED,
  • UPDATED
  • DELETED

With update 3, InterBase XE7 only adds these words to the reserved list once Change Views are active in the database. This will make it easier for users to migrate to InterBase XE7 and take advantage of the other cool features like partial data dumps, improved index handling etc.

What’s fixed in InterBase XE7 update 3?

The resolved defects are documented on the InterBase XE7 DocWiki resolved defects page .

 

Downloading InterBase XE7 update 3

Embarcadero CodeCentral “Registered Users” can download the patch binaries (Server/Desktop/Developer/Trial) for Windows and Linux, and, ToGo Edition. You can find the downloads at http://cc.embarcadero.com/reg/interbase

For new users, the trial and developer editions are available for free at http://www.embarcadero.com/products/interbase/downloads

Using Generics & RTTI to get enum string name or enum value

Overview

This blog post looks at Enums and how multi-platform generics and RTTI (or what C# guys call reflection) make this really simple using common code on Windows, Mac OS X, iOS and Android using Delphi.

Starting with what an Enum is, the post then explores how you would traditionally have seen it written in code, before looking at the clean X-platform approach RTTI and Generics provide.

If your experienced in working with enums and want to find out how RTTI makes it easier, you may want to skip the first part of this post and get to the section about RTTI further down.

Enumerated Types to and from strings

An Enum, or Enumerated Type is a data type with a set of named values.

Enums are a great way to define a set of constants that are specific for a type and work with them in context, ensuring only one, or an array of allowed values is set.

OK, I’m going to use an example that maybe should have more values listed, but you get the point. It is the points of a compass – North, South, East or West.

type
  TCompass = (North, South, East, West);

var
  D : TCompass; // short version for Direction 
begin
  D := TCompass.North;
  case D of 
    North : ShowMessage('North');
    South : ShowMessage('South');
    East  : ShowMessage('East');
    West  : ShowMessage('West');
    raise Exception.Create('Unknown Direction');
  end;
end;

This provides one way to convert a Enum to a string using a case statement, but every time you make a change to your Enum types, you need to add in extra code… Call me lazy, but thats too much work!

Continue reading Using Generics & RTTI to get enum string name or enum value

Important InterBase XE 7 – Update 2

InterBase XE7 – update 2

InterBase XE7 update 2 is now available for Windows and Linux server and ToGo. This update is highly recommended for all users of InterBase XE7.

For what is new and resolved issues in InterBase XE7 Update 2, please see the online InterBase documentation. – but in short, following update 1 with some change view enhancements – update 2 contains a number of fixes to general bugs reported.

Working with reserved words.

A list of Known Issues is available in the documentation. One that I will highlight is the addition of CHANGE, CHANGED, INSERTED, UPDATED and DELETED as reserved words in InterBase XE7 due to the introduction of Change Views.

I have heard of a few cases where developers have SQL statements that have stopped workings because their tables have fields that are one of the reserved words, e.g. UPDATED; Its easily to ensure those keep working by putting field names in “quotes” in your SQL statement.

As we know a lot of developers don’t quote their field names, we are working towards either a hot-fix or an update for the future that will only work with these as reserved words IF Change Views are being used, however it is recommended that you add “quotes” to the fields in your SQL if you are at all in doubt.

Download

For registered users, you can find the patch downloads at http://cc.embarcadero.com/reg/interbase

Server Edition

Windows
http://cc.embarcadero.com/item/30198

Linux
http://cc.embarcadero.com/Item/30199 

ToGo & IBLite Edition

Registered Users Downloads

Developer edition and Trial

https://downloads.embarcadero.com/free/interbase

 

What to do with Beacons before you code?

A beacon is a Bluetooth Low Energy device including some information in its advertising data.

Working with beacons requires code to read the beacons and some setup to ensure you read only the right beacons, especially as more and more are appearing! This article mainly focuses on the latter and what you should be aware of before you deploy your beacons.

Continue reading What to do with Beacons before you code?

Database updates in RAD Studio XE8

Database updates in RAD Studio XE8

With RAD Studio XE8 there have been a number of database updates to expand connectivity, and improve and introduce functionality for us programmers.

FireDAC & IBX support for Change Views

FireDAC has introduced new support for Change Views – enabling rapid identification of what has changed on the server side data and updating of client side stored data. See this <2min video for how these work.

Source code for the example ships in the samples directory:

<Samples><language>Database\FireDAC\Samples\DBMS Specific\InterBase\ChangeView

IBX has also introduced new components to make it easier to work with change views and subscriptions.

 New Platform – Teradata

FireDAC now includes support for Teradata, using the driver name TData.

TeraData in FireDAC

 

An example of how to set the driver properties is shown on the docwiki help for connecting to Teradata with Delphi.

DriverID=TData
Server=192.168.43.140
Database=MyDatabase
User_Name=dbc
Password=dbc

TDataSet TField speed up.

Marco Cantu mentioned on the Launch webinar Q&A a customer was claiming seen a speed up of around 25% on a TClientDataSet application due to the refactoring at the base of how TField is used at the core layer. 🙂 This is really cool for both VCL and also FMX developers.

64bit support for iOS

With the new platform for iOS 64bit, the database layer is also seamlessly available, just recompile and run 🙂

Other updates

There are updates for EMS including push notification. EMS is a great way to access central data from mobile devices. EMS now is updated to include InterBase XE7 for both the server and ToGo side, allowing you to use Change Views on both Server and Clients.

Where FireDAC uses SQLite, it has been updated to a newer driver.

For more of whats new in RAD Studio XE8, including EMS updates, please click here Whats new in Delphi XE8 and C++ Builder XE8

 

RAD Studio XE8 & my first Google Play app

RAD Studio XE8 has been launched today with a host of new features for both mobile and desktop applications.

Discover How RAD Studio XE8 Expands Your Business

For more on whats new visit RAD Studio XE8 documentation

My Google Play app built with XE8

I have been playing with a new application that combines my hobby as a Basketball referee with my geeky side and have published using RAD Studio XE8 a new Google Play store application for managing Basketball Shot Clocks.

I started this app using components that was introduced in XE7 – AppTethering and Multi-View, and these have been great, but I have benefited recently from the new FireUI updates in building a version for multiple screens. I now have it running on Tablets, Phones and Android TV. (which is kind of fun).

Adding in XE8 “toys”

Analytics

Getting to XE8 was trivial from XE7, and my next step now is to add in the new Analytics features of XE8. AppAnalytics provides developers with a visual representation of how users are interacting with applications built with RAD Studio XE8

I’ve found you get some good analytics about platform and country etc from Google App Store, which is cool, but I want some in app details to know when its being used. – This is especially cool as this can be used in VCL and FireMonkey applications and there is a free version of the service with the option to purchase enhanced online analytics.

More Native Controls

I’m also going to look to increase the native controls used in the app with the new options for a number of the controls I have used (like the slider and list view). I like the way FireMonkey abstracts this as an option and even surfaces some new options in this area.

For more about the new controls and everything else that is new in XE8 please visit the online help documentation.

 

InterBase XE7 – Update 1 Released

InterBase XE7 Update 1 Overview

InterBase XE7, update 1 went live on Friday and brings with it SQL language enhancements for Change View, and some updates to IBConsole and the availability of InterBase ToGo for XE7

Full details about the update are available on the InterBase DocWiki

Change View Updates

There are 2 major additions to InterBase Change Views in Update 1

Drop Subscription

Prior to update 1 you had to manually drop a subscription via an SQL statement. This was a temporary solution and has now been replaced with the correct SQL syntax

DROP SUBSCRIPTION <subscription name> [RESTRICT | CASCADE]

If you want to remove a subscription that has subscribers you must use the CASCADE command as RESTRICT is the default.

Change View SQL Extensions

InterBase SQL now includes additional language to support querying about the changed state of specific fields via the <FIELD> IS [NOT] {CHANGED | INSERTED | UPDATED | DELETED} clause.

Take the following example.  Lets imagine we have two employee records that have been modified.

  • EMP_NO 39 has their DEPT_NO changed
  • EMP_NO 109 has their SALARY changed.

At run time you want to select only those that have had a SALARY change prior to processing staff payments. To achieve this first, a Change View subscription is set active (making any SQL statement subsequently run only return the delta for that subscriber). Then SQL where clause then filters further where the SALARY IS UPDATED.

SET SUBSCRIPTION sub_employee_changes at 'MyDeviceID' ACTIVE;
SELECT EMP_NO, DEPT_NO, SALARY FROM EMPLOYEE WHERE SALARY IS UPDATED;

EMP_NO     DEPT_NO           SALARY
--------   ----------        ----------
109        600               75000

Regardless of what you select, the commit will still bring

InterBase IBConsole Updates

InterBase IBConsole has a number of new features, introduced in Update 1 designed to get you started quicker.

IBConsole Start Here
IBConsole Start Here

Getting started with InterBase

When you open IBConsole now you find the new InterBase – Start Here page as a tab at the top of the screen. The start here page includes containing details about Community and featured posts, as well as training videos and direct links to the documentation. While an offline page ships with IBConsole, If you want to see this page now, please visit http://www.embarcadero.com/starthere/interbase/index.html

Having this page online allows us to improve our communication with our customers about critical information and appropriate news.

Recent Databases

There is also a new feature in the bottom left of the screen (see image above or below) enabling you to quickly connect back to the recent database you have been working on.

This windows shows you the database name, server and also the when you last accessed the database via IBConsole.

Change Views

Change View IBConsole

IBConsole also now includes access to work with subscriptions.

InterBase ToGo XE7

InterBase XE7 ToGo trial edition is now available for download – more details to come soon about ToGo.

InterBase Change Views Demo and Video

InterBase Change Views Example Demo

This week I hosted a Skill Sprints session looking at InterBase Change Views with an example set of code working around a Pharmacy needing to keep centralised drug information updated at distributed pharmacies.

The example code will ship with the next major release of the RAD Studio products – which you can get for free with the current RAD offer

This InterBase Change Views Example demo shows off this powerful way to track on the server what data is changing in a very lightweight and scalable way.

This Skill Sprint Video for InterBase Change Views follows on from the recent blog posts I have done on Change Views which are available here:

InterBase Change Views blogs

InterBase Change Views in Brazilian Portuguese

Last week CodeRage III Brazil ran with a host of great sessions in Portuguese, covering RTTI, App Tethering, DataSnap and FireDAC and also InterBase. Back in December I hosted the product Launch of InterBase XE7 at CodeRage 9, and it has been great working with Dormevilly and Fernando to get an updated Brazilian Portuguese version done, including some of the great capabilities we have today with Change Views. Great job guys 🙂