Recital

Login Register

Latest Development News

The Lianja Application Platform is a cost-effective cloud database computing platform for SMEs (Small and Medium-sized Enterprises) that lets them focus on developing and deploying business Apps without the need to invest in lengthy application development times and an expensive IT infrastructure.

The three pillars of Lianja are:
  • The Lianja App Builder
  • The Lianja Cloud Database
  • Lianja.com Apps
If you need to develop and deploy cross-platform Visual FoxPRO GUI, Web or Mobile Apps visit the Lianja website for further details.

Published in Blogs
Read more...
A good article describing the configuration of samba for file/record locking can be found here.

Basically you must add these directives to the smb.conf file:

[data] 
oplocks = False 
level2 oplocks = False

The default oplock type is Level1. Level2 oplocks are enabled on a per-share basis in the smb.conf file. Alternately, you could disable oplocks on a per-file basis within the share: 

veto oplock files = /*.dbf/*.DBF/*.ndx/*.NDX/*.dbx/*.DBX/*.dbt/*.DBT/

You can further tune samba by following this guide.

If you specify the Common Internet File System (CIFS) when you mount the samba share then you must specify the following options
mount -t cifs {mount-point} -o username=name,pass=pass,directio
The directio option is used to not do inode data caching on files opened on this mount. This precludes mmaping files on this mount. In some cases with fast networks and little or no caching benefits on the client (e.g. when the application is doing large sequential reads bigger than page size without rereading the same data) this can provide better performance than the default behavior which caches reads (readahead) and writes (writebehind) through the local Linux client pagecache if oplock (caching token) is granted and held. Note that direct allows write operations larger than page size to be sent to the server.

If you get the following error when trying to mount the {mount-point}
Apr 22 16:57:39 bailey kernel: Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
Apr 22 16:57:39 bailey kernel:  CIFS VFS: Send error in SessSetup = -13
Apr 22 16:57:39 bailey kernel:  CIFS VFS: cifs_mount failed w/return code = -13
The you need to create the Samba user specified on the mount command
smbpasswd -a username
FYI - Make sure you umount all the Samba {mount-point(s)} before shutting down Samba.
Published in Blogs
Read more...

After an extended period of intense software development, we are pleased to announce the release of Recital 10 which is a milestone in our development efforts.
 
Recital 10 is comprised of major new versions of all of our products (which are all now Cluster Ready) as well as some new products, and a collection of open source technologies fully supported by ourselves to our customer base. 

The Recital 10 release notes can be found here.
  • Recital

    A powerful scripting language with an embedded database used for developing desktop database applications on Linux and Unix.

  • Recital Server

    A cross-platform SQL database and application server.

  • Recital Web

    A server-side scripting language with an embedded SQL database for creating web 2.0 web applications.

Published in Blogs
Read more...

In this article Barry Mavin, CEO and Chief Software Architect for Recital, details how to work with Triggers in the Recital Database Server.

Overview

A trigger is a special kind of stored procedure that runs when you modify data in a specified table using one or more of the data modification operations: UPDATE, INSERT, or DELETE.

Triggers can query other tables and can include complex SQL statements. They are primarily useful for enforcing complex business rules or requirements. For example, you can control whether to allow a new order to be inserted based on a customer's current account status.

Triggers are also useful for enforcing referential and data integrity.

Triggers can be used with any data source that is handled natively by the Recital Database Engine. This includes Recital, FoxPro, FoxBASE, Clipper, dBase, CISAM, and RMS data,

Creating and Editing Triggers

To create a new Trigger,  right-click the Procedures node in the Databases tree of the Project Explorer and choose Create. To modify an existing Trigger select the Trigger in the Databases Tree in the Project Explorer by double-clicking on it, or select Modify from the context menu. By convertion we recommend that you name your Stored Procedures beginning with "sp_xxx_", user-defined functions with "f_xxx_", and Triggers with "dt_xxx_", where xxx is the name of the table that they are associated with.

Associating Triggers with a Table

Once you have written your Triggers as detailed above you can associate them with the operations performed on a Table by selecting the Table tab.

The Tables tab allows you to select a Trigger procedure by clicking on the small button at the right of the Text field.

Types of Triggers

As can be seen from the Tables tab detailed below, The Recital Database Server handles 6 distinct types of Triggers.

Open Trigger

The Open Trigger is called after is a table is opened but before any operations are performed on it. You can use this trigger to record a log of table usage or provide a programmable means of checing security. If the Trigger procedure returns .F. (false), then the table is not opened. You can use a TRY...CATCH block around the associated command to inform the user.

Close Trigger

The Close Trigger is called just prior to a table being closed. In this trigger you may find it useful to get transaction counts by using the IOSTATS() built-in 4GL function, and record these values in a transaction log.

Update Trigger

The Update Trigger is called prior to a record update operation being performed. You can use this trigger to perform complex application or data specific validation. If the Trigger procedure returns .F. (false), then the record is not updated. You can use inform the user from within the Trigger procedure the reason that the data cannot be updated.

Delete Trigger

The Delete Trigger is called prior to a record delete operation being performed. You can use this trigger to perform complex application or data specific validation such as cross-table lookups e.g. attempting to delete a customer recortd when there are still open orders for that specific customer. If the Trigger procedure returns .F. (false), then the record is not deleted.

Insert Trigger

The Insert Trigger is called prior to a record insert (append) operation being performed. You can use this trigger to perform such tasks as setting up default values of columns within the record. If the Trigger procedure returns .F. (false), then the record is not inserted.

Rollback Trigger

The RollbackTrigger is called prior to a rollback operation being performed from within a form. If the Trigger procedure returns .F. (false), then the record is not rolled back to its original state.

Testing the Trigger

To test run the Trigger, select the Trigger in the Databases Tree in the Project Explorer by double-clicking on it. Once the Database Administrator is displayed, click the Run button to run the Trigger.

Published in Blogs
Read more...
Recital 10 introduced the ARRAY( ) functions. This function operates in the same way as the PHP ARRAY( ) function. It can be used to declare a dynamic or associative array and optionally initialize it with elements.
// declare an empty dynamic array
a = array()

// declare a simple dynamic array
a = array("barry", "recital", "boston")
foreach a as value
    echo value
endfor

// declare an associative array
a = array("name" => "barry", "company" => "recital", "location" => "boston")
echo "length of a is " + len(a)
foreach a as key => value
    echo "key=" + key + ", value=" + value
endfor
Published in Blogs
Read more...
Recital 10 enhances the way updating tables with indexes is done. The Recital engine will now evaluate each index individually to determine if any changes being made to the row effect it. If this is not the case then the index is flagged not to be updated. This enhancement helps speed up performance of updates and is particularly noticeable in cluster/network installations.
Published in Blogs
Read more...

Recital 10 Express Edition Linux x86 Free Download.

Recital 10 introduces the free single-user developer edition called Recital Express that can be used to develop and test multi-user Recital, Recital Server and Recital Web applications. Once the applications are ready for deployment a commercial license must be purchased. Recital Express, Recital Server Express and Recital Web Express can be used unlicensed for non-commercial purposes only.

What does this download include:

Recital 10

A powerful scripting language with an embedded database used for developing desktop database applications on Linux and Unix. Recital has a high degree of compatibility with Microsoft FoxPRO enhanced with many additional enterprise class extensions.

Web

Recital 10 Web

A server-side scripting language with an embedded database for creating web 2.0 applications. Includes plugins for apache and IIS. Coming soon! Recital Web Framework, a comprehensive OO framework built on YUI for building RIA (Rich Internet Applications) in Recital Web.

Recital 10 Server

A cross-platform SQL database and application server which includes client drivers for ODBC, JDBC and .NET enabling Recital data to be accessed client/server from Windows, Linux and Mac.

 Safe

Recital 10 Replication

A comprehensive replication product that addresses urgent data movement and synchronization needs to help support disaster recovery and business continuity for Recital applications.


Recital 10 Quick Start:

Graphical Installation

Note: The installation must be run as root. For systems with a hidden root account, please use ’Run as Root’.

  1. Download the distribution file into a temporary directory
  2. Check that the distribution file has the execute permission set
  3. Run the distribution file
  4. Follow the on screen instructions:
    1. License agreement
    2. Select components
    3. Installation directory and shortcuts
    4. Linking to /usr/bin
    5. ODBC Installation type (Recital Server / Recital Client Drivers)
    6. Java Virtual Machine selection (Recital Server / Recital Client Drivers)
    7. TomCat Installation type (Recital Server / Recital Client Drivers)
    8. Apache Firecat Plugin Installation (Recital Web Developer)
    9. Replication Service Type (Recital Replication Server)
    10. Install license file

Text Installation

Note: The installation must be run as root. For systems with a hidden root account, please precede commands with ’sudo’.

  1. Download the distribution file into a temporary directory
  2. Check that the distribution file has the execute permission set
  3. Run the distribution file
  4. Follow the on screen instructions:
    1. License agreement
    2. Select components
    3. Installation directory and shortcuts
    4. Linking to /usr/bin
    5. ODBC Installation type (Recital Server / Recital Client Drivers)
    6. Java Virtual Machine selection (Recital Server / Recital Client Drivers)
    7. TomCat Installation type (Recital Server / Recital Client Drivers)
    8. Apache Firecat Plugin Installation (Recital Web Developer)
    9. Replication Service Type (Recital Replication Server)
    10. Install license file


Published in Blogs
Read more...

This article looks at After Image Journaling and audit trails in Recital using SET JOURNAL and associated commands.

Overview

After Image Journaling, used in conjunction with a structured backup policy is an effective disaster recovery solution. Any transaction that takes place on a table that is being journaled is logged in the journal file. In the event of a disk crash or similar event in which the table is lost, the journaled transactions can be reapplied to the latest backup copy of the table. Alternatively or additionally, the journal can be used to provide an audit trail to all modifications made to the table data.

NOTE: Recital also provides Before Image Journaling via BEGIN TRANSACTION / END TRANSACTION blocks, allowing unsuccessful transactions to be rolled back to a set saved state.

SET JOURNAL and RECOVER

Regular backups are an essential routine for any system, but in high-transaction environments restoration of the latest backup can still mean a major loss of data. After image journaling can successfully be used as part of your disaster recovery strategy to minimize data loss and down time. Recital after image journaling functionality is based on the use of the SET JOURNAL and RECOVER commands.

SET JOURNAL
SET JOURNAL TO [<.dbj filename> | ()]
SET JOURNAL ON | OFF | ()

The SET JOURNAL command is used to enable the After Image Journaling and audit trail for the active table. The TO <.dbj filename> clause associates the specified transaction journal file with the active table.  If the journal file does not exist, it will be created.  The filename can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename.  If no file extension is specified, ‘.dbj’ is used. When specifying a journal file, it is recommended that the journal file is stored on a different disk than that which the table is stored on, so that if a fatal disk error occurs, then the journal file will not be lost along with the table. 

//Enable journaling for the southwind!orders table
open database southwind
use orders
set journal to /journals/ord_journ

The <.dbj filename> is a standard table.  It contains seven fields that are specific to a journal file, followed by the first 249 fields of the associated table.

The first seven fields in the journal are:


Field

Type

Display

Storage

Description

AUD_DATE

Date

8 | 10 *

4

The date on which the transaction was performed.

AUD_TIME

Character

8

8

 The time at which the transaction was performed, in the format HH:MM:SS.

AUD_TERM

Character

12

12

The name of the terminal from which the transaction was performed

AUD_UID

Short

5

2

The ID of the user who performed the transaction.

AUD_GID

Short

5

2

The group ID of the user who performed the transaction.

AUD_CMD

Short

4

2

The command number of the transaction performed from the command table below

AUD_RECNO

Integer

7

4

The record number in the associated table which the transaction was performed on.


* Dependent on SET CENTURY setting.

The AUD_CMD Command Reference Numbers are as follows:


Command

Number

DELETE

14

RECALL

36

REPLACE

41

BROWSE

6

CHANGE

8

EDIT

17

INSERT

26

APPEND

5

READ

35


Since journal files are standard Recital tables, you can use standard Recital commands such as the REPORT command to print audit trails, transaction logs, etc.

//Enable journaling for the southwind!orders table
open database southwind
use orders
set journal to /journals/ord_journ
//.. transactions
close data
//View journaled records
use /journals/ord_journ.dbj

Click image to display full size

Fig 1: Journal Record Example.

The SET JOURNAL TO command without a <.dbj filename> specified closes the active journal file and no further journaling will take place on the active table until the SET JOURNAL TO <.dbj filename> is reissued.

The journaling features are mainly used with shared tables.  It should be noted that there is an overhead in enabling transaction journaling, as records updated in a table are also written to the journal file. When records are appended into a journal file, locking is automatically performed so that multiple users can update the journal concurrently.  The associated table must be opened shareable for this to occur.  Each table can have a journal file associated with it. 

The SET JOURNAL ON | OFF command enables or disables transaction journaling.  This command is primarily used in applications where journaling can be disabled for a certain class of operations. By default, SET JOURNAL is ON, but no journal files are set.

NOTE: Only the first 249 fields of a table can be journaled: subsequent fields are ignored. The maximum number of fields in a Recital table is 256.

RECOVER
RECOVER FROM <.dbj filename> | ()

The RECOVER command uses the journal file to reapply lost transactions to a previous backup of the data after a fatal error such as a disk head crash. The FROM clause specifies the journal file to use. The file name can be substituted with an <expC>, enclosed in round brackets, which returns a valid filename.  If no file extension is specified, then ‘.dbj’ is assumed. 

Regular backups are essential to the successful use of After Image Journaling.   It is also very important to reinitialize the journal file after each backup: either open the journal file as you would a normal table and use the ZAP command, or delete the file completely. If a fatal error occurs, such as a disk head crash, the table and index files must be restored from a backup, then the RECOVER command executed. RECOVER will reapply' all of the transactions in the journal file to the table, and update the indexes.  After the RECOVER command has completed, you can continue with normal processing. 

//Create a backup of the southwind!orders table
//...backup table and associated files
//Reinitialize the journal file
erase /journals/ord_journ.dbj
//Enable journaling for the southwind!orders table
open database southwind
use orders
set journal to /journals/ord_journ
//.. transactions
//Restore the backup of the southwind!orders table
//...restore
//Open the restored backup
open database southwind
use orders
//Reapply the transactions using the journal
recover from /journals/ord_journ.dbj
//Now, enable the journal file again or
//restart with a new backup

Journaling Memo Fields

By default, memo fields - variable length text fields - are not journaled due to the possible storage overhead of multiple copies of potentially large blocks of text. But, if memo journaling is required, the SET MEMOJOURNAL ON command can be used to enable this.

SET MEMOJOURNAL
SET MEMOJOURNAL ON | OFF | ()

The SET MEMOJOURNAL command causes memo fields to be journaled when journaling is set on a table. This command allows the optional logical expression <expL> to be evaluated.  If a value of  .T. is returned, MEMOJOURNAL is set ON.  If a value of .F. is returned, MEMOJOURNAL is set OFF.  By default SET MEMOJOURNAL is OFF.

Like a normal Recital table, the journal holds only a pointer to a data block in an associated memo file, not the actual memo data itself. The journal's memo file has a file extension of .dbm rather than the standard Recital .dbt. Therefore, if the journal is being opened as a table, in order to view the journal's memo data, the SET MEMOEXT command should be used.

//Enable journaling for the southwind!suppliers table
open database southwind
use suppliers
set journal to /journals/sup_journ
//.. transactions
close data
//Set filename extension for memo file
set memoext to '.dbm'
//View journaled records
use /journals/sup_journ.dbj

Summary

The After Image Journaling enabled by the SET JOURNAL and RECOVER commands can be used in conjunction with a strict backup regime to minimize data loss in cases where tables become damaged or irretrievable. Journal files can be accessed like standard Recital tables and provide detailed information about the transactions applied to a table, so can be used for auditing purposes.

Published in Blogs
Read more...

This article looks at the range of client access mechanisms for Windows that can be used with the Recital C-ISAM Bridge and details bridge configuration and usage.

Overview

Just because the format of data is regarded as 'legacy' does not make that data in any way obsolete. Modern client interfaces can not only extend the life of long-term data, but also provide different ways to analyse and gain advantage from that data.

Recital Corporation provides a range of solutions to interface to Informix compliant C-ISAM data on Linux or UNIX from Windows clients.

.NET

Click image to display full size

Fig 1: Recital Mirage .NET application accessing the C-ISAM Demo table.


Recital offers two alternative ways to access C-ISAM data using Microsoft .NET:

The Recital .NET Data Provider is a managed Data Provider written in C# that provides full compatibility with the Microsoft SQLserver and OLE DB data providers that ship with the .NET framework. It is fully integrated with the Visual Studio .NET IDE supporting data binding and automatic code generation using the form designer. The Recital .NET Data Provider works in conjunction with the Recital Database Server for Linux or UNIX to access C-ISAM data.

Recital Mirage .NET is a complete solution for migrating, developing and deploying 4GL database applications. Recital Mirage .NET works in conjunction with the Recital Mirage .NET Application Server for Linux or UNIX to access C-ISAM data.

JDBC

Click image to display full size

Fig 2: Java™ Swing JTable accessing the C-ISAM Demo table via the Recital JDBC Driver.


The Recital JDBC Driver is an all Java Type 4 JDBC 3.0 Driver, allowing you to access C-ISAM data from Java applets and applications. The Recital JDBC Driver works in conjunction with the Recital Database Server for Linux or UNIX to access C-ISAM data.

ODBC

Click image to display full size

Fig 3: Microsoft® Office Excel 2003 Pivot Chart and Pivot Table accessing the C-ISAM Demo table via the Recital ODBC Driver.


The Recital ODBC Driver is an ODBC 3.0 Driver, allowing you to access C-ISAM data from your preferred ODBC based Windows applications. You can develop your own applications in languages such as C++ or Visual Basic, manipulate the data in a spreadsheet package or word processor document and design charts, graphs and reports. The Recital ODBC Driver works in conjunction with the Recital Database Server for Linux or UNIX to access C-ISAM data.

Configuring the Recital C-ISAM Bridge

Data access is achieved through a C-ISAM Bridge.  This requires the creation of an empty Recital table that has the same structure as the C-ISAM file and of a RecitalC-ISAM Bridge file.

On Linux and UNIX, Recital Terminal Developer and the Recital Database Server come complete with an example C-ISAM data file, C-ISAM index and Recital C-ISAM bridge that can be used for testing and as a template for configuring your own C-ISAM bridges.  The Recital Database Server also includes a bridge creation ini file.

Step 1:

Create a Recital table with the same structure as the C-ISAM file.  The fields/columns in the structure file must exactly match the data type and length of those in the C-ISAM file.  The Recital table will have one byte more in total record length due to the Recital record deletion marker.

To create the table, use the SQL CREATE TABLE command or the Recital Terminal Developer CREATE worksurface.  The SQL CREATE TABLE command can be called directly:

SQLExecDirect:
  In:      hstmt = 0x00761BE8,
    szSqlStr = "CREATE TABLE cisamdemo.str (DD Char(4)
              DESCRIPTION "Dd...", cbSqlStr = -3
  Return:  SQL_SUCCESS=0

or be included in a 4GL program:

// createtab.prg
CREATE TABLE cisamdemo.str;
    (DD Char(4) DESCRIPTION "Dd",;
     CONFIRM Char(6) DESCRIPTION "Confirm",;
     PROCDATE Char(6) DESCRIPTION "Procdate",;
     CONTROL Char(5) DESCRIPTION "Control",;
     DOLLARS Decimal(13,2) DESCRIPTION "Dollars",;
     DEALER Char(5) DESCRIPTION "Dealer",;
     TERRITORY Char(2) DESCRIPTION "Territory",;
     WOREP Char(12) DESCRIPTION "Worep",;
     CURRTRAN Char(3) DESCRIPTION "Currtran",;
     TRADDATE Char(6) DESCRIPTION "Traddate",;
     CITY Char(10) DESCRIPTION "City",;
     ACCOUNT Char(11) DESCRIPTION "Account",;
     PRETRAN Char(2) DESCRIPTION "Pretran",;
     AFSREP Char(14) DESCRIPTION "Afsrep",;
     REPKEY Char(9) DESCRIPTION "Repkey",;
     BRANCH Char(3) DESCRIPTION "Branch",;
     WODEALER Char(5) DESCRIPTION "Wodealer",;
     BANKCODE Char(2) DESCRIPTION "Bankcode",;
     COMMRATE Decimal(6,4) DESCRIPTION "Commrate",;
     NEWREP Char(1) DESCRIPTION "Newrep",;
     SETTLE Char(1) DESCRIPTION "Settle",;
     POSTDATE Char(6) DESCRIPTION "Postdate")
if file("cisamdemo.str")
    return .T.
else
    return .F.
endif
// end of createtab.prg

Server-side 4GL programs can be called by all clients, e.g. from a Java class with a JDBC connection:

//---------------------------------
//-- create_str.java --
//---------------------------------
import java.sql.*;
import java.io.*;
import Recital.sql.*;

public class create_str {

  public static void main(String argv[]) {
    try {
      new RecitalDriver();
      String url = "jdbc:Recital:" +
        "SERVERNAME=cisamserver;" +
        "DIRECTORY=/usr/recital/data/southwind;" +
        "USERNAME=user;" +
        "PASSWORD=password";
      Connection con = DriverManager.getConnection(url, "user", "pass");
      Statement stmt = con.createStatement();

      CallableStatement sp = con.prepareCall("{call createtab}");
      boolean res = sp.execute();
      String outParam = sp.getString(1);
      System.out.println("Returned "+outParam);
      sp.close();
      con.close();
    } catch (Exception e) {
      System.out.flush();
      System.err.flush();
      DriverManager.println("Driver exception: " + e.getMessage());
      e.printStackTrace();
    }
    try {
      System.out.println("Press any key to continue...");
      System.in.read();
    } catch(IOException ie) {
      ;
    }
  }
}

The table should be given a ‘.str’ file extension (rather than the default ‘.dbf’) to signify that this is a structure file only.

Please see the end of this article for information on matching Informix and Recital data types



Fig 4: Recital CREATE/MODIFY STRUCTURE worksurface for character mode table creation.

Step 2: Creating the Bridge File

If you have Recital installed on the server platform, the Bridge File can be created using the CREATE BRIDGE worksurface.  The corresponding command to modify the bridge file is MODIFY BRIDGE <bridge file>.  This is the cisamdemo.dbf bridge file in the CREATE/MODIFY BRIDGE WORKSURFACE:

> modify bridge cisamdemo.dbf


Fig 5: Recital CREATE BRIDGE/MODIFY BRIDGE worksurface for bridge creation.

For Recital Database Server clients, the Bridge File can be created using the Recital/SQL CREATE BRIDGE command:

Recital/SQL CREATE BRIDGE:
CREATE BRIDGE cisamdemo.dbf;
  TYPE "CISAM";
  EXTERNAL "cisamdemo.dat";
  METADATA "cisamdemo.str";
  ALIAS "cisamdemo"

or:

CREATE BRIDGE cisamdemo.dbf;
  AS "type=CISAM;external=cisamdemo.dat;metadata=cisamdemo.str;alias=cisamdemo"

The examples above assume that the C-ISAM file, the bridge file and the Recital structure file are all in the current working directory.  Full path information can be specified for the <externalname> and the <databasename>.  For added flexibility, environment variables can be used to determine the path at the time the bridge is opened.  Environment variables can be included for either or both the <externalname> and the <databasename>.  A colon should be specified between the environment variable and the file name.

e.g.

  CREATE BRIDGE cisamdemo.dbf;
  TYPE "CISAM";
  EXTERNAL "DB_DATADIR:cisamdemo";
  METADATA "DB_MIRAGE_PATH:cisamdemo.str";
  ALIAS "cisamdemo"
Recital CREATE BRIDGE/MODIFY BRIDGE worksurface:


Fig 6: Recital CREATE BRIDGE/MODIFY BRIDGE worksurface - using environment variables.

Using the Bridge

The Bridge can now be used.  To access the C-ISAM file, use the ‘alias’ specified in the Bridge definition.

SQL:
SELECT * FROM cisamdemo
Recital/4GL:
use cisamdemo

Indexes

The cisamdemo.dat file included in the Recital distributions for Linux and UNIX has three associated index keys in the cisamdemo.idx file:

Select area: 1
Database in use: cisamdemo
Alias: cisamdemo
Number of records: 4
Current record: 2
File Type: CISAM (C-ISAM)
Master Index: [cisamdemo.idx key #1]
Key: DD+CONFIRM+PROCDATE+CONTROL
Type: Character
Len: 21   (Unique)
Index: [cisamdemo.idx key #2]
Key: DD+SUBSTR(CONFIRM,2,5)+TRADDATE+STR(DOLLARS,13,2) +CURRTRAN+ACCOUNT Type: Character Len: 42 Index: [cisamdemo.idx key #3] Key: DEALER+BRANCH+AFSREP+SUBSTR(PROCDATE,5,2) +SUBSTR(CONTROL,2,4) Type: Character Len: 28

The Recital C-ISAM bridge makes full use of the C-ISAM indexes.  SQL SELECT statements with WHERE clauses are optimized based on any of the existing indexes when possible.  The following ODBC SELECT call makes use of key #3 rather than sequentially searching through the data file.

SQLExecDirect:
  In:      hstmt = 0x00761BE8,
    szSqlStr = "select * from cisamdemo
      where dealer+branch+afsrep=' 00161   595-7912",
      cbSqlStr = -3
  Return:  SQL_SUCCESS=0

Get Data All:

"DD", "CONFIRM", "PROCDATE", "CONTROL", "DOLLARS", "DEALER", 
"TERRITORY", "WOREP", "CURRTRAN", "TRADDATE", "CITY", "ACCOUNT", 
"PRETRAN", "AFSREP", "REPKEY", "BRANCH", "WODEALER", "BANKCODE", 
"COMMRATE", "NEWREP", "SETTLE", "POSTDATE"

"0159", " 15522", "930312", "13356", 4992.60, "00161", "19", 
"", "210", "930305", "", "70000100009", "", "595-7912", 
"930315791", "", "", "59", 0.0000, "1", "", "930315"
1 row fetched from 22 columns.

Using the Recital/4GL, the primary index is set as the master index when the bridge is first opened.  Any secondary indexes can be selected using the SET ORDER TO <expN> command.  The Recital/4GL SEEK or FIND commands and SEEK() function can be used to search in the current master index.

> SET ORDER TO 3
Master index: [cisamdemo.idx key #3]
> SEEK “00161   595-7912”

Appendix 1: Data Types

Informix

Recital

Byte

Numeric

Char

Character

Character

Character

Date

Date

Datetime

Character

Decimal

Numeric

Double Precision

Float

Float

Real

16 Bit Integer

Short

Integer

Numeric

Interval

Character

32 Bit Long

Integer

Money

Numeric

Numeric

Numeric

Real

Numeric

Smallfloat

Numeric

Smallint

Numeric

Text

Unsupported

Varchar

Character

Appendix 2: C-ISAM RDD Error Messages

The following errors relate to the use of the Recital CISAM Replaceable Database Driver (RDD).  They can be received as an ‘errno <expN>’ on Recital error messages:


ERRNO()

Error Description

100

Duplicate record

101

File not open

102

Invalid argument

103

Invalid key description

104

Out of file descriptors

105

Invalid ISAM file format

106

Exclusive lock required

107

Record claimed by another user

108

Key already exists

109

Primary key may not be used

110

Beginning or end of file reached

111

No match was found

112

There is no “current” established

113

Entire file locked by another user

114

File name too long

115

Cannot create lock file

116

Memory allocation request failed

117

Bad custom collating

118

Duplicate primary key allowed

119

Invalid transaction identifier

120

Exclusively locked in a transaction

121

Internal error in journaling

122

Object not locked

Published in Blogs
Read more...
Recital 10 enhances the APPEND FROM command. The enhancement was added to the following syntax ;
APPEND FROM  <table-name> 
Before when appending into a shared Recital table each new row was locked along with the table header, then unlocked after it was inserted. This operation has now been enhanced to lock the table once, complete inserting all the rows from the table and then unlock the table. The performance of this operation has been increased by using this method. All the database and table constraints are still enforced.
Published in Blogs
Read more...
Twitter

Copyright © 2024 Recital Software Inc.

Login

Register

User Registration
or Cancel