SQLMAKE - E4000033 - Updated 18th September 2001

SQLMAKE is a program which creates a text file of SQL statements that will create a database with approximately the same structure as the starting DP4 database. It can cater for problems caused by SQL reserved words being used as field or table names on the DP4 database, and also for name changes necessary because the target SQL database has a limit on the number of characters permitted in identifiers.

To run SQLMAKE you specify the database name in the usual way, and any of the numerous command tail options as listed in the help for the program. Two text files are used by the program to help generate the SQL, which you can edit to change the program behaviour:

12 Oct 2001 There are changes to name shortening as follows:

The program produces two output files:

Notes

You can use the -limit n command tail to specify a limit on identifier length. The default is now 64, or 30 if the -oracle option is specified, whereas in previous versions it was 18. SQLMAKE reduces identifier length where necessary by eliminating underscores, then vowels, then repeated consonants, then 'S' and 'R', and finally constructing a name based on the internal number of the table/field. The same shortened name will always be used for each table,role, or field, but apart from that the minimum amount of reduction will be done.

18 September 2001 SQLMAKE now generates CREATE SEQUENCE statements for auto-increment tables when the -oracle option is specified. The name for the sequence can be controlled using the -sequence_format command tail - normally you would specify either "%s_SEQ" or "SEQ_%s".

SQLMAKE does not currently try to specify a precision for numbers, or impose any constraints on the fields (other than that primary keys should not be null). No doubt it would be possible to generate more sophisticated SQL. If further enhancements to this program would be useful to you please let us know what your requirements are.

If you specify the -oracle option the default role separator is changed to _, which is the default for AUXORACL. In this case it is possible that two distinct fields in a table may be given the same name. If you use a $ role separator this cannot happen.

6th September 2001 The original download was missing the two .SQL files. Also there were a couple of minor bugs:

18 September 2001 Changes to name shortening, and CREATE SEQUENCE added.

12 October 2001 There is a known limitation in the way CREATE INDEX statements are generated: SQLMAKE ensures all indexes are unique by adding in components from the primary key of the table after any secondary key components. In some cases this can result in two indexes being created for the same set of fields. Oracle treats this as an error. The error is harmless, but you can avoid it by switch off one or other of the indexes using SETLINK. If this error arises it is an indication that you can improve your DP4 database by switching off the index with fewer key fields and updating your programs to use the other index. After reorganisation your database will be smaller and updates to affected tables will be faster.

DP4 Version Compatibility

4.5xx,4.6xx. (with new USRLIBT.DLL)

Beta software is supplied without warranty and should not be used in live sites without the agreement of Itim Technology Solutions. Compatibility with an eventual final release cannot be guaranteed.

Downloads

4.523/4.619 Win32 SQLMAKE

Please make sure the RESERVED.SQL and DTYPES.SQL file are present in the working directory for SQLMAKE. You will need to post the SQLMAKE.M5 or SQLMAKE.M6 files to your system database - the maps are not compatible with the old version.