When the solution matters

Tips...

Registration Documentation Knowledgebase Seminars / Training Partner Programs 4D Partner Central

4D v11 SQL Examples

New:  SQL | Components | Unicode

Enhanced: Lists | 4D Mailing  | 4D Objects  | User Management | Web 

 

SQL

Integrated, native SQL language

One of the major new features of 4D v11 SQL is its integrated, native SQL language

The 4D v11 SQL language allows you to connect directly to an ODBC data source and to execute SQL queries inside Begin SQL/End SQL tags (and via the new 4D command: QUERY BY SQL).
This database shows how to carry out queries with the 4D language as well as with SQL.
Specific examples show both languages in parallel in order to compare them easily and to highlight their respective advantages.
Comments and explanations are provided during the execution of these queries.
The 1st example illustrates a simple query (which consists of finding the airports of a specific city and country).
A 2nd example illustrates a join (which consists of finding from among a selection of airports those that can be accessed via a direct flight).
A 3rd example illustrates a complex SQL query written simply using the 4D language. 
A 4th example shows a complex 4D query illustrating "nested" queries in SQL. 

ERP and SQL in 4D

4D ERP Toolbar

This is a set of management databases that make use of the power of SQL in 4D.

4D ERP Product

This product management database also shows the new capabilities of 4D as far as SQL is concerned. This database can be used as a component that can be integrated into a database of your choice.

4D ERP Contacts

This database is a contact management database. You can add and delete contacts, companies, addresses, and media. Companies and contacts can be filtered using the filter area.

4D ERP Invoice

This invoice management database also shows the new capabilities of 4D as far as SQL is concerned. This database can be used as a component that can be integrated into a database of your choice.

 
Components and Tool Palette

4D Pop

4D Pop is a component that installs a palette in the Design mode. Tools will be added to this palette gradually as compatible components are installed.

4D Pop Bookmark

This tool is a bookmark manager. It lets you quickly access a Web page, an e-mail address, a file or a folder, etc. directly within your development environment.

4D Pop Quiz

This tool is very useful to find a command by keyword, access online documentation by double-clicking, or drag & drop a command right into the Method editor.

4DPop Window

4D Pop Window is a hierarchical and organized window menu that displays the windows from the Design and Application mode. You can organize these windows or recover off-screen windows.

4D Pop Color Chart

Create your own colors and customized color palette. You can use these colors in your object methods via a simple drag and drop.

4D Pop XLIFF

4D v11 SQL simplifies localization of your databases thanks to the integration of the XLIFF standard (localization standard) into 4D.
This database provides you with an editor for editing XLIFF resources.

You can easily manage and edit the XLIFF files of your database, as well as drag text references directly into the Method editor or Form editor.

Advantages of this tool:

  • a simplified interface with respect to more professional tools
  • its integration into 4D
  • possibility of removing it during deployment (thanks to the new architecture of components).
  • possibility of generating standardized files that you will be able to provide to localizers without further manipulation.

This database integrates tools to minimize the impact of converting STR# and TEXT to the new XLIFF standard.

4D Pop Migration

Tools for a smooth migration to version 4D v11 SQL:

  • Edit keyboard shortcuts in Design mode,
  • Migrate "resource fork" user constants of the structure in a dedicated plugin,
  • Convert macros files
  • Extract CICN, PICT & MASK resources as localized PNG picture files in the resource folder of your database

Convert STR# & TEXT resources into XLIFF files.

4D Pop BugReport

Write and post bugs without leaving the Design environment, thus avoiding unnecessary typing and taking full advantage of drag & drop of code while writing the description of your bug.

4D Pop Ruler

Display a ruler and guides to make precise measurements, in Design or Application mode; simulate a screen size and tweak your interfaces.

4D Indexes

This example database shows the possibilities of using indexes in 4D v11 SQL:
- new index types:
. BTree index for non-repeated values (IDs, names, etc.)
. cluster index for repeated values (Booleans, titles (M., Ms., etc.))
. composite index for sorting (FirstName+LastName, City+ZipCode,
State+City, etc.)
. keyword indexes for texts
- indexes created stored in a separate file
- etc.
To demonstrate their efficiency, this example explains how to choose the correct index type.

Unicode Support

This database is for informative purposes. It demonstrates the ability of 4D to display Unicode characters. It also shows the conversion of characters during the use of the Uppercase and Lowercase functions.


Lists

Hierarchical List

This database shows the possibilities of using a hierarchical list:
- display of items of the list of colors
- multiple selections allowed
- events used: "On Expand", "On Collapse" and "On Selection Change"
- dynamically built lists
- icons from resources, object library or variables

Included List

This database show the possibilities of included lists:
- calculated content updated according to the selections
- 4D v11 SQL customized interface (alignment, font style, etc.)
- graphic object replaces color of current selection
- display of contents of several tables in one form

4D Mailing

This database show how to use the "4D Write" word processor to send customized e-mails to contacts as a mail shot.

4D Objects

This example database shows all the interface objects managed by 4D:
- variables
- buttons
- field lists
- checkboxes
- etc.
To use it, you can click on the buttons representing the Form editor tool bar or you can select a specific type of object directly from a dropdown menu.

User Management

4D Passwords

This database shows how to manage users by programming.
It allows you to:
- save and restore users and their passwords (encrypted)
- use a customized connection dialog box
- remove or create new users
- create additional information for a user (icon, visibility, etc.)

Web (static, dynamic, FTP transfer)

4D StaticWebBuilder

This database shows how to publish a relational database on the Web both statically and dynamically.
It also shows how to transfer via FTP the generated static web site using the 4D Internet Commands plug-in. Additional information is provided when running the demo.

Forms

4D UserForms

With 4D, users can modify certain forms.
Starting with a classic "clients - invoices - invoices_lines" structure, two forms can be duplicated then modified by the users: "envelopes" and "invoices."
These two templates have been deliberately left "open" so the final user can modify the text, formats and paper orientations, as well as margins, objects, etc.

Each form can be duplicated as many times as necessary. This allows, for example, specifying several envelope formats as well as different templates for the invoices.

 

International | Company | Contact 4D | Site Map | Privacy Policy | © 4D, Inc. 1995-2008 | Change font size: [A] [A] [A] | Print this page | 4D RSS Feeds