Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Learn How To Use Range Types On A PostgreSQL Database In Windows Using FireDAC With Delphi

 FireDAC represents a range type column as a ftADT field with 3 subfields:

Note: Columns of range type are read-only. This sample updates them using SQL commands.

To get range column attributes, this sample uses the following code:

[crayon-676994b9b7bf3486518957/]

Location

You can find the Ranges project at:

How to Use the Sample

  1. Navigate to the location given above and open PGRanges.dproj.
  2. Press F9 or choose Run > Run.

Files

File in DelphiContains
PGRanges.dproj
PGRanges.dpr
The project itself.
fMain.pas
fMain.fmx
The main form.

Implementation

Before running the sample, the main components are configured at design time using the Object Inspector as follows:

Note: You can change the ConnectionDefName property to connect to a different PostgreSQL server using a valid user name and password.

[crayon-676994b9b7bfb689429938/]

Notes:

When you run the application, you see:

You can check the link below for more details about this sample:

http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.PostgreSQL_Ranges_Sample

Head over and check out the full source code for the PostgreSQL Ranges sample for Windows apps on GitHub or in your RAD Studio IDE samples section.

Exit mobile version