HPlogo ALLBASE/SQL C Application Programming Guide: HP 3000 MPE/iX Computer Systems > Chapter 1 Getting Started with ALLBASE/SQL Programming in C

Programming Under the MPE XL Operating System

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

You must take certain characteristics of the MPE XL operating system into account as you code ALLBASE/SQL C applications. These include the following:

  • Security Considerations.

  • File Naming Conventions.

  • Native Language Support.

Security Considerations

In order to preprocess and compile embedded SQL applications, you must have SF capability in the group where the preprocessing is done. You also need the ability to execute programs.

File Naming Conventions

When you create a DBEnvironment, a DBECon file having the name of the DBEnvironment is created. The fully qualified name of this DBECon file is stored in the DBECon file itself. In all references to files, the group and account of the DBEnvironment are assumed. For example, if your application connects to a DBEnvironment named PARTSDBE.SAMPLEDB.SYS and if the application creates a DBEFile as follows:

   CREATE DBEFILE ORDERS WITH PAGES=50, NAME='OrderF1'

the fully qualified name of the file will be ORDERF1.SAMPLEDB.SYS, regardless of what group and account the application is in. Fully qualified file names, enclosed in quotes, are restricted to a maximum length of 36 bytes.

Note that the DBEnvironment does not have to be in the same group and account as the user's application; if it is to be located in a group and account different from the group and account where the executable program resides, you should use a fully qualified DBEnvironment name, as in the following example:

   : RUN PSQLC.PUB.SYS:INFO="PARTSDBE.SAMPLEDB.SYS (MODULE SOMEMOD (DROP))"

Native Language Support

ALLBASE/SQL lets you manipulate databases in a wide variety of native languages in addition to the default language, known as NATIVE-3000. You can use either 8-bit or 16-bit character data, as appropriate for the language you select. In addition, you can always include ASCII data in any database, since ASCII is a subset of each supported character set. The collating sequence for sorting and comparisons is that of the native language selected.

You can use native language characters in a wide variety of places, including the following:

  • Character literals.

  • Host variables for CHAR or VARCHAR data (but not variable names).

  • ALLBASE/SQL object names.

  • WHERE and VALUES clauses.

If your system has the proper message files installed, ALLBASE/SQL displays prompts, messages and banners in the language you select, and it displays dates and time according to local customs. In addition, ISQL accepts responses to its prompts in the native language selected. However, regardless of the native language used, the syntax of ISQL and SQL commands--including punctuation--remains in ASCII.

Note that MPE XL does not support native language file names nor DBEnvironment names.

In order to use a native language other than the default, you must do the following:

  1. Make sure your I/O devices support the character set you wish to use.

  2. Set the MPE job control word NLUSERLANG to the number (LangNum) of the native language you wish to use. Use the following MPE XL command:

       SETJCW NLUSERLANG = LangNum
    

    This language then becomes the current language. (If NLUSERLANG is not set, the current language is NATIVE-3000.)

  3. Use the LANG = LanguageName option of the START DBE NEW command to specify the language of a DBEnvironment when you create it.

Run the MPE XL utility program NLUTIL.PUB.SYS to determine which native languages are supported on your system. Here is a list of some supported languages, preceded by the LangNum for each:



   0 NATIVE-3000         9 ITALIAN            52 ARABICW

   1 AMERICAN           10 NORWEGIAN          61 GREEK

   2 C-FRENCH           11 PORTUGUESE         71 HEBREW

   3 DANISH             12 SPANISH            81 TURKISH

   4 DUTCH              13 SWEDISH           201 CHINESE-S

   5 ENGLISH            14 ICELANDIC         211 CHINESE-T

   6 FINNISH            41 KATAKANA          221 JAPANESE

   7 FRENCH             51 ARABIC            231 KOREAN

   8 GERMAN

Resetting NLUSERLANG while you are connected to a DBEnvironment has no effect on the current DBE session.

Feedback to webmaster