RDB/VMS SQL — VMS SQLdev_2.0
Additional information available:
$@ALTERBEGIN_DECLARECLOSECOMMENT_ON
COMMITCREATEDBKEYDECLAREDELETEDESCRIBEDROP
EDITEND_DECLAREEXECUTEEXECUTE_IMMEDIATEEXIT
EXPORTFETCHGRANTHELPIMPORTINCLUDEINSERT
INTEGRATENULLOPENPREPAREQUITRELEASE
REVOKEROLLBACKSELECTSETSET_TRANSACTIONSHOW
SQLCASQLDAUPDATEUSERWHENEVER
aliasarith expressionauthorization idcol select expr
Command Recalldatabase handledata typesDCL invokedefault schema
Dynamic SQLErrorExecute(@)FunctionsInteractive kit
literalsModule languageNew FeaturespredicateRelease Notes
Sample Databaseselect exprsingleton selectValue expression
alias
A qualifier for column names. Users can qualify a column name with its table or view name, or with an aribitrary alias they specify in the FROM clause of an SQL statement. SQL requires aliases as qualifiers instead of table or view names in statements that join a table with itself.
arith expression
An arithmetic expression is a value expression formed by combining value expressions with arithmetic operators. When you use an arithmetic expression in a statement, SQL calculates the value associated with the expression and uses that value when executing the statement. Therefore, an arithmetic expression must be reducible to a value. However, SQL does not permit arithmetic operations on columns defined with the DATE data type. If either operand of an arithmetic expression is a null value, the resulting value is also null. Select More_Information to continue.
Additional information available:
More Information
The arithmetic operators and their functions are: + Add - Subtract * Multiply / Divide Select More_Information to continue.
Additional information available:
More Information
You can use parentheses to control the order in which SQL performs arithmetic operations. SQL follows the normal rules of precedence. That is, it evaluates arithmetic expressions in the following order: 1. Value expressions in parentheses 2. Multiplication and division, from left to right 3. Addition and subtraction, from left to right
authorization id
When you issue a CREATE SCHEMA or DECLARE SCHEMA statement, whether you specify a file specification or a data dictionary path name, you can specify an additional name, called an authorization identifier. You must specify an authorization identifier in CREATE SCHEMA but it is optional in DECLARE SCHEMA. An authorization identifier is a name for a particular attachment to a schema. Explicitly specifying an authorization identifer lets your program or interactive SQL statements refer to more than one schema. Once specified, you must use the authorization identifier when referring to the schema in subsequent SQL statements (unless those statements are within a CREATE SCHEMA statement). You must use an authorization identifier when you declare more than one schema. DIGITAL proprietary database languages (such as RDO in Rdb/VMS) use the term database handle instead of authorization identifier. The two terms mean the same thing. The keywords AUTHORIZATION ID in SQL and DB_HANDLE in RDO are also synonymous.
col select expr
col-select-expr =
SELECT -+------>------+-+-> * --------------------+-+
+-> ALL ------+ +-> table-name --+-> .* --+ |
+-> DISTINCT -+ +-> view-name ---+ | |
+-> alias -------+ | |
+-> value-expr -----------+ |
+--------------------------------<----------------+
+ FROM -++-> table-name -+-+----->----+-+-+--------->----------+-+
|+-> view-name --+ +-> alias -+ | +-> WHERE predicate -+ |
+---------- , <-----------------+ |
+------------------------------<---------------------------------+
++------------->------------------+-+---------->----------+-->
+-> GROUP BY -+-> column-name -+-+ +-> HAVING predicate -+
+------- , <-----+
Additional information available:
More Information
A column select expression is a select expression that specifies a
one-column result table. Column select expressions cannot specify a
list of select items.
SQL accepts a column select expression as a type of value expression.
However, since a value expression must correspond to a single value,
a column select expression used as a value expression should not
return more than one value. If it does, SQL evaluates the value
expression based on the first value returned by the column select
expression. For the same reason, a column select expression used as
a value expression cannot include GROUP BY or HAVING clauses.
NOTE
IN predicates allow column select expressions used as
value expressions to return more than one value.
Column select expressions are also called subqueries.
Command Recall
Interactive SQL users can recall the 20 most recent command lines
using the up and down arrow keys or the CTRL/B key sequence:
o The up arrow key recalls lines in sequence from most recent to
least recent.
o The CTRL/B key sequence also recalls lines in sequence from most
recent to least recent.
o After you have recalled prior lines, the down arrow key allows
you to recall more recently entered lines.
database handle
DIGITAL proprietary database languages (such as RDO in Rdb/VMS) use the term database handle instead of authorization identifier. The two terms mean the same thing. The keywords AUTHORIZATION ID in SQL and DB_HANDLE in RDO are also synonymous. For more information see the Help topic on authorization_id.
data types
data-type = --+-> CHAR -+--------+---------------------------+--> | +-> (n) -+ | +-> VARCHAR (n) -------------------------------+ +-> LONG VARCHAR ------------------------------+ +-> SMALLINT --+-+--------+--------------------+ +-> INTEGER ---+ +-> (n) -+ | +-> QUADWORD --+ | +-> DECIMAL -+-+-----------------------------+-+ +-> NUMERIC -+ +-> ( --> n -+--------+-> ) --+ | | +-> , n -+ | +-> FLOAT -+--------+--------------------------+ | +-> (n) -+ | +-> REAL --------------------------------------+ +-> DOUBLE PRECISION --------------------------+ +-> DATE --------------------------------------+
Additional information available:
More Information
Data types control how SQL interprets and stores values in columns. Literals, arithmetic expressions, parameters, and SQL functions are examples of expressions other than column names that supply values and also have associated data types.
DCL invoke
Gives access to DCL from inside interactive SQL. The dollar sign ($) instructs interactive SQL to spawn a subprocess and pass the rest of the command line to DCL for processing. You must follow the dollar sign with a DCL command. After DCL processes the command, it logs out of the subprocess and returns control to interactive SQL. For example: SQL> $ MAIL MAIL>
Additional information available:
Example
Seeing your current default VMS directory: SQL> $ DIRECTORY Directory DISK2:[DEPT3.ACCT] DEFPRO.SQL;6 NOTEQUAL.SQL;1 QUERY.SQL;1 REFEXAM.SQL;12 STORE.SQL;1 UPDATE.SQL;2 Total of 6 files. SQL>
default schema
SQL allows you to specify an authorization identifier that declares the schema as the default schema. Specifying a default schema means that subsequent statements during the database attachment that refer to the default schema need not use an authorization identifier. In the SQL module language, the authorization identifier specified in the module header is the one that designates the default schema. In precompiled SQL programs and in interactive SQL, the special authorization identifier RDB$DBHANDLE designates the default schema. In all environments, omitting an explicit authorization identifier is the same as specifying the authorization identifier that designates the default schema. Select More_Information to continue.
Additional information available:
More Information
If you do not declare any schema, SQL declares the schema specified in the logical name SQL$DATABASE as the default schema, using the FOR FILENAME clause. If you declare a schema specifying an authorization identifier other than the one that declares the default schema, you must use that authorization identifier to qualify names of any schema entities to which you refer in SQL statements. If you omit the authorization identifier, SQL assumes the table or view must be part of the default schema. If there is no default schema and you omit the authorization identifier, SQL generates an error.
Dynamic SQL
Dynamic SQL lets programs accept or generate SQL statements at run time, in contrast to SQL statements that are part of the source code for precompiled programs or SQL module language procedures. Unlike precompiled SQL or SQL module language statements, such dynamically executed SQL statements are not necessarily part of a program's source code, but can be created while the program is running. Dynamic SQL is useful when you cannot predict the type of SQL statement your program will need to process. You cannot use dynamic SQL statements in interactive SQL, but interactive help includes quick reference information on these dynamic SQL statements: DESCRIBE EXECUTE EXECUTE IMMEDIATE INCLUDE PREPARE
Error
The following topics document messages returned with the SQL facility code. The online file SYS$HELP:SQL$MSG.DOC contains the same text. Print that file if you need hardcopy SQL message documentation. The Appendix on error messages in the VAX SQL Reference Manual describes how to use this file and files documenting related error messages with other facility codes.
Additional information available:
ACENOTFNDACE_ID_OVFLACE_ID_UNFLADADISUNS
ADAVARUNSALT_SCH_RDB_ERRAMBHV_DECAMBTYP_DEC
AMB_KEYWORDANODBHANDARGNOTNUMARIEXPEXP
ASSSTRLITATTMISSINGBADBLOBBADCLUMPBADCORATT
BADDBHANDBADFILEVERBADMAINTBADMETNAM
BADPREPAREBADSUPLVLBADVERNUMBAD_ARRAY
BAD_CDD_DEFBAD_DBBAD_LENGTHBAD_LEVEL
BAD_NAMEBAD_PRECISIONBAD_SCALEBAD_TXN_STATE
BINSCAFACBIT_FIELDBOGUS_CDDBOOEXPEXPBUGCHK
CABORTCDDERRCDDUNKPROTCDDVERERRCHR_TOO_SHO
CHR_TOO_SMACIRCTYPECLOSERRCNTSPNSUBCOLEXISTS
COLNOTFUNCOLNOTNULCOLNOTUPDCOLNOTVAL
COMTOOLONCONALREXICONAMBIGCONCHAILL
CONDICREQCONNOTDEFCONNOTSUPCONTPREQ
CONVARDEFCONVARUNDCORREFFUNCRE_STO_ERR_SCH
CURALROPECURNAMEXICURNOTOPECUROFNOT
CUROFSTACURTWOOPENCURUSEINVDATCONERR
DATNOTSUPDATTYPUNKDBHANDUNKDBINUSE
DBKAMBIGDBKTOOBIGDB_EXISTSDB_HANDECDB_HANDEC2
DB_HANLONDB_IN_TXNDCLBEFEXEDCLDATBEF
DECCURINTODEFDBDECDEGMODSPCDELBACKUP
DIC_DB_CHG1DIC_DB_CHG2DIGNUMPICDROP_IDX
DROP_VIEWDRO_SCH_RDB_ERRDUPPROCNAMDYNSIZARR
ENDENUM_VARERRATTDECERRATTDEF
ERRDETERRINCPATHERRSYMDELERRSYMREP
ES_ILL_RPTEVACLAUNSEXESELSTAEXPNUMLIT
EXPQUEXPREXTRADATAFETNOTDONFIELD_EXISTS
FLDAMBIGFLDNOTBCKFLDNOTCRSFLDNOTDEF
FLDNOTINRELFLUINPBUFFORPASLENFUN_VARGARBLED
GFLOATHEXSTREVEHI_ORD_LOSHVNOTDECL
HV_NOT_INIDMISSINGILLBEGINILLCHARILLDATLENILLEXEIMM
ILLFLOLENILLHEXNUMILLINTLENILLPICSTRILLSTRCONT
IMPL_DIMIMP_IDX_CONFLICTIMP_IDX_TWICEIMP_STO_CONFLICT
IMP_STO_MAP_CONFLICTIMP_STO_MAP_TWICEIMP_STO_TWICE
INCNOTRECINC_DAT_TYPINDEXTSINDNOTDEF
INDSHOINTIND_EXISTSINSCOLALRINTVALLOWINTVALOVR
INVACLINVCHAINPINVCHANUMSTRINVCOLLSTINVCOLSPCINVCOMLIN
INVCONSINVDATCONINVDBKREFINVDISXPRINVFLD
INVFUNREFINVHVDECLINVINDEXINVNUMLIT
INVOBJFILINVPRIVINVQUALINVRELVIEWINVSELLISINVSELSTAR
INVSQLCODEINVSSCONVINVTYPEINVVALLISIOERROR
ISQLINTOJUNONLINLANFILEXTLANSWIVALLANUNSDTP
LENMISMATLOOK_FORLOOK_FOR_CONLOOK_FOR_FIN
LOOK_FOR_STMTLOOK_FOR_STTLOOK_FOR_UNTERMLOW_ORD_LOS
MAXFLDPRTSTRMAXNESEXCMAXRELEXCMISREQVAL
MULDIMARRMULSPECATRMULTSPECATRMULT_STRUCT
MUL_UICNAMCONFNAMTOOBIGNEG_DIMNESFUNINV
NESINCFILNESQRYEXPNOALTERNOBATUPDNOBCKFILNOBCKTRNS
NOCDDNOCDDALTNOCDDRESNOCDDUPDATNOCMPBYRES
NOCOLALLNOCOLNAMNOCONNAMNOCONRESNODATDIV
NODATRESNODBKGRONODBNAMENODEFDBNOFILLIST
NOFLDRESNOIDXRESNOITEMDEFNOLANGFILNOMAPRES
NOMODFILNONOVALNOOPENCURNOPRECOMPSELNOPROC
NORDBPRIVNORELFOUNORELRESNORTPARMNOSEGSTRAREA
NOSQLCANOSQLCODENOSTRDEFNOSTRNAMNOSUCHCUR
NOTDB2NOTFOUNDNOTGROFLDNOTHVDECLNOTUSEIND
NOTYPESNOT_A_DBNOT_CDD_DBNOT_SAME_CONTEXT
NOT_SCH_IDNOVIERESNO_COMMANDNO_DCLTXN
NO_DECIMALNO_DESCENDINGNO_DMLPLANNO_ENDCOM
NO_ENDEXECNO_FILFNDNO_INCFNDNO_NUMERIC
NO_PLNFNDNO_SQLDANO_SUCH_FIELDNO_TXNOUT
NSEGBLRNULLNOINDNUMHVSNOTNUMITESEL
NUM_TO_DATEONEEPERMONETXNMODONLFIRPRE
ONLFIRVARONLONEDBONLONETRNONLYONEPSECTOPENERR
OPRSTK_OVRFLOORDNUM2BIGPARAMNOTSTRPARAMQUAL
PARBADCLAPARBADDATPARBADLENPARBADSCA
PARBINSCAPARSE_STACK_OVERFLOWPATH_NAM_REQPHYBACDAT
PREFORSTRPREMATURE_EOFPRESTAOPEPRINT_SSID
PROCNOCAPRPSELINTOPTR_VARQUAINVVALQUANOVAL
RDBVMSONLREANOWRTRECEXCMAXREFINS
RELAMBIGRELNOTDEFREL_EXISTSRESABORTRESERVED_WORD
SEGAREERRSEGSTREXPSELMORVALSEVERRDET
SMA_DAT_TYPSPACREQSPANOTVALSQLDANOTSQLDATA
SQLTYPESTANOTDEFSTANOTSELSTARNOTALL
STATWOCURSTOCOLERRSTOCOLUKNSTOTABUKN
STRARRAYSTRINXPRSTRLITEXPSTRLITMISQUOSTRMORELE
STRTOOBIGSTRXPREXPSUBNOGBSUBTOOVAL
SYM_EXPSYNTAX_ERRSYSPAGFORTBLNOTCUR
TOKINSBEFTOKTOOBIGTRAACTTRAACT_1TRAACT_2
TRAACT_3TRAHDLINVTRAMODSPCTREE_OVRFLO
TXNNOTLONGTXN_HNDL_IGNOREDUKN_ALT_OPTUNBDECFIL
UNBTMPFILUNDPARAMUNKTYPEUNSDATATYPE
UNSDB2PRIVUNSDSCCLAUNSDTPCVTUNSIGNED_VAR
UNSPLIATTUNSSTRXPRUNSSUPDATUNSUPOPUNTSTR
UPDCOLPRIVUPDREACURUSERINVIEWVECNOTIND
VEWNOTDEFWAIMODSPCWARDETWHYTWICE
WISH_LISTZABORT
ACENOTFND
No matching access control entry found Explanation: In a protection command that refers to an existing access control entry, you specified identifiers that did not match any existing entry. User Action: Use SHOW PROTECTION to see what the access control list currently looks like, and correct your command.
ACE_ID_OVFL
ACE identifier stack overflow during ACE parsing Explanation: You included too many identifiers in an expression. The identifier stack for the access control entry (ACE) overflowed during parsing. User Action: Simplify the access control entry that caused the error.
ACE_ID_UNFL
ACE identifier stack underflow during ACE parsing Explanation: The access control entry (ACE) identifier stack underflowed during ACE parsing. This happens when identifiers are not stored in the stack appropriately. User Action: Submit a software performance report (SPR) with the Rdb/VMS interchange file (.RBR).
ADADISUNS
Host variable <str> is based on a type that uses discriminamts Explanation: The host variable you referred to is based on a type which uses Ada discriminants. VAX SQL does not support types which include discriminants User Action: Use a different type defintion.
ADAVARUNS
Host variable <str> is based on a record type that uses variants Explanation: The host variable you referred to is based on a record type which uses Ada variants. VAX SQL does not support types which include variants. User Action: Use a different type defintion.
ALT_SCH_RDB_ERR
ALTER SCHEMA is only supported with Rdb/VMS Version 3.0 or later Explanation: The ALTER SCHEMA requires Rdb/VMS V3.0. VAX SQL will not alter schemas without Rdb/VMS Version 3.0 or later installed on the system. User Action: Install the Rdb/VMS Version 3.0 or later.
AMBHV_DEC
Host variable <str> was ambiguously defined Explanation: You declared a host variable ambiguously by using the same name in two host variable declarations. User Action: Change the name or level of one of the definitions.
AMBTYP_DEC
Host variable <str> was based on an ambiguously defined type Explanation: You declared a host variable which was based on a type. The type is ambiguous because two or more type declarations use the same name. User Action: Change the name or scope of one of the definitions.
AMB_KEYWORD
Ambiguous keyword abbreviation Explanation: You used an ambiguous abbreviation. User Action: Specify the entire keyword.
ANODBHAND
Another schema already declared with authorization identifier <str> Explanation: You specified in the DECLARE SCHEMA statement the same authorization identifier as in a previous DECLARE SCHEMA statement. User Action: Either issue a FINISH statement and try the same DECLARE SCHEMA statement, or enter the DECLARE SCHEMA statement again with a different authorization identifier.
ARGNOTNUM
Argument must be numeric Explanation: The expression for an AVG or SUM function must be numeric. User Action: Change the value expression to contain only numeric fields, or remove the function.
ARIEXPEXP
Expected arithmetic value expression Explanation: You supplied a predicate where SQL expected to find an arithmetic value expression. User Action: You must use an arithmetic value expression in this context.
ASSSTRLIT
Numeric literal is assumed to be text
Explanation: You tried to store a numeric literal into a text
column or compare a numeric literal to a text column. SQL
assumes the string is a text literal and converts it for the
storage or comparison. Note that each digit in the numeric
literal, including leading zeroes, is converted to text. For
instance, 001 and 1 represent the same number, but are converted
to different literals ("001" and "1").
User Action: None. However, it is good programming practice to
convert the numeric literal to a string literal by enclosing it
in quotes.
ATTMISSING
invalid or missing attributes Explanation: Internal error -- a required attribute (such as the data type in a GLOBAL FIELD clump) is missing. User Action: Submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error.
BADBLOB
unable to import a segmented string Explanation: Error from Rdb$CREATE_SEGMENTED_STRING. See the following message for more information. User Action: If the nature of the problem is not obvious, submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error.
BADCLUMP
invalid clump type encountered Explanation: Internal error - bad data in the Rdb/VMS interchange file (.RBR). User Action: Submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error.
BADCORATT
invalid core attribute <num>, <num> in .RBR file Explanation: Internal error - bad data in the Rdb/VMS interchange file (.RBR). User Action: Submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error.
BADDBHAND
Authorization identifier <str> not used by this query Explanation: You used an authorization identifier to qualify a reference to a column and that authorization identifier was not specified in the FROM clause of the query. User Action: Either remove the authorization identifier that qualifies the select-list item or specify the same authorization identifier as specified in the FROM clause of the query.
BADFILEVER
incompatible .RBR file type Explanation: This version of SQL cannot import a database from this Rdb/VMS interchange file (.RBR). User Action: Use a version of RDO that corresponds to the version of RDO that created this file.
BADMAINT
Database is an unsupported maintenance release for the current version Explanation: The maintainance release number and the version number of the database that you just attached to forms an unknown combination. User Action: Check to make sure that you are running with the correct versions of Digital-supported database products for VAX SQL. Correct versions are listed in the VAX SQL Installation Guide.
BADMETNAM
Metadata names must end in A - Z or 0 - 9 Explanation: The name given in a data manipulation or definition statement ended with a dollar sign ($) or underscore (_). These symbols are not allowed. User Action: Specify a valid name.
BADPREPARE
Cannot use DESCRIBE or EXECUTE on a statement that is not prepared Explanation: You attempted to use a DESCRIBE or EXECUTE statement that named a statement which was not successfully prepared. User Action: Prepare the statement before calling DESCRIBE or EXECUTE.
BADSUPLVL
Attached database has unknown support level. Explanation: The database you just attached to has an unknown support level. User Action: Check to make sure that you are using Digital-supported database products for VAX SQL.
BADVERNUM
Attached database has unsupported version number. Explanation: The database you just attached to has a version number that is not supported by this version of VAX SQL. User Action: Check to make sure that you are running with the correct versions of Digital-supported database products for VAX SQL. Correct versions are listed in the VAX SQL Installation Guide.
BAD_ARRAY
Host variable <str> contains an array syntax error in its declaration. Explanation: The named variable is defined as a C array, but is either missing the closing "]" or contains a non-numeric dimension. User Action: Correct the syntax of the declaration and recompile the program.
BAD_CDD_DEF
CDD$DEFAULT is not valid, data dictionary default is now CDD$TOP. Explanation: Your logical name CDD$DEFAULT is not acceptable to the data dictionary. The data dictionary will be used, but your default is set to CDD$TOP. User Action: Define a valid CDD$DEFAULT.
BAD_DB
Data dictionary description of current schema is corrupt Explanation: The data dictionary description of the schema is missing the RDB$INSTANCE node. User Action: Verify that the schema itself has not been corrupted. If it has, recreate the schema.
BAD_LENGTH
Negative length specified for column <str> Explanation: You specified a length for a character or varchar column that was less than zero. User Action: Change the length to a positive number.
BAD_LEVEL
CONSISTENCY LEVEL <num> is illegal Explanation: Only values 2 and 3 are allowed for consistency level. User Action: Enter 2 for concurrency; enter 3 for consistency
BAD_NAME
Identifiers and names may not exceed 31 characters in length Explanation: The name given in a data manipulation or data definition statement was longer than the permitted limit. User Action: For data definition statements, specify a shorter name. For data manipulation statements, consult your database design specifications to find the correct name.
BAD_PRECISION
Invalid precision specified for column <str> Explanation: The precision specified for a DECIMAL or NUMERIC column is less than or equal to zero. Or, the precision specified for a FLOAT column was less than zero or greater than 15. User Action: Change the precision to a valid value.
BAD_SCALE
Negative scale specified for column <str> Explanation: The scale specified for a column is less than zero. User Action: Change the scale to a positive number.
BAD_TXN_STATE
Invalid transaction state. Transaction already started. Explanation: A SET TRANSACTION statement was executed, but it was not the first statement executed in the transaction. User Action: Make the SET TRANSACTION statement the first statement to be executed.
BINSCAFAC
Host variable <str> has a binary scale factor Explanation: The host variable is a PL/I fixed binary data type with a nonzero binary scale factor. SQL supports only decimal scale factors. User Action: Either change the scale factor to zero, or change the data type to fixed decimal.
BIT_FIELD
Host variable <str> is a bit field which is illegal in SQL statements. Explanation: The named variable is defined as a C bit field. Such fields are not legal in SQL statements. User Action: Use a different variable.
BOGUS_CDD
Installed version of data dictionary does not support this SQL version. Explanation: The version of the data dictionary on your system does not contain the necessary SQL support. User Action: Upgrade the version of data dictionary on your system. Alternatively, do not access the data dictionary with this version of SQL.
BOOEXPEXP
Expected a predicate Explanation: Either a numeric or string value expression was found where SQL expected a predicate. User Action: You must use a predicate in this context.
BUGCHK
There has been a fatal error. Please submit an SPR. No dump was produced Explanation: A fatal error has occurred. User Action: Submit an SPR with information about the circumstances under which the bug occurred. Note that SQL$_BUGCHECKs do not produce dumps as RDB$_BUGCHECKs do.
CABORT
User entered Control-C to abort statement Explanation: You typed a Control-C to abort the current statement. User Action: None.
CDDERR
Error occurred during attempt to use data dictionary. Data dictionary will not be used Explanation: An error occurred when SQL attempted to access the data dictionary. User Action: Refer to following data dictionary messages for more information.
CDDUNKPROT
Unknown data dictionary protocol <str> Explanation: The protocol in the data dictionary was not correct. User Action: Try to recreate the data dictionary. If the data dictionary is still corrupt, submit an SPR. Try invoking it with the file name.
CDDVERERR
Found data dictionary core_level <num> was expecting <num> Explanation: The core_level in the data dictionary was not correct. User Action: Try to recreate the data dictionary. If the data dictionary is still corrupt, submit an SPR. Try invoking it with the file name.
CHR_TOO_SHO
Character length of column <str> is too short Explanation: The character string length is too short to contain all possible converted data already stored in the column. User Action: None. This is a warning message only.
CHR_TOO_SMA
The string length of column <str> is too small Explanation: The length of the character string is too small to handle all possible numeric data that might already be stored in the table. User Action: None. This is a warning message only.
CIRCTYPE
Host variable !AC is based on a type which was used in its own definition Explanation: You referred to a host variable which is based on a type. The type was not validly defined because it was based on itself. User Action: Fix the type definition.
CLOSERR
error detected when closing .RBR file Explanation: See the message that follows for details. User Action: In the absence of other error messages, the database has probably been imported successfully.
CNTSPNSUB
Cannot spawn subprocess Explanation: The preprocessor was unable to spawn a subprocess to compile the program. User Action: Read the next message and determine what to do.
COLEXISTS
Column <str> is named more than once in table <str> Explanation: You attempted to create a table or view with using a column name more than once. User Action: Choose a different name for each column.
COLNOTFUN
Column <str> named outside a function in a SELECT with HAVING but no GROUP BY Explanation: In select expressions with a HAVING clause but without a GROUP BY clause, you cannot directly name columns in the select list or HAVING clause. You can refer to them only as function arguments, or in a WHERE clause. User Action: Either make the column named in the message a function argument, or if it is in a HAVING clause, change the HAVING clause to a WHERE clause. In general, avoid using HAVING without GROUP BY. Use WHERE instead.
COLNOTNUL
Column !AC.!AC cannot be UNIQUE because it can contain nulls. Explanation: You specified a column using the UNIQUE constraint. The column may contain nulls. This is not legal because two rows cannot contain the NULL values in this column. User Action: Define the named field as NOT NULL.
COLNOTUPD
Column <str> is not included in the FOR UPDATE clause of cursor <str> Explanation: VAX SQL provides the FOR UPDATE clause on a cursor definition for DB2 compatablity. The clause is entirely optional. If a FOR UPDATE clause is specified on the cursor and an UPDATE statement that uses the CURRENT OF clause with that cursor changes a column which is not one of the columns included in the FOR UPDATE clause of the DECLARE CURSOR statement, you will get this warning message. User Action: No action is required. This message will not effect the execution of the statement.
COLNOTVAL
The column CHECK constraint cannot refer to the column !AC Explanation: The CHECK constraint cannot refer to the column because the constraint is defined only for a column, not the entire table. User Action: Refer to the only that column for which this CHECK constraint is being defined or define the CHECK constraint for the entire table.
COMTOOLON
Command line longer than <num> character maximum Explanation: You typed a command line longer than the current maximum line length. User Action: Break up the command line with continuation lines. There is no practical limit on the total length of all continuation lines in a single command.
CONALREXI
Constraint name <str> on table <str> is already exists in this schema Explanation: You requested that a constraint be named with the name of an existing constraint. User Action: Choose a different name.
CONAMBIG
Constraint name <str> was not qualified and is in multiple schemas Explanation: You must qualify the constraint name with an authorization identifier when accessing more than one schema that uses that constraint name. User Action: Make sure the DECLARE SCHEMA statements include authorization identifiers and retype the query using the appropriate authorization identifier.
CONCHAILL
Cannot begin program with continuation character Explanation: Apparently the COBOL program starts with a continuation character. User Action: Correct the source text and resubmit the job.
CONDICREQ
Conflicting dictionary requirements Explanation: You specified both the DICTIONARY IS REQUIRED and DICTIONARY IS NOT REQUIRED clause in the same ALTER SCHEMA statement. User Action: Change the ALTER SCHEMA statement to include only one type of DICTIONARY REQUIRED option.
CONNOTDEF
Constraint <str> is not defined in schema Explanation: The specified constraint does not exist in the current schema. User Action: Declare the correct schema. Check the constraint name for correct spelling. Check the constraint definition to make sure you did not specify a term where the constraint name was expected.
CONNOTSUP
<str> is a constant host variable Explanation: You referred to a host variable which was declared as a constant. Constant declarations are not supported. User Action: Either specify the constant as a literal, or use a host variable with that value.
CONTPREQ
P characters must be contiguous in an edit string Explanation: More than one P characters are permitted in an edit string, but they must all be contiguous. This edit string contained more than one P characters that are not contiguous. User Action: Make the P characters contiguous.
CONVARDEF
Column qualifier <str> is already defined Explanation: You either specified the same alias more than once in a select expression or did not specify an alias in a select expression that joins a table with itself. User Action: Either use unique aliases or introduce an alias.
CONVARUND
Column qualifier <str> is not defined Explanation: You qualified a column name with an alias or table not specified in the FROM clause of the select expression. User Action: Make sure the qualifier you used matches an alias or table specified in the FROM clause.
CORREFFUN
Correlated references in functions must not be in expressions Explanation: You cannot use a correlated reference that is part of a value expression containing comparison operators, when the value expression is itself an argument to a function. For example, SUM(corr_reference + 5). User Action: Reformulate the select expression to avoid using a correlated reference in this manner.
CRE_STO_ERR_SCH
CREATE STORAGE AREA statement only valid as part of a CREATE SCHEMA statement Explanation: The CREATE STORAGE AREA statement is only valid as part of the CREATE SCHEMA statement. User Action: Place the CREATE STORAGE statement in the CREATE SCHEMA statement.
CURALROPE
Cursor <str> was already open Explanation: You opened a cursor that was already open. An implicit close will be done on the cursor and the cursor reopened. User Action: None. This is just a warning.
CURNAMEXI
Cursor name !AC has already been declared Explanation: You cannot use the same name in more than one DECLARE CURSOR statement. User Action: Change the name of this cursor.
CURNOTOPE
Cursor <str> is not opened Explanation: You named a cursor that was not open in a FETCH statement, CLOSE statement, or in the WHERE CURRENT OF clause of an UPDATE or DELETE statement. User Action: Issue an OPEN statement for the cursor before naming it in any of those statements. Close the cursor only once after opening it.
CUROFNOT
CURRENT OF cursor-name is allowed only in UPDATE and DELETE statements Explanation: The CURRENT OF cursor-name clause is used to modify or delete the current record in a cursor. It has no meaning in the WHERE clause of a select expression. User Action: Replace the WHERE CURRENT OF clause with a WHERE predicate clause that specifies the record you wish to select.
CUROFSTA
CURRENT OF clause cannot refer to cursor based on prepared statement Explanation: The CURRENT OF clause of an UPDATE or DELETE statement specifies a cursor based on a prepared statement. Because the prepared statements are generated at run time, you cannot precompile UPDATE or DELETE statements that refer to cursors based on them. User Action: Use a cursor which is based on an embedded SELECT statement (which is known at compile time), or dynamically execute the UPDATE or DELETE statement so it can be interpreted at run time.
CURTWOOPEN
Cursor <str> has two open procedures Explanation: There are two open procedures for this cursor. A module can only have one procedure which opens a particular cursor. User Action: Remove one of the procedures which opens this cursor. Call the remaining procedure more than one time.
CURUSEINV
USING clause not allowed for this cursor Explanation: An OPEN or FETCH statement can specify a USING clause only for cursors based on a statement named in a PREPARE statement. The cursor specified in this OPEN or FETCH statement is not. User Action: Remove the USING clause from the OPEN or FETCH statement.
DATCONERR
Data conversion error Explanation: An error occurred during data conversion. Refer to next message. User Action: The secondary message should clarify the problem.
DATNOTSUP
Date datatype not supported in this context Explanation: The output of a date value to the language file is not supported. User Action: Do not use dates in this manner.
DATTYPUNK
Data type unknown. Expression cannot use only host variables Explanation: An assignment or a predicate must have at least one database field or literal. User Action: You must use a database variable or literal in the expression.
DBHANDUNK
No DECLARE SCHEMA statement specified an identifier of <str> Explanation: You specified an unknown authorization identifier to qualify a table or view name in a select expression. User Action: Check the query and the DECLARE SCHEMA statement to make sure the authorization identifiers match.
DBINUSE
Schema cannot be dropped because it is currently in use. Explanation: You issued a DROP SCHEMA statement, but another user had declared the same schema. User Action: Wait for other users to finish with the schema. If the schema is in use, however, one would question the wisdom of trying to delete it. Remember that patience is a virtue.
DBKAMBIG
DBKEY reference is ambigous Explanation: You made an unqualified reference to DBKEY in a context where there is more than one source of a dbkey. User Action: Add a table qualifier to the DBKEY reference.
DBKTOOBIG
The DBKEY for table <str> is <num> bytes, host variable <str> must be the same size or larger. Explanation: The host variable you are using with the DBKEY is not the same size as the dbkey. User Action: Allocate a host variable which is the correct size.
DB_EXISTS
The data dictionary pathname, <str>, chosen for the schema name already exists Explanation: The data dictionary path name chosen for the schema name already exists in the current directory. User Action: Use another, unique data dictionary path name.
DB_HANDEC
Handle already declared Explanation: You declared a database handle via ACMS. This interferes with defining a handle through the dynamic interface. User Action: You should not specify another handle.
DB_HANDEC2
Handle already declared Explanation: You have declared a database handle via ACMS. This interferes with defining a handle through the dynamic interface. This also interferes with declaring multiple database handles. User Action: You should not specify another handle.
DB_HANLON
The authorization identifier must be a longword Explanation: Authorization identifiers that are passed from a program must be longwords passed by descriptor. User Action: Define the authorization identifier to be a longword. Examples: For COBOL: 01 AUTHID PIC S9(9) COMP. For FORTRAN: INTEGER*4 AUTHID.
DB_IN_TXN
Authorization identifier <str> is already part of this transaction Explanation: You specified an authorization identifier twice within in the transaction parameters of SET TRANSACTION or DECLARE TRANSACTION. User Action: Specify the authorization identifier only once.
DCLBEFEXE
DECLARE TRANSACTION and DECLARE SCHEMA must be before executable statements Explanation: DECLARE TRANSACTION and DECLARE SCHEMA must come before the first executable statement in a program. An executable statement is a statement such as SELECT, INSERT, UPDATE, OR CREATE. To avoid this error, put all DECLARE SCHEMA and DECLARE TRANSACTION statements in a context file, if possible. User Action: Move all DECLARE TRANSACTION statements and DECLARE SCHEMA statements before all executable statements. You should specify all DECLARE SCHEMA statements before the first DECLARE TRANSACTION statement.
DCLDATBEF
DECLARE SCHEMA must be before other DECLARE statements Explanation: All DECLARE SCHEMA statements must come before any DECLARE CURSOR, DECLARE TRANSACTION, or DECLARE TABLE statements in a program. User Action: Move all DECLARE SCHEMA statements before other DECLARE statements.
DECCURINTO
DECLARE CURSOR statement cannot include an INTO clause Explanation: You specified an INTO clause in the select expression in the DECLARE CURSOR statement. It should go in the FETCH statement or in a singleton select statement. User Action: Remove the INTO clause.
DEFDBDEC
A schema has already been declared with the default authorization identifier Explanation: You attempted to declare a default schema when there already was a default schema. In interactive SQL, you get this error only if you choose not to override the current default schema declaration. User Action: Include an authorization identifier which has not been declared in the DECLARE SCHEMA statement.
DEGMODSPC
Only one degree mode may be specified for a transaction Explanation: You specified both concurrency options (CONSISTENCY LEVEL 2 and CONSISTENCY LEVEL 3) in a DECLARE TRANSACTION statement. User Action: Specify only one option in your DECLARE TRANSACTION statement.
DELBACKUP
EXPORT errors, interchange file deleted Explanation: The export that you were performing could not be successfully completed. User Action: Determine why the export failed and correct that situation.
DIC_DB_CHG1
A dictionary definition used by schema <str> has changed Explanation: This database refers to a definition in the dictionary that has changed. User Action: Use the INTEGRATE statement to resolve any differences.
DIC_DB_CHG2
Use the INTEGRATE statement to resolve any differences between the dictionary and the database Explanation: The data definitions in the data dictionary no longer match the definitions in the database file. User Action: Use the INTEGRATE statement to resolve any differences.
DIGNUMPIC
more than 31 digits in a numeric edit string Explanation: The edit string generates more than 31 digits. User Action: Reduce the number of digits in this numeric picture string.
DROP_IDX
Index <str> is also being dropped. Explanation: When you issue the DROP TABLE statement, SQL also drops all indexes that use that table. This message notifies you which indices those are. It is informational only. User Action: None.
DROP_VIEW
View <str> is also being dropped. Explanation: When you issue the DROP TABLE statement, SQL also drops all views that use that table. This message notifies you which views those are. It is informational only. User Action: None.
DRO_SCH_RDB_ERR
DROP SCHEMA statement is only supported with Rdb/VMS Version 3.0 or later Explanation: VAX SQL will not drop schemas without Version 3.0 or later of Rdb/VMS installed on the system. User Action: Install Version 3.0 or later of Rdb/VMS on the system. Alternatively, you can delete the schema by deleting the files at DCL level and from the dictionary by using the dictionary utility.
DUPPROCNAM
<str> is a duplicate procedure name Explanation: There are two procedures in this module with this name. User Action: Change the name of one of the procedures.
DYNSIZARR
Host variable <str> is an array whose bounds are determined at runtime Explanation: The SQL precompilers do not support references to arrays whose bounds are determined at run time (dynamically-sized arrays). User Action: Assign the value in the dynamically-sized array to a field which is not in a dynamically-sized array before using it in an SQL statement.
END
End of input Explanation: No more input was given to SQL. User Action: None.
ENUM_VAR
Host variable <str> is an enum variable which is illegal in SQL statements. Explanation: The named variable is defined as a C enum variable. Such fields are not legal in SQL statements. User Action: Use a different variable.
ERRATTDEC
Error attaching to declared schema <str> Explanation: A DECLARE SCHEMA statement specified an invalid or nonexistent file specification or data dictionary path name. See the messages following this message for more information. User Action: Change the DECLARE SCHEMA statement to specify a valid file specification or path name.
ERRATTDEF
Could not use database file specified by SQL$DATABASE Explanation: If you do not issue an explicit DECLARE SCHEMA statement, VAX SQL uses the database file specified by the logical name SQL$DATABASE. Because the logical name SQL$DATABASE is not defined or does not refer to a valid database, SQL could not attach to a database. See the messages following this message for more information. User Action: Explicitly declare a schema before executing any statements which require a database, or define the logical name SQL$DATABASE to specify the database file you wish to use.
ERRDET
An error was detected Explanation: This is the exit status for a preprocessor when an error was detected. User Action: Correct the error in the host language program and resubmit the job to the preprocessor.
ERRINCPATH
Error including record at pathname "<str>" Explanation: An error was reported trying to include a record from the dictionary. User Action: Correct the pathname in the include from dictionary statement.
ERRSYMDEL
Error symbol deleted Explanation: When parsing an SQL statement, the parser encountered an error. The message for that error appeared prior to this message. In an attempt to recover from that error SQL deleted the token it found, and generated this message to help you understand any additional messages that follow. User Action: None. This is an informational message only.
ERRSYMREP
Error symbol replaced by <str> Explanation: When parsing an SQL statement, the parser encountered an error. The message for that error appeared prior to this message. In an attempt to recover from that error, SQL replaced the token it found with the specified token, and generated this message to help you understand any additional messages that follow. User Action: None. This is an informational message only.
ES_ILL_RPT
repeat count in edit string is not numeric Explanation: The user specified an edit string that contained a repeat count that was not a number, for example, X(9) is legal, but X(a) is not. User Action: Specify only numeric values for repeat counts.
EVACLAUNS
EVALUATING clause ignored Explanation: The DECLARE TRANSACTION statement in SQL does not support the EVALUATING clause to specify when the database system evaluates constraints. Constraints are evaluated as specified in their definitions. User Action: Issue the DECLARE TRANSACTION statement without the EVALUATING clause.
EXESELSTA
Attempted to EXECUTE a SELECT statement Explanation: You used a prepared SELECT statement in an EXECUTE statement. In dynamic SQL, the only way to process prepared SELECT statements is through cursors. User Action: Define a cursor based on the statement you tried to execute, and use the cursor in OPEN and FETCH statements. Otherwise, use non-SELECT statements only in EXECUTE statements.
EXPNUMLIT
Expected a numeric literal Explanation: A numeric literal was expected in this context. User Action: Correct the syntax.
EXPQUEXPR
A query expression was expected Explanation: SQL expected a query expression. You entered something else. User Action: Enter a query expression.
EXTRADATA
unexpected data at the end of the .RBR file Explanation: Internal error - found more data than expected in the Rdb/VMS interchange file (.RBR). User Action: Submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error.
FETNOTDON
A fetch has not been done yet for cursor <str> Explanation: You named a cursor in a CURRENT OF clause of an UPDATE or DELETE statement but you did not issue a FETCH statement for that cursor. User Action: Issue a FETCH statement for the cursor.
FIELD_EXISTS
Domain <str> already exists in this schema Explanation: You requested that a domain be named with the name of an existing type. User Action: Choose a different name.
FLDAMBIG
Column <str> is not unique in tables in the FROM clause Explanation: The specified column exists in more than one of the tables specified in the FROM clause. User Action: Qualify the column name in the select list with the table name or an alias.
FLDNOTBCK
global field <str> not defined as specified Explanation: The base field for a local field is not defined. User Action: This is caused by an inconsistency in the database. Try to recover the missing global field.
FLDNOTCRS
Column <str> was not found in tables in the FROM clause Explanation: The specified column does not exist in the tables specified in the FROM clause. User Action: Check the select expression: you may have mistyped the column name or specified the wrong table name or alias to qualify the column name.
FLDNOTDEF
Column <str> is not defined in table <str> Explanation: The specified column does not exist in the table specified. User Action: Check the select expression: you may have mistyped the column name or specified the wrong table name or alias to qualify the column name.
FLDNOTINREL
<str> is not a column in table, <str> Explanation: The column you specified is not part of the named table. User Action: Check the table definition for the correct column name or specify another table.
FLUINPBUF
Indirect command file buffer flushed for Control C Explanation: You typed Control-C while executing an indirect command file. User Action: None.
FORPASLEN
Host variable <str> is an unsupported passed-length variable Explanation: The host variable declaration uses the FORTRAN passed-length (*) feature which is not supported. User Action: Either change the declaration so that only supported attributes are used, or move the data to another variable which uses only supported attributes.
FUN_VAR
Host variable <str> is function which is illegal in SQL statements. Explanation: The named variable is defined as a C function. Functions refnereces are not supported in SQL statements. User Action: Use a different variable.
GARBLED
interchange file is corrupt Explanation: Internal error - probably mismatched BEGIN and END clumps. User Action: Submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error.
GFLOAT
!AC does not support G_FLOAT Explanation: /G_FLOAT was specified for a language such as COBOL which does not support the G_FLOAT datatype. User Action: Unless you are taking the G_FLOAT number and passing it to a language which understands G floating numbers, you probably want to reprecompile without the /G_FLOAT qualifier. If you use it from this language, the compiled code will think it is a different number than the database system did.
HEXSTREVE
A hexadecimal string must have an even number of digits Explanation: A hexadecimal string must have an even number of digits. This is because it takes two hexadecimal digits to represent each ASCII character. User Action: Enter a hexadecimal number with an even number of digits.
HI_ORD_LOS
Increasing the scale of column <str> may result in the loss of high order digits Explanation: Increasing the scale of a column may result in the loss of significant digits of the data already stored in that column. User Action: None. This is a warning message only.
HVNOTDECL
Host variable <str> was not declared Explanation: Every host variable that is used in an SQL statement in a program must been declared in the host language. User Action: Declare the specified variable using a supported declaration.
HV_NOT_IN
Host variable, <str>, not within scope of BEGIN DECLARE and END DECLARE section Explanation: Your program referred to a variable that was declared outside of the BEGIN DECLARE and END DECLARE statements. User Action: Either move the desired host variable declaration to be within this section or remove the BEGIN DECLARE and END DECLARE statement. You can also ignore this warning message. BEGIN DECLARE and END DECLARE are only for standard complicance.
IDMISSING
an authorization ID or a filename is required to create a schema Explanation: The user specified an IMPORT or a CREATE SCHEMA statement without specifying an authorization ID or a filename. One of is required. User Action: Specify the missing parameter and retry the operation.
ILLBEGIN
file <str> is corrupt or not an Rdb interchange file Explanation: SQL IMPORT can recreate databases only from the Rdb/VMS interchange file (.RBR). This file is not an Rdb/VMS interchange file (.RBR). User Action: Retry the operation with the correct file name.
ILLCHAR
Illegal character detected Explanation: An illegal character has been detected. User Action: Use only valid characters.
ILLDATLEN
An invalid SQLLEN(<num>) was found for a date field in the SQLDA Explanation: You passed in a date column in a SQLDA with a SQLLEN that was not 8. User Action: Set the SQLLEN to 8 for date columns in the SQLVAR.
ILLEXEIMM
Illegal EXECUTE IMMEDIATE statement type Explanation: You tried to issue a statement that is not allowed in an EXECUTE IMMEDIATE statement (SELECT, DECLARE, OPEN, FETCH, CLOSE, PREPARE, DESCRIBE, EXECUTE, INCLUDE, or WHENEVER). User Action: Use PREPARE and a full EXECUTE statement for these statements.
ILLFLOLEN
An invalid SQLLEN(<num>) was found for a FLOAT field in the SQLDA Explanation: You passed in an SQLDA with a SQLTYPE FLOAT SQLLEN that was invalid. Only 4, 8, an 16 are legal floating-point lengths. User Action: Set the SQLLEN to 4, 8, or 16, depending on the length of the floating-point variable passed.
ILLHEXNUM
Illegal hexadecimal number. Explanation: The format of a hexadecimal number is X'ffff', where ffff may be up to 16 hexadecimal digits. A hexadecimal digit is a numeric digit (0 to 9) or an A, B, C, D, E, or F. The letters may be upper or lower case. There must be an even number of digits. User Action: Enter a proper hexadecimal number. Make sure that the trailing apostrophe is included.
ILLINTLEN
An invalid SQLLEN(<num>) was found for a integer column in the SQLDA Explanation: You passed in an integer column in a SQLDA with a SQLLEN that was invalid. For SQLTYPE of INTEGER, SQLLEN must be 4. For SQLTYPE of SMALLINT, SQLLEN must be 2. User Action: Set the SQLLEN to 2 for SMALLINT, or 4 for INTEGER.
ILLPICSTR
illegal character !AF in edit string Explanation: An edit string contained the illegal character specified in the message. User Action: Change the edit string to not have that character.
ILLSTRCONT
Illegal string continuation Explanation: Your program has illegal string continuation. User Action: In COBOL, to continue a string you must do three things: 1) not end the string with a quote on the initial line; 2) insert a continuation character (-) in the first column of the next line; and, 3) start the continued string with a quote as the first nonblank character after the continuation character (this quote is ignored).
IMPL_DIM
Host variable <str> is defined with an implicit dimension. Explanation: The named variable is defined using the C feature of determining the dimension of an array from its initialization. Such variables are not legal in SQL statements. User Action: Define the array variable using an explicitly-sized array.
IMP_IDX_CONFLICT
DEFINE and DELETE INDEX <str> specified Explanation: The user specified a DEFINE and DELETE INDEX using the same name. User Action: Specify a either a DEFINE or a DELETE INDEX.
IMP_IDX_TWICE
DEFINE INDEX <str> specified twice Explanation: The user specified a DEFINE INDEX twice using the same name. User Action: Specify a INDEX name only once.
IMP_STO_CONFLICT
DEFINE and DELETE STORAGE AREA <str> specified Explanation: The user specified a DEFINE and DELETE STORAGE AREA using the same name. User Action: Specify a either a DEFINE or a DELETE STORAGE AREA.
IMP_STO_MAP_CONFLICT
DEFINE and DELETE STORAGE MAP <str> specified Explanation: The user specified a DEFINE and DELETE STORAGE MAP using the same name. User Action: Specify a either a DEFINE or a DELETE STORAGE AREA.
IMP_STO_MAP_TWICE
DEFINE STORAGE MAP <str> specified twice Explanation: The user specified a DEFINE STORAGE MAP twice using the same name. User Action: Specify a STORAGE MAP name only once.
IMP_STO_TWICE
DEFINE STORAGE AREA <str> specified twice Explanation: The user specified a DEFINE STORAGE AREA twice using the same name. User Action: Specify a STORAGE AREA name only once.
INCNOTREC
<str> is not a dictionary record definition Explanation: The data dictionary path name in an INCLUDE FROM DICTIONARY statement must specify a dictionary record definition. The dictionary object specified is not a record definition. User Action: Change the path name to the path name for a record definition, or remove the INCLUDE statement.
INC_DAT_TYP
Altering column <str> to an incompatible datatype may cause data loss Explanation: Altering a column to a datatype that is incompatible with the old datatype might cause data already stored in that column to appear lost. User Action: None. This is a warning message only.
INDEXTS
There is another index named, <str>, in this schema Explanation: The index name you tried to define already exists. User Action: Try another index name.
INDNOTDEF
Index <str> is not defined in schema Explanation: The specified index does not exist in the current schema. User Action: Declare the proper schema. Spell the index name correctly. You may have specified an expression where an index name was expected.
INDSHOINT
Indicator variable <str> is not a short integer Explanation: Indicator variables should be declared as the host language equivalent of a SMALLINT data type. User Action: In COBOL, declare indicator variables as PIC S9(4) COMP. In FORTRAN, declare indicator variables as INTEGER*2. In PL/I, declare indicator variables as FIXED(15) BINARY.
IND_EXISTS
Index <str> already exists in this schema Explanation: You attempted to create an index with the name of an existing index User Action: Choose a different name.
INSCOLALR
Column <str> appears more than once in the INSERT column list Explanation: You specified the same column name more than once in an INSERT statement. Columns can only appear once. User Action: Remove one occurrence of all columns which appear more than once.
INTVALLOW
Interval value must be at least 256 Explanation: The specified interval value for space management pages is too small. The minimum value is 256 pages. User Action: Change the interval value for space management pages on the CREATE SCHEMA statement to a legal value.
INTVALOVR
Interval value overwritten to 256 pages Explanation: The specified interval value for space management pages is too small. The minimum value is 256 pages. VAX SQL overwrote the specified value with 256. User Action: Change the interval value for space management pages on the CREATE SCHEMA statement to a legal value.
INVACL
Invalid Access Control List entry Explanation: The syntax of the access control list entry string is not valid. User Action: Correct the syntax of the access control list entry.
INVCHAINP
Invalid character in input Explanation: The input contains an illegal or unrecognizable character. User Action: Correct the source text and resubmit the job.
INVCHANUMSTR
Invalid character in numeric string Explanation: The string appears to be a numeric literal. However, it contains one or more illegal characters. User Action: Correct the source text and resubmit the job.
INVCOLLST
column list in view definition contains the wrong number of names Explanation: The list of column names you specified in a view definition contained a different number of names than the number of value expressions in the select list of the definition's SELECT expression. There must be a strict one-to-one correspondence between the two lists. User Action: Specify the same number of column names in the column list as value expressions in the select list.
INVCOLSPC
Column names must be qualified by table names. Explanation: You must qualify the column name in a COMMENT ON COLUMN statement with a table name. User Action: Specify the column name as <table-name>.<column-name>.
INVCOMLIN
Invalid command line Explanation: You specified extra parameters or invalid command line syntax in a module language compiler command line. User Action: Specify only supported command line options.
INVCONS
unable to import constraint <str> Explanation: Internal error - the named constraint will not appear in the recreated database. User Action: Submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error. In the meantime, you can redefine this constraint explicitly.
INVDATCON
Invalid conversion between DATE column <str> and host variable <str> Explanation: Only binary dates can be compared or assigned to or from DATE columns. User Action: Use a date declaration for the host variable to be used with the date field: in COBOL, use S9(11)V9(7) COMP; in PL/I, use CHAR(8) or BYTE_FIELD(8); in FORTRAN, use CHARACTER*8.
INVDBKREF
Invalid DBKEY reference Explanation: You can refer to dbkeys only on the right hand side of an assignment or in an equals Boolean. User Action: Remove the invalid dbkey reference.
INVDISXPR
Invalid DISTINCT expression Explanation: In a function specification, if DISTINCT is specified, the value expression must be just a column name. You specified a value expression other than a column name in a function with the DISTINCT clause, such as SUM(DISTINCT SALARY_AMOUNT * .10). User Action: Change the value expression to a column name or remove the DISTINCT clause.
INVFLD
unable to import field <str> Explanation: Internal error - the named field will not appear in the recreated database. User Action: Submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error.
INVFUNREF
Invalid function reference Explanation: You cannot include in the WHERE clause (or in any subqueries of the WHERE clause) functions that use columns of tables in the FROM clause as their argument. User Action: Change your select expression to eliminate functions with this type of argument.
INVHVDECL
Host variable <str> was invalidly declared. Explanation: Every host variable that is used in an SQL statement in a program must be declared in the host language using the supported subset of declaration syntax for the language. Not using the supported subset causes this error. Another way this message can be generated is to use an indicator variable that is not a signed word (for example, in COBOL: PIC S9(4) COMP). User Action: Use host variable declaration syntax for this variable that is supported by SQL.
INVINDEX
unable to import index <str> Explanation: Internal error - the named index will not appear in the recreated database. User Action: Submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error. In the meantime, you can recreate this index explicitly.
INVNUMLIT
!AS is an invalid numeric literal Explanation: An invalid numeric literal was specified which could not be converted to a numeric value. This is usually because it is to big to fit into any VAX data type without losing significance. User Action: Change the literal to be a valid numeric literal.
INVOBJFIL
Invalid object file <str> specified
Explanation: SQL uses the same directory specification and file
name for any files it creates (such as the language files) as
that specified in the /OBJECT qualifier on the command line.
You specified a nonexistent or invalid file specification
for the /OBJECT qualifier.
User Action: Use a valid object file specification with the
/OBJECT qualifier.
INVPRIV
Invalid privilege for this object Explanation: You used the ENTRY keyword with the GRANT statement. ENTRY is supported for REVOKE only. Or, a GRANT or REVOKE statement specified for a schema a privilege which is valid only for tables, or specified for a table a privilege which is valid only for a schema. User Action: Do not use ENTRY with GRANT. Or, make sure that the privileges you specify in GRANT or REVOKE are valid for the object (schema or table) named.
INVQUAL
Invalid qualifier <str> specified on command line Explanation: You specified invalid command qualifiers in a module language compiler command line. User Action: Specify only supported command line qualifiers
INVRELVIEW
unable to import table or view <str> Explanation: Internal error - the named relation or view (and its data) has been lost. User Action: Submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error.
INVSELLIS
Select list cannot mix columns and functions without GROUP BY Explanation: The select list in a select expression without a GROUP BY clause cannot include both functions and column references which are not in functions. User Action: Either add a GROUP BY clause, remove the function references, or remove the column references that are not in functions.
INVSELSTAR
* is not allowed in this context Explanation: You specified a column wildcard (* or p.*) in a context where wildcards are not supported, such as outside a select list or in a select list for a select expression containing a HAVING clause but no GROUP BY (in such a case, you cannot specify columns, either, unless they are an argument to a function). User Action: Replace the wildcard with the column name you want to use.
INVSQLCODE
SQLCODE has an invalid data type Explanation: SQLCODE must be declared as a signed longword. The declaration of SQLCODE in this program is a different data type. User Action: Change the data type of SQLCODE.
INVSSCONV
Invalid conversion for segmented string column <str> Explanation: You attempted to do an assignment using a segmented string. User Action: Do not use segmented strings.
INVTYPE
Host variable <str> is based on an invalid type Explanation: The host variable you referred to is based on a type which is either not a supported type definition or was invalidally declared. User Action: Use a different type defintion.
INVVALLIS
The value list must have as many items as the column list Explanation: An INSERT statement must have as many values in the value list as there are in the column list. You specified the wrong number of items. Note that if there are any host structures in the value list, they will be expanded to include their elementary items. In that case, to get the number of items in the value list, you must count the elementary items for all the host variables. User Action: Enter the correct number of values.
IOERROR
an unexpected I/O error occurred Explanation: Unable to read any more of the Rdb/VMS interchange file (.RBR); part of the database may be imported. User Action: Correct the problem indicated by the message that follows this message and retry the operation.
ISQLINTO
Interactive SQL does not support the INTO clause in SELECT or FETCH Explanation: SELECT and FETCH statements in interactive SQL cannot include INTO clauses, since interactive SQL does not support host variables. User Action: Enter the statement again, without the INTO clause, to display the values on the terminal.
JUNONLIN
Extraneous characters found after the end of the statement Explanation: You typed extra characters after the end of the statement. User Action: Check statement syntax for correct statement termination.
LANFILEXT
<str> is the language file extension, please use another extension Explanation: The input file type you specified to the precompiler is the same file type as the output file type. User Action: Rename the file with the default file specifications and run the precompiler again. Refer to the default file specifications in the VAX SQL User's Guide.
LANSWIVAL
Value not allowed on the language qualifier Explanation: The SQL precompiler requires a language qualifier (such as /COBOL) to specify the host language. However, you specified a value with that qualifier (such as COBOL=3), which is not allowed. User Action: Remove the value from the language qualifier.
LANUNSDTP
!AC does not support the datatype for parameter !AC Explanation: The language specified in the LANGUAGE clause of the module does not support the datatype specified for this parameter. User Action: If you did not intend to use a datatype the language does not support, change the datatype to one the language supports. If you know the language does not support the datatype, you can use it anyway. This is is only a warning message.
LENMISMAT
Truncating right hand side string for assignment to column <str> Explanation: You executed an INSERT or UPDATE statement, and the string you assigned to a text column is longer than the column's definition. User Action: The message is just a warning. You can issue an UPDATE statement to change the value stored or a ROLLBACK statement to terminate the transaction and cancel the INSERT operation.
LOOK_FOR
Syntax error, looking for <str>, found <str> instead Explanation: The syntax expected a specific keyword, but you entered another. User Action: Check the syntax and reenter the correct keyword.
LOOK_FOR_CON
<str> Explanation: This message lists syntactically legitimate alternatives. User Action: Consider options from the list.
LOOK_FOR_FIN
found <str> instead Explanation: Last of three messages generated by syntax errors, this message shows the invalid syntax that SQL encountered. User Action: Reenter the statement, or use EDIT to correct it.
LOOK_FOR_STMT
Syntax error, looking for a valid SQL statement, found <str> instead Explanation: SQL did not find the beginning of a statement where it expected one. User Action: Supply a valid statement.
LOOK_FOR_STT
Syntax error, looking for: Explanation: The syntax expected one of several valid possibilities, list follows. User Action: Consider options from the list in the next message.
LOOK_FOR_UNTERM
Syntax error, looking for <str>, found <str> instead Explanation: This is issued with a SQL-F-BUGCHK because it indicates that a severe error has occurred in the syntax tables. User Action: Record the exact command line as typed, (use EDIT to write it to a file) and submit an SPR. Then consider finding a workaround.
LOW_ORD_LOS
Reducing the scale of column <str> may result in the loss low order precision Explanation: Altering the scale of a column may result in the perceived loss of data stored in that column due to rounding. User Action: None. This is a warning message.
MAXFLDPRTSTR
Maximum number of columns for table in SELECT * is <num> Explanation: You used the column wildcard (*) in the select list for a table that has too many columns. User Action: Name a subset of the columns explicitly in the select expression.
MAXNESEXC
Maximum allowed statement nesting level exceeded Explanation: You exceeded the maximum allowed nesting of subqueries. User Action: Reduce the nesting level.
MAXRELEXC
Maximum number of tables allowed in SELECT exceeded Explanation: You exceeded the maximum number of tables allowed in the FROM clause of a select expression. User Action: Reduce the number of tables named in the FROM clause.
MISREQVAL
<str> must have a value Explanation: No value was specified for a qualifier that was which must have a value. User Action: Correct the command line syntax error, specifying a value for the qualifier.
MULDIMARR
Host variable <str> is a multi-dimensioned array Explanation: The SQL precompilers do not support references to multi-dimensioned arrays. User Action: Assign the value in the multi-dimensioned array to a field which is not in a multi-dimensioned array before using it in an SQL statement.
MULSPECATR
Attribute is specified redundantly Explanation: You specified a field attribute more than once. Because SQL can not determine which attribute to use, it rejects it. User Action: Respecify the definition without the redundant clauses.
MULTSPECATR
Multiple specified attribute. "<str>" was specified more than once Explanation: An attribute was specified more than once in a conflicting manner. User Action: Remove conflicts and try the statement again.
MULT_STRUCT
Host variable <str> is based on a structure defined more than once. Explanation: The named host variable is based on a structure that is defined more than once in the file being precompiled. Either the user defined the structure more than once in a single C procedure (which is illegal in any C program), or there is more than one procedure that defines the structure (legal in C, but the SQL C precompiler does not recognize that the structures are in two different procedures and generates this error).
MUL_UIC
Multiple UIC in ACL entry Explanation: You used more than one user identification code (UIC) in an ACL entry. User Action: Use only one UIC in ACL entry.
NAMCONF
the database pathname <str> is the same as another dictionary entity Explanation: The name chosen for the database is the same as another dictionary entity of a different type. User Action: Choose a different name.
NAMTOOBIG
The name <str> is longer than the <num> character maximum Explanation: You specified a name which is longer than the maximum supported length for names in this context. User Action: Use a shorter name.
NEG_DIM
Host variable <str> has a negative dimension. Explanation: The size of this array is less than or equal to zero. User Action: Only use positive dimensions.
NESFUNINV
Functions may not be nested Explanation: Functions cannot contain other functions in their arguments. For example, AVG(COUNT(DISTINCT(CITY)) is illegal. User Action: Do not nest functions.
NESINCFIL
Cannot include file <str> from another included file Explanation: You attempted to nest INCLUDE file-spec statements. Source code files specified in an INCLUDE file-spec statement cannot themselves contain nested INCLUDE file-spec statements. User Action: Move the INCLUDE statement to the main program.
NESQRYEXP
Column select expression was expected Explanation: You supplied something besides a column select expression where SQL expected one. User Action: Correct the syntax error.
NOALTER
No attributes specified for ALTER <str> Explanation: The user specified an ALTER DOMAIN statement or an ALTER TABLE ALTER column-name clause without specifying any attributes. User Action: Specify something to change.
NOBATUPD
BATCH_UPDATE is not supported in VAX SQL Explanation: A DECLARE TRANSACTION statement specified the BATCH_UPDATE transaction mode. VAX SQL does not support BATCH_UPDATE. User Action: Replace BATCH_UPDATE with READ_WRITE reserving the tables you want to update with EXCLUSIVE WRITE locking.
NOBCKFIL
export file <str> not created Explanation: An error has occurred during creation of the EXPORT file. User Action: Follow actions directed by the corresponding RMS error.
NOBCKTRNS
you cannot EXPORT a database from within a transaction Explanation: You typed EXPORT from inside a transaction. User Action: End the transaction and try again.
NOCDD
There is no data dictionary on this system. Specify FILENAME in the DECLARE SCHEMA statement Explanation: You declared a schema with a data dictionary path name, but there is no data dictionary running on this system. You must declare a schema using a file name. User Action: Declare the schema with the database file name.
NOCDDALT
There is no data dictionary on this system. Specify FILENAME in the ALTER SCHEMA statement Explanation: You altered a schema with a data dictionary path name, but there is no data dictionary running on this system. You must alter a schema using a file name. User Action: Alter the schema with the database file name.
NOCDDRES
the CDD will not be updated Explanation: You cannot store the database information in the CDD. See the following message. User Action: Correct the problem and retry the operation.
NOCDDUPDAT
Schema invoked by filename, the data dictionary will not be updated Explanation: You issued a data definition statement after invoking by file name User Action: This is a warning. You can ROLLBACK and invoke the schema by specifying the path name. This ensures that data definitions are updated both in the data dictionary and in the schema itself.
NOCMPBYRES
computed field !AC in relation !AC not imported Explanation: You specified a computed field in your database that could not be imported. Perhaps the field references other fields and relations that were deleted from the database by an older version of the software that would have permitted such a thing. User Action: You must investigate the problem further. The table should have been properly imported except for the listed column.
NOCOLALL
<str> interpreted as column name where none are allowed Explanation: An expression included a string SQL interpreted as a column name where a column name does not make sense. For example, specifying a column name in the VALUES clause of an INSERT statement generates this error. Or, omitting quotes around a string literal can also generate this error. User Action: Replace the string with a quoted literal or host variable, or use a different form of the statement which will allow column names.
NOCOLNAM
This view definition must explicitly list column names Explanation: You must specify names for all the columns in a view if the select expression in the view definition uses statistical functions or arithmetic expressions to create columns not in the source tables. User Action: Explicitly name each coulumn in the view definition.
NOCONNAM
Cannot create !AC constraint name for table !AC Explanation: SQL tried to create a unique name for a CHECK type constraint on the named table. SQL could not generate a unique name for this table. User Action: You can either delete all CHECK constraints for this table and then recreate all of the constraints or you can specify the DIAGNOSTIC parameter to give the constraint an explicit name.
NOCONRES
unable to import constraint <str> Explanation: Could not import this constraint -- see the message that follows. User Action: Correct the problem and retry the operation.
NODATDIV
No DATA DIVISION found in COBOL program. Explanation: Every COBOL program that uses embedded SQL must have a DATA DIVISION statement. None was found in your input file. User Action: Add a DATA DIVISION statement to your program.
NODATRES
remaining data for this relation will be ignored Explanation: An error occurred while you attempted to store the data; see the following message. User Action: Correct the problem and retry the operation.
NODBKGRO
There is no DBKEY for a row in a result table with a GROUP BY Explanation: A SELECT expression with a group by clause requested the DBKEY. There is no DBKEY for a row in a grouped table. User Action: Remove the DBKEY reference.
NODBNAME
A schema name was not specified on a DECLARE SCHEMA statement Explanation: You issued a DECLARE SCHEMA statement that did not specify a schema by file specification or data dictionary path name. User Action: Check the syntax of the DECLARE SCHEMA statement.
NODEFDB
There is no default authorization identifier Explanation: You specified a table name without an authorization identifier but there is no default authorization identifier. User Action: Either declare a default authorization identifier, or include the authorization identifier for a schema you have declared in the table name.
NOFILLIST
SQL does not support lists of files Explanation: You specified a list of module language files on the module language command line, or a list of context files on the precompiler command line. SQL does not support lists of files. User Action: Specify only one language file and one context file on a command line.
NOFLDRES
unable to import domain <str> Explanation: Could not import this domain. See the following message. User Action: Correct the problem and retry the operation.
NOIDXRES
unable to import index <str> Explanation: Could not import this index. See the following message. User Action: Correct the problem and retry the operation.
NOITEMDEF
unable to define item from command line Explanation: Could not define an item from the command line. See the following message. User Action: Correct the problem and retry the operation.
NOLANGFIL
No input file specified Explanation: You did not specify a file for the precompiler. User Action: Enter the precompiler command line again, specifying a file this time.
NOMAPRES
unable to import storage map <str> Explanation: Could not import this storage map. See the following message. User Action: Correct the problem and retry the operation.
NOMODFIL
No module file specified on command line Explanation: A module language compiler command line must include the name of a module file to compile. This command line did not. User Action: Repeat the command line with the name of a module file you wish to compile.
NONOVAL
Negated qualifiers may not have values Explanation: You specified a value for a qualifier that was preceded by NO. User Action: Correct the command line syntax error, removing NO or the value.
NOOPENCUR
There is no OPEN procedure for cursor <str> Explanation: There are no OPEN procedures for this cursor. A module must have exactly one procedure which opens a particular cursor. User Action: Add a procedure which opens this cursor.
NOPRECOMPSEL
No precompiler selected Explanation: You invoked the precompiler without specifying the language option desired. User Action: Specify a switch or file extension.
NOPROC
SQL statements must follow a procedure declaration Explanation: SQL statements must come after a procedure statement. This statement was found before any procedure statement. User Action: Put your SQL statements inside a procedure.
NORDBPRIV
GRANT or REVOKE specified only unsupported privileges Explanation: A GRANT or REVOKE statement specified only unsupported DB2 privileges. It has no effect. User Action: None. VAX SQL ignores the statement. However, to avoid this message, either remove the statement or add some supported privileges to it.
NORELFOU
No relation found for map !AC Explanation: The map name given has no table in the schema. User Action: Use the correct map name.
NORELRES
unable to import table <str> Explanation: Could not import this table. . See the following message. User Action: Correct the problem and retry the operation.
NORTPARM
!AC is not declared in procedure !AC Explanation: You used the parameter as a runtime parameter for a filename or pathname in a DECLARE SCHEMA statement. Such parameters must be declared in every procedure in the module, and must be character datatypes. You did not declare this paramter in this procedure. User Action: Declare the parameter as a character variable in the procedure.
NOSEGSTRAREA
segmented string storage area <str> is not defined Explanation: You specified a storage area in the SEGMENTED STRING STORAGE AREA clause that does not exist. User Action: Specify a storage area which is already defined in the CREATE SCHEMA statement.
NOSQLCA
No INCLUDE SQLCA statement was specified Explanation: Every precompiled SQL program must have an INCLUDE SQLCA statement in it. This program did not have one. User Action: Add an INCLUDE SQLCA statement.
NOSQLCODE
Neither SQLCA nor SQLCODE were declared Explanation: All precompiled SQL programs must include a definition for an SQL status variable. This can be done by specifying an INCLUDE SQLCA statement or by defining an integer host variable name SQLCODE. This program did neither. User Action: Add either an SQLCODE variable or an INCLUDE SQLCA statement.
NOSTRDEF
Host variable <str> is based on an undefined structure Explanation: The FORTRAN RECORD host variable declaration uses a structure name which has not be declared. User Action: Either change the name of the structure this host variable is based on, or define a structure with that name.
NOSTRNAM
RECORD host variable <str> does not specify a structure name Explanation: The FORTRAN RECORD host variable declaration does not specify the structure name which the record is based on. User Action: Add the name of the structure this host variable is based on.
NOSUCHCUR
Cursor !AC has not been declared Explanation: You must declare a cursor before you refer to it in an OPEN, CLOSE, FETCH, UPDATE, or DELETE statement. User Action: Declare the cursor, or use the name of a cursor which is already declared.
NOTDB2
"<str>" is a DB2 feature not supported by VAX SQL. Explanation: This is a feature supported by DB2 that VAX SQL does not support. User Action: Remove references to this feature.
NOTFOUND
No rows were found for this statement Explanation: No rows were found for an UPDATE or DELETE statement, or a query produced an empty table. User Action: None, this is a warning message.
NOTGROFLD
Column <str> cannot be referred to in the select list or HAVING clause because it is not in the GROUP BY clause Explanation: In the select list and HAVING clauses of select expressions containing the GROUP BY clause, you can refer only to those columns named in the GROUP BY clause. User Action: Either add the column named in the message to the GROUP BY clause, or delete from the select list or HAVING clause.
NOTHVDECL
<str> is not a host variable Explanation: The object referenced as a host variable was not a host variable. User Action: Refer to a host variable.
NOTUSEIND
Cannot use indicator variables in WHERE or HAVING Explanation: You cannot use indicator variables in WHERE clauses or HAVING clauses. User Action: Use the NULL keyword to test if a value is null.
NOTYPES
Domain reference in column !AC is illegal in a DECLARE TABLE statement Explanation: You referred to a user defined domain in a DECLARE TABLE statement. All domains in the DECLARE TABLE statement must be SQL predefined types. User Action: Substitute the predefined equivalent of the user defined domain.
NOT_A_DB
<str> is not the name of a DSRI-compliant database Explanation: You supplied the name of a schema that does not exist under this data dictionary directory, or you supplied a name that is not a DSRI-compliant database. User Action: Supply the name of a valid database.
NOT_CDD_DB
Schema was not declared using PATHNAME. Dictionary access is illegal. Explanation: You tried to include a dictionary entity in the schema, but the schema itself is not using the dictionary. User Action: Declare the schema using PATHNAME.
NOT_SAME_CONTEXT
The <str> being defined must be in the same schema as the <str> it references Explanation: When creating an item, the item was named as part of one schema, but it was being created from items of another schema. For example, trying to create an index in one schema from a table in another schema generates this error. User Action: Create the item naming only items from the same schema.
NOT_SCH_ID
Authorization identifier !AC not permitted within definition of SCHEMA !AC Explanation: You specified an authorization identifier of a schema that was other than the one for the schema being defined. User Action: Create defintions only for a single schema in a CREATE SCHEMA statement. Use the standalone CREATE statements for accessing other schemas.
NOVIERES
unable to import view <str> Explanation: Could not import this view -- see the message that follows. User Action: Correct the problem and retry the operation.
NO_COMMAND
An empty command string was passed to PREPARE. Explanation: A null command string was passed to PREPARE. User Action: Pass a string to PREPARE that is not empty.
NO_DCLTXN
You cannot declare a transaction while a transaction is active. Explanation: There is a currently transaction in progress. You cannot declare a transaction while a transaction is in progress. User Action: Commit or rollback the current transaction before issuing another DECLARE TRANSACTION statement.
NO_DECIMAL
<str> is being converted from DECIMAL to <str>. Explanation: DECIMAL is not a supported data type. VAX SQL converts DECIMAL columns and types to a supported data type. User Action: None. This is an informational message only.
NO_DESCENDING
DSRI does not support descending index segments Explanation: You specified that a descending index segment; DSRI does not support descending index segments. User Action: Remove the DESC clause from the index specification.
NO_DMLPLAN
You can only use DECLARE statements in a context file. Explanation: You can only include DECLARE statements in a context file. These statements include DECLARE TRANSACTION, DECLARE SCHEMA, and DECLARE TABLE. User Action: Remove everything but DECLARE statements from the context file.
NO_ENDCOM
No comment terminator found Explanation: A PL/I begin comment was found (/*) and no corresponding end comment (*/) was found before the end of the program. User Action: Insert the comment terminator.
NO_ENDEXEC
An EXEC SQL flag was found before the previous END-EXEC flag. Explanation: The previous SQL statement was missing its END-EXEC flag. Every COBOL SQL statement must be preceded by EXEC SQL and be terminated by END-EXEC. A period may optionally follow the 'END-EXEC' flag. User Action: Add an END-EXEC flag to the previous SQL statement. Make sure that the END-EXEC flag has no embedded spaces, and that there is no COBOL terminator period before the END-EXEC flag.
NO_FILFND
File <str> not found for input to the precompiler Explanation: Attempted to open a nonexistent file. User Action: Check the file specified. Supply complete file specification.
NO_INCFND
Could not find file <str> named in INCLUDE statement Explanation: You attempted to include a nonexistent file. User Action: Check the file specification in the INCLUDE statement. Supply a complete file specification. Note that the default file extension is .SQL.
NO_NUMERIC
<str> is being converted from NUMERIC to <str>. Explanation: NUMERIC is not a supported data type. VAX SQL converts NUMERIC columns or types to a supported data type. User Action: None. This is an informational message only.
NO_PLNFND
Context file <str> was not found for input to the precompiler Explanation: Attempted to open a nonexistent context file. User Action: Check the file specified. Supply a complete file specification.
NO_SQLDA
The SQLDA cannot be used in FORTRAN or COBOL Explanation: PL/I is the only host language that supports the SQLDA. This means you can only use the PREPARE...INTO and DESCRIBE statements in PL/I programs. The only dynamic features supported by COBOL and FORTRAN are EXECUTE IMMEDIATE and EXECUTE, OPEN, and FETCH with host variable lists. User Action: Remove references to the SQLDA from COBOL and FORTRAN programs.
NO_SUCH_FIELD
Domain <str> does not exist in this schema Explanation: You specified a domain that does not exist in the schema. User Action: Check schema entity definitions for the valid schema type names.
NO_TXNOUT
No transaction outstanding Explanation: You attempted to terminate a transaction with a COMMIT or a ROLLBACK when no transaction was outstanding. SQL does not start a transaction when you issue a DECLARE TRANSACTION, but waits until it encounters the first statement that requires a transaction. User Action: Execute a statement that requires a transaction before issuing COMMIT or ROLLBACK. All statements except DECLARE TRANSACTION, DECLARE SCHEMA, CREATE SCHEMA, and DROP SCHEMA require transactions.
NSEGBLR
unable to recover BLR string Explanation: Attempt to import a BLR segmented string with more than one segment. User Action: Submit an SPR with a copy of the Rdb/VMS interchange file (.RBR) that caused the error.
NULLNOIND
Tried to store null into host variable with no indicator variable Explanation: Null values can only be stored in host variables which have indicator variables. User Action: Add an indicator variable to the host variable reference or make sure that no null values can be returned to it.
NUMHVSNOT
Number of host variables passed (<num>) does not match number of parameters (<num>) Explanation: The number of host variables you passed in to an EXECUTE, OPEN, or FETCH statement does not match the number of parameter markers (question marks) in the PREPARE statement's command string. User Action: Make sure the number of host variables matches the number of parameter markers in the PREPARE statement. There are two ways to pass in host variables. One, explicitly pass in a list of host variables in a USING list. Or two, pass in an SQLDA in a USING DESCRIPTOR clause. If you are using an SQLDA, you must specify in the SQLDA SQLN field the number of SQLVAR structures you have initialized to point to your variables.
NUMITESEL
Number of items selected does not match number items in the INTO clause Explanation: A SELECT statement must have as many values in the select list as there are in the INTO clause. User Action: Enter the same number of columns in the select list and the INTO clause. If you are using 'SELECT *', check the columns that are defined in the selected table.
NUM_TO_DATE
Numeric data in column <str> cannot be converted to a date datatype Explanation: Rdb will not allow numeric datatypes to be converted to date User Action: Do not try it again.
ONEEPERM
only one E character is permitted in an edit string Explanation: An edit string contains more than one E character. Only one is allowed. User Action: Redefine the edit string with only one E character.
ONETXNMOD
Only one DECLARE TRANSACTION statement is allowed per module Explanation: You can use only one DECLARE TRANSACTION statement in a preprocessed module. It must occur before the first executable statement (SELECT, INSERT, UPDATE, CREATE, etc.). User Action: Only use one DECLARE TRANSACTION statement in a module.
ONLFIRPRE
Only the first file in the list will be precompiled Explanation: You specified a list of files to be processed. This list will be passed along to the compiler with the first file replaced by the generated language file. However, only the first file in the list will be precompiled. User Action: If more than one of the files has SQL statements, they must be precompiled in separate command lines. If you want only the first file precompiled, then no user action is neccessary.
ONLFIRVAR
Only first variable in qualified variable expression Explanation: COBOL allows only the first variable in a qualification to be an array. The preprocessors do not recognize the arrays of arrays constructs in FORTRAN, COBOL or BASIC. User Action: Rewrite the query and check the appropriate language reference manual.
ONLONEDB
Only one schema can be referred to in a SELECT, UPDATE or DELETE statement Explanation: You cannot use tables from more than one schema in a SELECT, UPDATE or DELETE statement. You can, however, refer to tables from one schema in an INSERT statement and refer to tables in another schema in the SELECT which provides the values for that INSERT statement. User Action: Use separate statements for multiple schema access.
ONLONETRN
Only one transaction allowed at a time Explanation: Only one transaction is allowed at a time. Note that SQL starts a transaction, even if none was previously declared, on the first data manipulation statement. User Action: Issue a COMMIT or ROLLBACK statement to terminate the transaction, then declare another.
ONLYONEPSECT
Only one PSECT statement per module is supported Explanation: The PSECT directive may only be used once per module. User Action: Decide which PSECT statement is really desired and delete all others.
OPENERR
unable to open <str> as the interchange file Explanation: Could not access the Rdb/VMS interchange file (.RBR). User Action: Correct the problem indicated by subsequent messages and retry the operation.
OPRSTK_OVRFLO
Operator stack overflow Explanation: The internal limit of the parsing operator stack was exceeded. User Action: Submit an SPR with the query that caused the error.
ORDNUM2BIG
ORDER BY number exeeds count of select-list items Explanation: The number in the ORDER BY clause, used to specify which expression from the select list to sort by, is bigger than the number of items in the select list. User Action: Use a number which corresponds to an item in the sort list.
PARAMNOTSTR
Parameter !AC in procedure !AC must be a character parameter Explanation: You used the parameter as a runtime parameter for a filename or pathname in a DECLARE SCHEMA statement. Such parameters must be declared in every procedure in the module, and must be character datatypes. The parameter in this procedure is not a character datatype User Action: Declare the parameter as a character variable in the procedure.
PARAMQUAL
Parameters must not be qualified Explanation: A reference to a parameter included qualifiers. You cannot qualify parameters. User Action: Define the parameter in the procedure, or use a parameter name which is defined in the procedure.
PARBADCLA
Parameter !AC passed by invalid descriptor class Explanation: The parameter was passed to a module language procedure by descriptor when parameter checking was enabled and the class of the descriptor was not a supported descriptor class. User Action: Correct the argument in the host language program
PARBADDAT
Parameter !AC has invalid datatype Explanation: The parameter was passed to a module language procedure with a different datatype than it was declared in the procedure. User Action: Make the parameter agree in the module and the host language.
PARBADLEN
Parameter !AC has invalid length Explanation: The parameter was passed to a module language procedure with a different length than it was declared in the procedure. User Action: Make the parameter agree in the module and the host language.
PARBADSCA
Parameter !AC has invalid scale Explanation: The parameter was passed to a module language procedure with a different scale than it was declared in the procedure. User Action: Make the parameter agree in the module and the host language.
PARBINSCA
Parameter !AC has a binary scale factor Explanation: The parameter was passed to a module language procedure with a binary scale factor. VAX SQL supports only decimal scale factors. User Action: Either do not use a scale factor, or use a datatype with which your language uses decimal scale factors. For example, PL/I uses binary scale factors with fixed binary data and decimal scale factors with fixed decimal data. If you want to use scale factors, use fixed decimal. Be sure to change the module to agree with the new datatype.
PARSE_STACK_OVERFLOW
Parse stack overflow Explanation: The internal limit of the parsing stack were exceeded. User Action: Submit an SPR with the query that caused the error.
PATH_NAM_REQ
PATHNAME clause necessary when the dictionary is required Explanation: When you create a schema using the DICTIONARY IS REQUIRED clause, then you must also specify the PATHNAME clause. User Action: Change the CREATE SCHEMA statement to either add the the PATHNAME clause or to remove the DICTIONARY IS REQUIRED clause.
PHYBACDAT
it was physically exported on <str> Explanation: Information about the Rdb/VMS interchange file (.RBR). User Action: None.
PREFORSTR
The host variable in the PREPARE FROM clause must be a string. Explanation: A host variable in the FROM clause of a PREPARE statement must have a string data type. User Action: In COBOL declare the variable to be PIC X(n). In PL/I declare the variable to be CHAR(n). In FORTRAN, declare the variable to be CHARACTER XYZ*n.
PREMATURE_EOF
Statement is syntactically incomplete Explanation: You entered a syntactically incomplete statement. User Action: Complete the statement before typing "RETURN".
PRESTAOPE
Cannot prepare statement name used by an open cursor Explanation: You declared a cursor based on a prepared statement name and opened the cursor. While that cursor was still open, you tried to prepare the same statement name again. User Action: Close the cursor or end the transaction before using a PREPARE statement with the same statement name again.
PRINT_SSID
Segmented string id for <str> will be displayed Explanation: One of the columns specified in the select list of a SELECT statement is a segmented string. SQL does not support the segmented string data type, but displays the segmented string identifier for interactive SELECT statements. The segmented string identifier is an internal value which will probably not be meaningful. User Action: Ignore the values displayed for the segmented string column.
PROCNOCA
Procedure <str> has neither an SQLCA nor SQLCODE parameter Explanation: A module language procedure must have either an SQLCA or an SQLCODE parameter declared. This procedure had neither. User Action: Add either an SQLCODE or SQLCA parameter.
PRPSELINTO
Preprocessed SELECT statements must include an INTO clause Explanation: A preprocessed SELECT statement needs a place to put the data it retrieves. An INTO clause is required to specify where to put the data. User Action: Add an INTO clause to the SELECT statement.
PTR_VAR
Host variable <str> is a pointer variable which is illegal in SQL statements. Explanation: The named variable is defined as a C pointer variable. These variables are currently not supported by the C precompiler. User Action: Use a different variable.
QUAINVVAL
An invalid value <str> was specified for <str> Explanation: You specified an invalid value for a command line qualifier User Action: Correct the command line syntax error.
QUANOVAL
The !AF qualifier does not take a value Explanation: You specified a value for a command line qualifier which cannot have a value. User Action: Correct the command line syntax error.
RDBVMSONL
Operation supported for Rdb/VMS databases only Explanation: You issued a GRANT or REVOKE statement on a non-Rdb/VMS database. VAX SQL supports GRANT and REVOKE for Rdb/VMS databases only. User Action: Do not issue any GRANT or REVOKE statements with this database.
REANOWRT
A READ_ONLY transaction can not specify write locks. Explanation: The transaction was specified as READ_ONLY but a table in the RESERVING clause was locked for write access. This is a conflict of access modes. User Action: Declare the transaction READ_WRITE or use a read lock. Note that the default is always READ_WRITE.
RECEXCMAX
size of edit string exceed internal data structure limits Explanation: The length of an edit string exceeds the size of the internal data structures that used to represent it. User Action: Temporarily reduce the size of the edit string and submit an SPR including a description of the table and domains that produce this error.
REFINS
Cannot INSERT into a table named in the FROM clause of the SELECT Explanation: You tried to use the same table in an INSERT statement both as the target and source for data. User Action: Change your query so that the table you are inserting into is not named in the select. If you need to duplicate the information in the table, you must use a temporary table.
RELAMBIG
Table name <str> was not qualified and is in multiple schemas Explanation: You must qualify a table name with an authorization identifier when accessing more than one schema containing that table name. User Action: Make sure the DECLARE SCHEMA statements for the schema include authorization identifiers and retype the query using the appropriate authorization identifier.
RELNOTDEF
Table <str> is not defined in schema Explanation: The specified table does not exist in the current schema. User Action: Declare the correct schema. Spell the table name correctly. You may have specified a name other than a table name.
REL_EXISTS
Table <str> already exists in this schema Explanation: You attempted to create a table with the name of an existing table User Action: Choose a different name.
RESABORT
terminating the IMPORT operation Explanation: The IMPORT operation has been aborted; see the messages preceding this one. User Action: None.
RESERVED_WORD
<str> is a keyword. It cannot be used as a name Explanation: You entered a keyword where a name was expected. User Action: Specify a unique name instead of the keyword.
SEGAREERR
Segmented string area <str> referred to but not defined Explanation: The CREATE SCHEMA statement indicated that segmented strings must be stored in a specific storage area, but that storage area was never created. User Action: Change the CREATE SCHEMA statement to include a CREATE STORAGE AREA statement with the name referred to by the SEGMENTED STRING clause.
SEGSTREXP
Cannot use a segmented string in an expression Explanation: You attempted to use a segmented string column in an expression. Segmented strings may be used only in expressions using the NULL operator. User Action: Remove the operations on the segmented string from the DML query.
SELMORVAL
The result of a singelton select returned more than 1 value Explanation: A singleton select statement (SELECT...INTO) may only return 1 row of values. The result table for this singleton select contains more than one row. User Action: Either embed the SELECT statement (without the INTO clause) in a DECLARE CURSOR statement and process it with OPEN and FETCH statements, or modify the SELECT statement so it will return only one row.
SEVERRDET
A severe error was detected Explanation: This is the exit status for a preprocessor when a severe error is detected. User Action: Fix the error.
SMA_DAT_TYP
Altering column <str> to a smaller datatype may cause data loss Explanation: Altering a column to a smaller datatype might cause data already stored in that column to appear lost. User Action: None. This is a warning message only.
SPACREQ
A space is required before file specification Explanation: A space is required to parse the begining of the file specification. User Action: Run the preprocessor again and include a space before the file specification.
SPANOTVAL
Space management options not valid on areas with uniform page format Explanation: Space management options of thresholds, interval or both were specified for an area with a uniform page formats. User Action: Remove the space management option(s) from the storage area with uniform page format, or change the storage area with the specified space managment option(s) to have mixed page format.
SQLDANOT
SQLDA not large enough (<num>) to handle number of parameters
(<num>)
Explanation: The SQLDA passed to PREPARE or DESCRIBE is not
large enough to handle all of the parameters in the associated
PREPARE command string.
User Action: Allocate an SQLDA to be large enough to have one
SQLVAR for each input or output parameter ('?') in the PREPARE
command string. Then set SQLN to indicate the number of SQLVARs
in the SQLDA.
SQLDATA
An SQLDATA field in the SQLDA was not initialized Explanation: You passed in an SQLDA with a SQLDATA value of zero in one of the SQLVAR blocks. User Action: You must enter nonzero values in every SQLDATA field in the prepared command string that SQLD indicates is necessary.
SQLTYPE
An invalid SQLTYPE value of <num> was found in the SQLDA Explanation: You passed in an SQLDA with a illegal SQLTYPE value. User Action: You must enter a valid SQLTYPE value in every SQLTYPE field in the prepared command string that SQLD indicates is necessary.
STANOTDEF
The '<str>' statement has not been defined Explanation: You attempted to use a statement name in an EXECUTE or a DESCRIBE statement that had not been used in a PREPARE statement. User Action: Prepare a statement name before using it in an EXECUTE or a DESCRIBE statement.
STANOTSEL
Cursor can only be used with prepared SELECT statements Explanation: You attempted to declare a cursor based on a prepared statement that was not a SELECT statement. Cursors can be based only on SELECT statements. User Action: Use EXECUTE to execute this statement.
STARNOTALL
Invalid use of asterisk - expected column name Explanation: You attempted to use the column wildcard (*) where SQL requires an explicit column name. User Action: Supply the names of the columns to be referenced.
STATWOCUR
Cannot declare a second cursor based on statement <str> Explanation: A prepared statement can only have one cursor based on it. You tried to declare a second cursor based on the same prepared statement name used in a previous DECLARE CURSOR statement. User Action: Remove one of the cursor definitions from your program or base the second cursor on a different statement name.
STOCOLERR
Not enough columns were specified in the USING clause Explanation: There were more literals specifed in the LIMIT clause of the storage map than there were columns in the USING clause. User Action: Either specify more columns in the USING clause, or reduce the number of literals in the LIMITS clause.
STOCOLUKN
Column specified in STORE clause, <str>, is unknown to table <str> Explanation: A column that did not exist in the table was used in the CREATE STORAGE MAP statement. User Action: Specify a valid column name.
STOTABUKN
Table specifed in store clause, !AC, is unknown to this schema. Explanation: The table named in the CREATE STORAGE MAP statement does not exist in the schema. User Action: Specify a valid table name.
STRARRAY
Host variable <str> is either a structure array or in a structure array Explanation: The SQL precompilers do not support references to fields in a structure array (a host structure defined as an array). User Action: Assign the value in the structure array to a field which is not in a structure array before using it in an SQL statement.
STRINXPR
Host structure <str> used in a value expression Explanation: SQL statements can only refer to a host structure in contexts where the host structure can be expanded to a list of values. A value expression requires a single value, so host structures cannot be used there. User Action: Replace the host structure with an elementary item.
STRLITEXP
A string literal was expected Explanation: A string literal was expected but something else was found. User Action: Correct the syntax error.
STRLITMISQUO
String literal missing closing quote Explanation: The string in a user assignment statement is missing a closing quote. User Action: Insert one or more quotes as appropriate.
STRMORELE
The <str> structure has more elements than the <str> indicator vector Explanation: The specified structure has more elements than the indicator vector it is associated with. User Action: Make the indicator vector larger.
STRTOOBIG
String literal is too big Explanation: You entered a string literal with a length greater than 1024 characters. The length of a string literal must be less than or equal to 1024 characters. A likely cause of this error is an unmatched quote mark. User Action: Put missing quote marker, or use a string literal with no more than 1024 characters.
STRXPREXP
A string expression was expected Explanation: A string literal, a character host variable, or USER was expected but something else was found. (Note that USER is not permitted in EXECUTE IMMEDIATE, and specifying it will also generate this message.) User Action: Correct the syntax error.
SUBNOGB
Subqueries in basic predicates cannot use GROUP BY Explanation: A subquery used in a basic predicate, such as WHERE CITY = (SELECT ...), cannot contain the GROUP BY clause. User Action: Remove the GROUP BY clause or change the predicate to include ANY or ALL.
SUBTOOVAL
Column select expression specifies too many columns Explanation: A column select expression may only fetch one value unless it is in an EXISTS predicate. This means any column select expression that uses the column wildcard (*) must have only one-column tables in its FROM clause. User Action: If you specified more than one column explicitly, remove all but one. If you used a wildcard, explicitly name a single column instead.
SYM_EXP
One of the following symbols was expected: Explanation: You typed an unexpected keyword. User Action: Type a correct keyword.
SYNTAX_ERR
Syntax error Explanation: A syntax error was detected in a your SQL statement. User Action: Correct the syntax error and retry the statement.
SYSPAGFOR
Page format for system relations cannot be MIXED Explanation: The system relations for Rdb/VMS must be placed in an area that contains the uniform page format. User Action: Either create a separate storage area for RDB$SYSTEM or change the default page format to uniform.
TBLNOTCUR
Table <str> is not included in cursor <str> Explanation: An UPDATE or DELETE statement that uses the CURRENT OF clause must name the same table specified in the cursor. User Action: Either change the UPDATE or DELETE statement to use the table specified in the cursor, or use a cursor declared for the table you specified.
TOKINSBEF
<str> inserted before error symbol Explanation: When parsing an SQL statement, the parser encountered an error. The message for that error appeared prior to this message. In an attempt to recover from that error, SQL inserted the specified token before the token that generated the error, and generated this message to help you understand any additional messages that follow. User Action: None. This is an informational message only.
TOKTOOBIG
Symbol name is too big Explanation: You entered a symbol (token) name with a length greater than 32. The length of a symbol name must be less than or equal to 32 characters. User Action: Use a symbol with no more than 32 characters.
TRAACT
A schema cannot be declared while a transaction is active Explanation: You issued an DECLARE SCHEMA statement while a transaction was still in progress. User Action: You must either COMMIT or ROLLBACK the current transaction or wait until the current transaction is terminated before declaring another schema.
TRAACT_1
A schema cannot be created while a transaction is active Explanation: You issued a CREATE SCHEMA statement while a transaction was still in progress. User Action: You must either COMMIT or ROLLBACK the current transaction or wait until the current transaction is terminated before creating another schema.
TRAACT_2
ROLLBACK or COMMIT the transaction Explanation: You are attempting an operation that cannot be executed while the current transaction is still in progress. User Action: You must either COMMIT or ROLLBACK the current transaction or wait until the current transaction is terminated before attempting the new schema activity.
TRAACT_3
A schema cannot be dropped while a transaction is active Explanation: You issued a DROP SCHEMA statement while a data manipulation transaction was still in progress. User Action: COMMIT or ROLLBACK the transaction, start a new transaction, and reissue the DROP SCHEMA statement.
TRAHDLINV
Transaction handle datatype invalid, must be longword Explanation: You specified a transaction handle that was not a longword. User Action: You must use !VAL and longword variable.
TRAMODSPC
Only one transaction mode may be specified for a transaction Explanation: You specified both the READ_WRITE and READ_ONLY transaction modes in a DECLARE TRANSACTION statement. User Action: Specify either transaction mode, not both, for a single schema. You can specify different transaction modes for different schemas in a single DECLARE TRANSACTION statement, however.
TREE_OVRFLO
Tree storage overflow Explanation: The internal limit of the AST tree nodes was exceeded. User Action: Submit an SPR with the query that caused the error.
TXNNOTLONG
Transaction handle is not a longword. Explanation: Transaction handles must be defined using the VAX longword data type. User Action: Use a longword to declare the transaction handle: In COBOL, use PICTURE S9(9) COMP. In PL/I, use FIXED BINARY(31). In FORTRAN, use INTEGER*4.
TXN_HNDL_IGNORED
Transaction handle parameter ignored Explanation: Transaction handles currently are not supported. User Action: None; this is an informational message.
UKN_ALT_OPT
Unknown ALTER SCHEMA option Explanation: The ALTER SCHEMA statement contains an option that is not understood. User Action: Reenter the statement with the syntax supported by this version of VAX SQL.
UNBDECFIL
Unable to create declarations file <str> Explanation: SQL attempted to open a DECLARATIONS file but could not. User Action: Include a valid directory specification and valid declarations name.
UNBTMPFIL
Unable to open a temporary file called <str> Explanation: SQL attempted to open a temporary file. It was either in the default directory or the directory specified with the /OBJ compile switch. User Action: Include a valid directory specification with protection level that allows temporary files to created in it.
UNDPARAM
Parameter <str> is not declared in procedure <str> Explanation: This error is generated in two situations. In the first, a procedure referred to a parameter which was not declared in the procedure. In the second, you used a column in a context where it could be a parameter reference and an indicator variable was specified (or a comma omitted). User Action: Define the parameter in the procedure, or use a parameter name which is defined in the procedure.
UNKTYPE
<str> is based on an unknown type Explanation: You referred to a host variable which was based on a host language the SQL precompiler does not support. User Action: Base the host variable on a host language the SQL precompiler supports.
UNSDATATYPE
Host variable <str> is an unsupported datatype Explanation: The host variable declaration uses a COMPLEX or REAL*16 FORTRAN data type. These data types are not supported. User Action: Either change the declaration so that only supported data types are used, or move the data to another data item which only uses supported data types.
UNSDB2PRIV
Unsupported DB2 privilege ignored Explanation: A GRANT or REVOKE statement specified a DB2 privilege which VAX SQL does not support. User Action: None. VAX SQL ignores the unsupported privileges.
UNSDSCCLA
Unsupported descriptor class <num> Explanation: The class of the descriptor in an input parameter is not supported by VAX SQL. User Action: Use class S, D, DS, or VS.
UNSDTPCVT
Unsupported data type conversion Explanation: A dynamic SQL program tried to get SQL to perform a data type conversion which it does not support. For example, a date field was fetched into a numeric field. The VAX SQL dynamic interface does not support conversions from date to numeric. User Action: Change the data type used to pass data to or from the dynamic interface to a data type which can be converted to the data type of the data in the database.
UNSIGNED_VAR
Host variable <str> is an unsigned variable which is illegal is SQL statements. Explanation: The named variable is defined as an C unsigned variable. Unsigned variables are illegal in SQL statments. User Action: Use a signed version of this variable in the SQL statement.
UNSPLIATT
Host variable <str> uses an unsupported PLI attribute Explanation: The host variable declaration uses a PLI attribute which is not supported. User Action: Either change the declaration so that only supported attributes are used, or move the data to another data item which only uses supported attributes.
UNSSTRXPR
Unsupported string expression Explanation: You attempted an operation on a string that is not supported. For example: string = string + string; User Action: Check the documentation for valid string expressions. If you are using the preprocessors, you might be able to work around the limitation by using a temporary variable.
UNSSUPDAT
Unsupported datatype requested Explanation: You requested input or output of an unsupported data type from the dynamic interface. User Action: You should review the data types of the variables in the dynamic statement and change the offending data type to a supported data type.
UNSUPOP
Operation supported for read-write databases only Explanation: You attempted to perform data definition or updates on a VIDA database. VIDA databases are read-only. User Action: Do not issue any CREATE, INSERT, UPDATE, or DELETE statements with a VIDA database.
UNTSTR
Unterminated string found
Explanation: The matching quote (" or ') for a string was not
found.
User Action: Reenter statement with matching quote character.
UPDCOLPRIV
UPDATE(column-name) privilege is not supported Explanation: UPDATE(column-name) is a DB2 privilege not supported by VAX SQL. UPDATE privilege will be granted on the entire table. User Action: None.
UPDREACUR
Cursor <str> is read-only Explanation: A cursor is read-only if it includes a DISTINCT phrase, a function, a GROUP BY, HAVING, or ORDER BY clause, or more than one table in its FROM clause. Read-only cursors cannot include FOR UPDATE clauses and cannot be used in UPDATE or DELETE statements. User Action: Either change whatever made the cursor read-only, or do not attempt to update the cursor.
USERINVIEW
USER literals are not permitted in view definitions Explanation: VAX SQL cannot store a USER literal in a view definition. User Action: You must either explicitly specify the user name as string literal in the select list of the view definition, or specify USER in a query outside of the view definition.
VECNOTIND
Host variable <str> is a vector but is not used as an indicator structure Explanation: The host variable is defined as a vector (one-dimensional array). SQL only allows references to vectors if they are used as indicator variables for host structures (such indicator variables are also called indicator structures or indicator vectors). User Action: Either change the host variable declaration so it is not an array, or move the data from the array to a variable that is not an array.
VEWNOTDEF
View <str> is not defined in schema Explanation: The specified view does not exist in the current schema. User Action: Declare the proper schema. Spell the view name correctly. You may have specified an expression where a view name was expected.
WAIMODSPC
Only one wait mode may be specified for a transaction Explanation: You specified both wait modes in a DECLARE TRANSACTION statement. User Action: Specify either WAIT or NOWAIT, not both, in a DECLARE TRANSACTION statement.
WARDET
A warning was detected Explanation: This is the exit status for a preprocessor when an warning was detected. User Action: Correct the error in the host language program and resubmit the job to the preprocessor.
WHYTWICE
Column !AD is specified more than once in the column list of a UNIQUE constraint. Explanation: You specified the same column more than once in the column list of a UNIQUE constraint. User Action: Specify each column only once.
WISH_LIST
Feature not yet implemented Explanation: The action you requested requires a feature that is not implemented in the current version of this product. User Action: Try to work around the unimplemented feature.
ZABORT
User entered Control-Z to abort statement Explanation: You typed a Control-Z to abort the current statement. User Action: None.
Execute(@)
@file-spec The 'at' sign (@) means "execute" in interactive SQL, just as in DCL. When you type @ and the name of an indirect command file, interactive SQL executes the statements in the file as if you had typed them one at a time at the interactive SQL prompt. The default file type for an indirect command file is .SQL. You can use the SET VERIFY statement to have the commands in the file displayed on the screen as they execute. The file-spec argument to the @ statement is the name of an indirect command file. You can use either a full VMS file specification, a file name, or a logical name. If you use a file name, interactive SQL looks in the current default VMS directory for a file by that name. The file must contain valid interactive SQL statements.
Additional information available:
Examples
You can use an indirect command file to execute a frequently
used query:
$ TY EMPADDR.SQL
!
! This command file generates information for a mailing list.
!
SET OUTPUT 'DISK2:[DEPT32]MAILLIST.DOC'
SELECT FIRST_NAME, MIDDLE_INITIAL, LAST_NAME,
ADDRESS_DATA_1, ADDRESS_DATA_2, CITY, STATE, POSTAL_CODE
FROM EMPLOYEES
$ SQL
SQL> @EMPADDR
Functions
The keywords COUNT, AVG, MAX, MIN, and SUM specify SQL
functions. Functions calculate values based on a value
expression for every row in a result table. Functions are
sometimes called "statistical expressions" or "aggregate
expressions" because they calculate a single value for a
collection of rows in a result table. Functions calculate a
single value:
COUNT Number of rows in a result table
SUM Sum of the values in a column
AVG Average of the values in a column
MAX Largest value in a column
MIN Smallest value in a column
Additional information available:
More Information
The following notes apply in general to functions:
o Rows with null values are not included when SQL evaluates
functions. If you specify DISTINCT, redundant values in
rows are also not included.
o If a function has as its argument a value expression
containing a column name that is an outer reference, the
value expression cannot include an arithmetic operator.
(The only cases where an outer reference makes sense as the
argument to a function is in the subquery of a HAVING
clause, or in a subquery in a select list.)
Select More_Information to continue.
Additional information available:
More Information
o You cannot nest functions. This means that a value
expression used as an argument to a function cannot include
a function.
o The keyword ALL in SUM, AVG, MAX, and MIN has no effect.
For instance, specifying MAX (ALL EMPLOYEE_ID) is the same
as saying MAX (EMPLOYEE_ID).
Interactive kit
If the interactive, rather than the development, version of the SQL distribution kit is installed on your system, you can run host language programs but cannot develop them. You can create the sample database SQL_PERSONNEL on your system and try interactive examples in the SQL documentation set. However, you cannot try out embedded, module language, or dynamic SQL examples because the SQL precompiler and SQL module processor are not part of the interactive version of SQL.
literals
Literals, which are also called constants, specify a value. Many SQL clauses require literal values, which can be either numeric, character string, or date. In addition, SQL provides two keywords, NULL and USER, that refer to literals. NULL and USER are described in separate help topics.
Additional information available:
numeric
A numeric literal is a string of digits that SQL interprets as a
decimal number.
numeric-literal =
--+------+-+-+-> digit -+-+------------------------+-+-+
+-> + -+ | +----<-----+ +-> . --+------->------+-+ | |
+-> - -+ | +-+-> digit -+-+ | |
| +----<-----+ | |
+-> . -+-> digit -+-----------------------+ |
+----<-----+ |
+-----------------------------------------------------+
++---------->-----------------+-->
+-- E -+------+-+-> digit -+-+
+-> + -+ +----<-----+
+-> - -+
Additional information available:
More Information
A numeric literal may be:
o A decimal string consisting of digits and an optional
decimal point. The maximum length, not counting the decimal
point, is 19 digits.
o A decimal number in scientific notation (E-format),
consisting of a decimal string mantissa and a signed integer
exponent, separated by the letter E or D (for G_Floating).
Examples
SQL allows flexibility in numeric expressions. You can use unary plus and minus, you can use any form of decimal notation, and you can embed spaces in E notation. The following are valid numeric strings: 123 34.9 -123 .25 123. 0.33889909 6.03E+23 6.03E-23 If you use a numeric literal to assign a value to a column or a variable, the data type of the column or variable determines the maximum value you can assign.
character string
SQL recognizes two types of character string literals:
o A quoted character string to represent printable ASCII
characters
o A hexadecimal character string (an X followed by a quoted
character string) to represent printable and nonprintable
ASCII characters
See the section on literals in Chapter 3 of the Reference Manual
for details.
date
To refer to a date data type with a literal in an SQL statement,
you must use the form dd-mmm-yyyy enclosed in single or double
quotation marks. SQL does not distinguish between upper- and
lower-case characters in date literals.
You can optionally include a complete or partial time component
in addition to the day, month, and year. The following diagram
shows the format for a complete date literal with a time
component:
date-literal =
--> dd-mmm-yyyy --+----------------------------------------+->
+-> hh --+-----------------------------+
+-> :mm --+-------------------+
+-> :ss --+---------+
+-> .cc --+
Note that date values stored in parameters must use a different
format than for date literals. See the Reference Manual section
on data type conversion.
Module language
MODULE --+-----------------+-> LANGUAGE language-name -+
+-> module-name --+ |
+------------------------------------------------------+
+-> AUTHORIZATON auth-id ---+------------------------+-+
++-> declare-statement -++ |
+--------- <-----------+ |
+------------------------------------------------------+
++-> PROCEDURE procedure-name +-> param-decl +-> ; sql-statement ; -+->
| +------- <-----+ |
+------------------------------- <---------------------------------+
param-decl =
-+-> parameter -+-> data-type ---++-----------------------------+-+->
| +-> domain-name -++-> BY DESCRIPTOR +----------++ |
| +-> CHECK -+ |
+-> SQLCODE -----------------------------------------------------+
+-> SQLCA -------------------------------------------------------+
+-+--------------+-> SQLDA --------------------------------------+
+-> parameter -+
Additional information available:
More Information
The SQL module language is a set of special keywords and syntax that allow procedures containing SQL statements to be called from any host language, including those not supported by the SQL precompiler. The SQL module language provides a calling mechanism for host language programs to execute SQL statements contained in a separate file called an SQL module file. The file contains module language elements to specify a single SQL module. The module includes one or more procedures, each of which contains parameter declarations and an SQL statement. The host language program uses call statements to specify a particular SQL module procedure and supplies a sequence of call parameters corresponding in number and in data type to the parameter declarations in the procedure. A call to a procedure in an SQL module causes the SQL statement in the procedure to be executed.
New Features
For more information about new features for VAX SQL Version 2.0, see the following V20 topic.
Additional information available:
V20
The following topics provide short summaries of new features for VAX SQL Version 2.0:
Additional information available:
ALTER_INDEXALTER_SCHEMAALTER_STORAGE_MAP
ALTER_TABLEBEGIN_DECLARECONTAININGCOMMENT_ON
CREATE_DOMAINCREATE_SCHEMACREATE_TABLEDROP_PATHNAME
END_DECLAREINSERTINTEGRATEQUITRELEASE
SET_TRANSACTIONSHOWSTARTING_WITHUNIQUE
Ada PrecompilerColumn Select ExpressionsConstraintsConverting Databases
C PrecompilerDatabase KeysDictionary FormatFormatting Enhancements
Global PagesIMPORT and EXPORTLSE SupportModule LanguageMultifile Databases
Online Sample ProgramsPackaging with Rdb/VMSText ArithmeticUpdating Cursors
Ada Precompiler
The SQL precompiler will now process VAX Ada programs containing embedded SQL statements.
ALTER_INDEX
The ALTER INDEX statement allows you to change:
o The characteristics of index nodes (sorted indexes only)
o The names of the storage area or storage areas that contain
the index
You cannot change:
o The columns that comprise an index
o Whether the index is UNIQUE
o A hashed to a sorted index
o A sorted index to a hashed index
ALTER_SCHEMA
The ALTER SCHEMA statement alters a schema in any of the
following ways:
o For both single-file and multifile databases, changes
characteristics of the database root file associated with a
schema. ALTER SCHEMA allows you to override certain
characteristics specified in the root file parameters of a
CREATE SCHEMA statement, such as whether a snapshot file is
disabled. In addition, ALTER SCHEMA lets you control other
characteristics you cannot specify in CREATE SCHEMA root
file parameters, such as whether after-image journaling is
enabled.
o For both single-file and multifile databases, changes
storage area parameters.
o For multifile databases only, adds, alters, or drops storage
areas.
ALTER_STORAGE_MAP
The ALTER STORAGE MAP statement changes an existing storage map.
A storage map controls which rows of a table are stored in which
storage areas in a multifile database.
In addition to changing storage maps, ALTER STORAGE MAP has
options that change:
o Which index the database system uses when inserting rows in
the table
o Whether the rows of the table will be stored in a compressed
format
ALTER_TABLE
Version 2.0 removes the restriction that ALTER TABLE statements that alter a column definition must always specify a data type clause, even if the data type is not changing.
BEGIN_DECLARE
The ANSI SQL standard requires that all host variables referred to in an SQL statement be declared between a BEGIN DECLARE statement and an END DECLARE statement. VAX SQL Version 2.0 supports the BEGIN and END DECLARE statements.
Column Select Expressions
Version 2.0 allows column select expressions wherever syntax allows a value expression. Earlier versions of VAX SQL allowed column select expressions only in certain predicates.
Constraints
Version 2.0 supports SQL2 syntax for defining constraints as part of CREATE and ALTER TABLE statements. A constraint specifies a condition that restricts the values that can be stored in a table.
CONTAINING
Version 2.0 includes support for the CONTAINING relational operator in predicates.
Converting Databases
VAX SQL Version 2.0 requires Version V3.0 of VAX Rdb/VMS. Before you use VAX SQL Version 2.0, you must convert databases created with Version 1.0 or Version 1.1 to a structure compatible with Version V3.0 of Rdb/VMS. You must install Version V3.0 of Rdb/VMS before running Version 2.0 of VAX SQL.
COMMENT_ON
The COMMENT ON statement now allows you to enter comments that are displayed by the SHOW INDEX statement.
C Precompiler
The SQL precompiler now supports block structure and pointer variables in C programs containing embedded SQL statements.
CREATE_DOMAIN
Version 2.0 supports SQL2 syntax for creating domain definitions. A domain definition in VAX SQL corresponds to a global field in the underlying Rdb/VMS database.
CREATE_SCHEMA
The CREATE SCHEMA statement in Version 2.0 replaces the CREATE DATABASE statement in earlier versions. CREATE DATABASE is supported for upward compatibility only and is no longer documented. In addition, the DROP, DECLARE, and SHOW SCHEMA statements replace the DROP, DECLARE, and SHOW DATABASE statements, which are no longer documented.
CREATE_TABLE
The FROM path-name clause of the CREATE TABLE statement now lets you specify a data dictionary path name for a record definition to copy to the database for a table definition.
Database Keys
Version 2.0 supports database keys. Database keys are internal pointers to specific table rows in a database. Application programs can use the DBKEY keyword in SQL statements to refer to the database key for a table row.
Dictionary Format
CDD/Plus dictionaries use a new format that is incompatible with the dictionary format supported by past versions of VAX SQL. This means that you must delete any dictionary path names for databases created before Version 2.0 of VAX SQL before you install V3.0 and convert those databases to the format required by Rdb/VMS V3.0. To delete path names for databases, invoke Version 2.3 of RDO and use the DELETE PATHNAME statement.
DROP_PATHNAME
The DROP PATHNAME statement deletes the data dictionary definitions. It does not delete the physical database files.
END_DECLARE
The ANSI SQL standard requires that all host variables referred to in an SQL statement be declared between a BEGIN DECLARE statement and an END DECLARE statement. VAX SQL Version 2.0 supports the BEGIN and END DECLARE statements. 3 FINISH The FINISH statement detaches from declared schemas when you are done working with them and frees the authorization identifiers used by the declarations. The effect of the FINISH statement differs depending on whether you issue it in interactive SQL or in a program (either precompiled or in an SQL module procedure).
Formatting Enhancements
Interactive SQL displays of data now reflect formatting specified in EDIT STRING and QUERY HEADER clauses in CREATE and ALTER TABLE and DOMAIN statements. Those clauses formerly applied only to VAX DATATRIEVE queries. The EDIT STRING clause specifies how SQL displays data stored in table columns. The QUERY HEADER clause specifies headers for table columns.
Global Pages
Version 1.1 of VAX SQL used 1500 global pages of memory if it was installed as a shareable image. Version 2.0 requires 2000 global pages.
IMPORT and EXPORT
The IMPORT and EXPORT statements load and unload databases and allow you to make changes to Rdb/VMS databases that cannot be made any other way. EXPORT unloads a database to an .RBR file. IMPORT recreates the database with changes not allowed through ALTER statements.
INSERT
You can now specify the RETURNING DBKEY clause in an INSERT statement to direct SQL to return the database key value for the row you insert into a table.
INTEGRATE
The INTEGRATE statement makes definitions in a schema and data
dictionary consistent with each other. INTEGRATE allows these
operations:
o Updating definitions (created with the FROM clause) in a
schema to reflect changes to the data dictionary record and
field definitions to which they are linked (INTEGRATE SCHEMA
PATHNAME ALTER FILES)
o Updating data dictionary record and field definitions to
reflect changes in schema definitions to which they are
linked (INTEGRATE SCHEMA PATHNAME ALTER DICTIONARY)
o Creating a data dictionary schema definition with copies of
schema definitions from the database system root file
(INTEGRATE SCHEMA FILENAME CREATE PATHNAME)
LSE Support
The EDIT statement in interactive SQL now invokes the VAX Language-Sensitive Editor (LSE) if you define LSE as the SQL$EDIT logical name. If LSE is installed on your system, define the logical name SQL$EDIT: $ DEFINE SQL$EDIT "LSE" VAX SQL supports LSE only by allowing you to invoke it with the EDIT statement. Version 2.0 of VAX SQL does not supply language templates or support other features of LSE.
Module Language
The SQL module language provides a calling mechanism for host language programs to execute SQL statements contained in a separate file called an SQL module file. The file contains elements that specify a single SQL module. The module includes one or more procedures, each of which contains parameter declarations and an SQL statement. The SQL module procedures can be called from any host language, including those not supported by the SQL precompiler. A call to a procedure in an SQL module causes the SQL statement in the procedure to be executed.
Multifile Databases
VAX SQL Version 2.0 supports features added to Rdb/VMS Version V3.0 for improved database performance. Several new statements in VAX SQL allow you create multiple data and snapshot files and control which parts of which tables are stored in each data file. This additional flexibility can greatly improve database performance if carefully managed. The VAX SQL statements that implement these features are: o CREATE SCHEMA o CREATE STORAGE AREA o CREATE STORAGE MAP o CREATE INDEX
Online Sample Programs
Version 2.0 supplies a number of additional online sample
programs:
o SQL$LOAD_JOBHIST in precompiled versions for PL/I, C, Ada
o SQL$REPORT in precompiled versions for PL/I, C, Ada
o SQL$TERMINATE in precompiled versions for PL/I, C, Ada
o SQL$ALL_DATATYPES in precompiled versions for PL/I, Ada
o The precompiled PL/I version of SQL$DYNAMIC and
SQL$DYNAMIC_DRIVER have been extensively revised to
illustrate more features of dynamic SQL.
Packaging with Rdb/VMS
VAX SQL is no longer available as a separate product beginning with Version 2.0. The VAX SQL software and documentation are now packaged with Rdb/VMS.
QUIT
The QUIT statement stops an interactive SQL session, rolls back any changes you have made, and returns you to the DCL prompt.
RELEASE
The RELEASE statement releases all resources used by a prepared statement in dynamic SQL. When you prepare an SQL statement for dynamic execution, you cannot delete any schema definitions (such as constraints, indexes, or tables) referred to directly or indirectly by the statement until you release the statement. The RELEASE statement gives you a way to explicitly release prepared statements.
SET_TRANSACTION
Version 2.0 supports SQL2 syntax for specifying transaction characteristics with the SET TRANSACTION statement. SET TRANSACTION also has extensions to the SQL2 syntax for DSRI-compliant databases. SET TRANSACTION has the same options as DECLARE TRANSACTION (which is still fully supported), but unlike DECLARE TRANSACTION, SET TRANSACTION is an executable statement that starts a transaction. SET TRANSACTION is thus parallel with the START TRANSACTION statement for Rdb/VMS.
SHOW
The SHOW statement in interactive SQL provides more detail about schema definitions, storage areas, and storage maps than in previous versions of SQL.
STARTING_WITH
Version 2.0 includes support for the STARTING WITH relational operator in predicates.
Text Arithmetic
Earlier versions of SQL allowed text fields, literals, and parameters to be used in arithmetic expressions.
UNIQUE
Version 2.0 includes support for the UNIQUE relational operator in predicates.
Updating Cursors
ANSI standard SQL specifies that the WHERE CURRENT OF clause in UPDATE statements can refer to any cursors that are not read only, and that any columns in the table on which the cursor is based can be updated. Earlier versions of VAX SQL allowed UPDATE statements to refer only to cursors that included the FOR UPDATE clause, and then only to the columns named in the FOR UPDATE clause. VAX SQL Version 2.0 allows updates of cursors that do not have a FOR UPDATE clause. However, if a cursor has a FOR UPDATE clause, only the columns listed in the FOR UPDATE clause can be updated.
predicate
predicate =
-+-+--------+--+-> basic-predicate ----------------+-+-->
| +-> NOT -+ +-> between-predicate --------------+ |
| +-> containing-predicate -----------+ |
| +-> exists-predicate ---------------+ |
| +-> in-predicate -------------------+ |
| +-> like-predicate -----------------+ |
| +-> null-predicate -----------------+ |
| +-> quantified-predicate -----------+ |
| +-> starting-with-predicate --------+ |
| +-> unique-predicate ---------------+ |
| +-> (predicate) --------------------+ |
| |
+------------------+- AND <--+----------------------+
+-- OR <--+
Additional information available:
BETWEENCONTAININGEXISTSINLIKENULL
STARTING_WITHUNIQUE
More Informationbasiccomplexquantified
More Information
A predicate follows the WHERE or HAVING keywords and specifies a condition that SQL evaluates as true, false, or unknown. Predicates are also called conditional expressions. You can specify several different types of predicates with different conditional operators. The different types of predicates are: Basic predicate BETWEEN predicate Complex predicate CONTAINING predicate EXISTS predicate IN predicate LIKE predicate NULL predicate Quantified predicate STARTING WITH predicate UNIQUE predicate
basic
A basic predicate compares two values. It has this form:
basic-predicate =
----> value-expr -+-> = --+-> value-expr -->
+-> <> -+
+-> < --+
+-> <= -+
+-> > --+
+-> >= -+
See the online HELP topic Value_expression for more information
about value expressions.
BETWEEN
A BETWEEN predicate compares a value with a range of values. It
has this form:
between-predicate =
---> value-expr -+--->--+-> BETWEEN value-expr AND value-expr --->
+> NOT +
As with IN predicates, BETWEEN predicates are a convenient way
of representing conditions that have equivalent forms using
other conditional operators:
value1 BETWEEN value2 AND value3
is the same as the complex predicate
(value1 >= value2) AND (value1 <= value3)
complex
A complex predicate combines any number of predicates with the Boolean operators AND, OR, and NOT. Boolean operators are also called logical operators. A complex predicate has this form: complex-predicate = -+-+---------+-+-------+-> predicate --+-------+---+---------------> | +-> NOT --+ +-> ( --+ +-> ) --+ +-> AND --+-+ | +-> OR ---+ | +---------------------------<---------------------------------+
Additional information available:
More Information
Note that you can, and occasionally must, set off predicates
within a complex predicate with parentheses. SQL evaluates
parts of a complex predicate in this order:
o Predicates enclosed in parentheses
(If there are nested predicates in parentheses, the
innermost predicate is evaluated first.)
o Predicates preceded by NOT
o Predicates combined with AND
o Predicates combined with OR
CONTAINING
A CONTAINING predicate tests whether the result table specified
in the second value expression is found within the string
specified by the first. The CONTAINING predicate has this form:
containing-predicate =
---> value-expr -+--->---+-> CONTAINING --> value-expr -->
+> NOT -+
The CONTAINING predicate is not case sensitive.
EXISTS
An EXISTS predicate tests whether the result table specified in a column select expression is empty. It has this form: exists-predicate = ---> EXISTS ( col-select-expr ) ---> If the result table specified in the select expression has one or more rows, SQL evaluates the EXISTS predicate as true. Otherwise, the predicate is false. An EXISTS predicate cannot be unknown. Because it merely checks for the existence of rows, an EXISTS predicate allows a wildcard in the select list of the column select expression to specify a multicolumn table. It is the only type of predicate that allows this.
IN
An IN predicate compares a value with another value or a
collection of values. It has this form:
in-predicate =
--> value-expr -+---->---+-> IN -+-> value-expr ----------------------+-->
+-> NOT -+ +-> ( -++-> value-expr -----++-> ) -+
|+-> col-select-expr -+|
+---------- , <--------+
Additional information available:
More Information
For all the forms of IN predicates, there is an equivalent form
using other conditional operators:
o value-expr IN value-expr
is the same as the basic predicate
value-expr = value-expr
o value-expr IN (value-expr1, value-expr2, value-expr3)
is the same as the complex predicate
value-expr = value-expr1
OR
value-expr = value-expr2
OR
value-expr = value-expr3
o value_expr IN (col-select-expr1, val-expr2,
col-select-expr3)
is the same as the quantified predicate
value-expr = ANY (col-select-expr1)
OR
value-expr = val-expr2
OR
value expr = ANY (col-select-expr3)
LIKE
A LIKE predicate searches character string literals for pattern
matches. It has this form:
like-predicate =
---> value-expr -+--->--+-> LIKE --+-> string-literal -+->
+> NOT + +-> parameter ------+
+-> USER -----------+
SQL interprets the value expression as a character string and
compares it to the string literal or the value represented by
the parameter or USER.
Select More_Information to continue.
Additional information available:
More Information
Within the string literal or value represented by the parameter
or USER, the percent sign and underscore characters have special
meaning:
o The percent sign character (%) stands for any string of
characters, including no characters at all.
o The underscore character (_) stands for any single
character.
All other characters stand for themselves. LIKE does not
distinguish between uppercase and lowercase characters.
Select More_Information to continue.
Additional information available:
More Information
Note the following restrictions:
o LIKE does not pad its argument (a string literal, parameter,
or USER keyword) with blanks for comparison with value
expressions that are not the same length as the argument.
This means LIKE will not find matches for some patterns when
you might expect it to.
o SQL interprets the asterisk (*) and the percent sign (%) as
equivalent. This means you cannot use LIKE predicates to
search for character string literals that contain asterisks.
Note that future versions of VAX SQL may not interpret the
asterisk (*) and the percent sign (%) as equivalent.
NULL
A NULL predicate tests for null values in value expressions. It
has this form:
null-predicate =
----> value-expr ---> IS -+---->---+-> NULL --->
+-> NOT -+
SQL never evaluates a NULL predicate as unknown: it is always
true or false. If the value expression is null, SQL evaluates
the predicate as true. If the value expression is not null, the
predicate is false.
Note that NULL predicates are the only way to construct a query
that includes rows in a result table by testing whether the rows
have null values. Other constructions such as NOT = or <> do
not include rows with null values in their result tables.
quantified
A quantified predicate compares a value with a collection of
values. It has the same form as a basic predicate except that
the second operand must be a column select expression preceded
by ALL, ANY, or SOME:
quantified-predicate =
---> value-expr -+-> = --+-+-> ALL --+-> ( col-select-expr ) -->
+-> <> -+ +-> ANY --+
+-> < --+ +-> SOME -+
+-> <= -+
+-> > --+
+-> >= -+
If you use ALL, then SQL evaluates the predicate as true if the
relationship is true for every row of the result table specified
by the column select expression or if the result table has no
rows. If you use ANY or SOME (both keywords have the same
effect), SQL evaluates the predicate as true if the relationship
is true for at least one of the rows in the result table
specified by the column select expression.
STARTING_WITH
starting-with-predicate =
--> value-expr -+-->---+-> STARTING WITH --> value-expr -->
+ NOT -+
The STARTING WITH predicate tests whether the first characters
of the first value expression match those specified in the
second value expression.
The STARTING WITH predicate is case sensitive.
UNIQUE
unique-predicate= ---> UNIQUE --> (col-select-expr) ---> The UNIQUE predicate tests whether the result table specified in the select expression has only one row. If it has only one row, SQL evaluates the UNIQUE predicate as true. Otherwise, the predicate is false. SQL evaluates the NOT UNIQUE predicate as true if the result table specified in the select expression has more than one row. The UNIQUE and NOT UNIQUE predicates cannot be unknown. Because it merely checks for the existence of rows, a UNIQUE predicate does not require that the result table from its column select expression be a single column wide. For UNIQUE predicates, an asterisk wildcard in the column select expression can refer to a multicolumn table.
Release Notes
The VAX SQL Release Notes are in the following file:
SYS$HELP:SQL$vvu.RELEASE_NOTES
where vv = version
u = update
For example:
SYS$HELP:SQL$020.RELEASE_NOTES
Published release notes may differ from the online release notes
because the latest information was not available at publication
time. Therefore, you should also read the online release notes
to see if additional notes have been added since the printed
version.
Sample Database
SQL_PERSONNEL is the sample database used in the SQL
documentation. The database file for SQL_PERSONNEL occupies
approximately 2000 disk blocks. To create your own copy of this
database, type the following at the DCL prompt:
$ @SQL$SAMPLE:SQL$PERSONNEL.COM
The database_diagram subtopic shows what tables are in the
sample database and how they are related. In the diagram, lines
without arrowheads indicate a one-to-one relation between tables
they connect. Lines with arrowheads indicate a one-to-many
relation between tables. The arrowhead points to the table with
many rows for each row of the other table.
Additional information available:
database diagram
+----+ +--------+
|JOBS| |COLLEGES|
+--+-+ +---+----+
JOB_CODE COLLEGE_CODE
| +-----------+ +--------------+ +-------+ |
+-->|JOB_HISTORY| |SALARY_HISTORY| |DEGREE |<--+
+--+--+-----+ +------+-------+ +---+---+
^ ^ ^ ^
| +----------------+---------------+
| EMPLOYEE_ID
| +----+----+
| |EMPLOYEES|
DEPARTMENT_CODE +----+----+
| EMPLOYEE_ID
| |
| MANAGER_ID
| +-----+-----+
+-------------+DEPARTMENTS|
+-----------+
select expr
select-expr =
SELECT -+------>------+-> select-list --+
+-> ALL ------+ |
+-> DISTINCT -+ |
+------------------------------<------+
+ FROM -++-> table-name -+-+----->----+-+-+--------->----------+-+
|+-> view-name --+ +-> alias -+ | +-> WHERE predicate -+ |
+---------- , <-----------------+ |
+------------------------------<---------------------------------+
++------------->------------------+-+---------->----------+-->
+-> GROUP BY -+-> column-name -+-+ +-> HAVING predicate -+
+------- , <-----+
Additional information available:
More Information
The basic element of SQL syntax is the select expression. Select expressions are the basis for the SELECT, DECLARE CURSOR, CREATE VIEW, and INSERT statements. Select expressions specify a result table. A result table is a temporary table derived from some combination of the tables or views identified in the FROM clause of the statement. SQL evaluates the clauses in a select expression in the following order: o FROM o WHERE o GROUP BY o HAVING o select-list After each of these clauses, SQL logically produces an intermediate result table that is used in evaluation of the next clause.
select list
Identifies a list of column names and value expressions (to be
derived from the tables and views named in the FROM clause) for
the result table.
select-list =
---+-------------> * ----------------+--->
+-+-+-+-> table-name -+-> .* -+-+-+
| | +-> view-name --+ | |
| | +-> alias ------+ | |
| +---> value-expr ---------+ |
+------------ , <-------------+
Additional information available:
More Information
You can use asterisks as wildcards in a select list: SELECT * Tells SQL to use all the column names from the intermediate result table (namely, all the columns in all the tables and views referred to in the FROM clause). If the select expresion contains a GROUP BY clause, SQL interprets the wildcard as specifying only the columns named in the GROUP BY clause. SELECT name.* Qualifying an asterisk with a table name, view name, or alias tells SQL to use all the columns in the table or view referred to by the name. The name must be specified in the FROM clause of the select expression. You cannot mix this form of wildcard notation with the previous two. The number of columns you specify in the select list, either with wildcards or by explicitly listing value expressions, is the number of columns in the result table.
FROM
Identifies the tables and views that SQL uses to generate the result table. If you name more than one table or view, SQL joins them to create an intermediate result table. That intermediate table consists of every possible combination of all the rows and columns of each table (the Cartesian product). You can specify an alias following a table or view name in the FROM clause to qualify column names in other parts of the select expression. If you do not explicitly specify an alias, SQL implicitly specifies the table name or view name as an alias. Do not specify the same alias more than once, either explicitly or implicitly.
WHERE
Specifies a predicate that SQL evaluates to generate an
intermediate result table. SQL evaluates the predicate for each
row of the intermediate result table created by the FROM clause.
The rows of that table for which the predicate is true become
another intermediate result table for later clauses in a select
expression. Column names specified in the predicate of the
WHERE clause must either:
o Identify columns of the intermediate result table created by
the FROM clause
o Be an outer reference (possible only if the WHERE clause is
part of a column select expression)
The predicate in a WHERE clause cannot refer to a function.
GROUP_BY
Indicates the column names that SQL uses for partitioning the intermediate result table from the WHERE clause, if specified, or the FROM clause. For the first column specified in the GROUP BY clause, SQL rearranges the rows of the preceding intermediate result table into groups whose rows all have the same value for the specified column. If there is a second column specified in the GROUP BY clause, SQL then groups rows within each main group by values of the second column. SQL groups by any additional columns in the GROUP BY clause in a similar manner. All null values for a column name in the GROUP BY clause are grouped together. Each group is treated as the source for the values of a single row of the result table. Since there is no single value for columns not specified in the GROUP BY clause, references to column names not specified in GROUP BY must be within a function. Because all the rows of a group have the same value for the column specified in the GROUP BY clause, references within value expressions or predicates to that column specify a single value.
HAVING
Specifies a predicate SQL evaluates to generate an intermediate result table. SQL evaluates the predicate for each group of the intermediate result table created by the preceding clause. The groups of that table for which the predicate is true become another intermediate result table, if there is an ORDER BY clause in a SELECT statement. Otherwise, the result table from a HAVING clause is the final result table for the select expression. Typically, the clause preceding the HAVING clause is a GROUP BY clause. The predicate is then evaluated for each group in the intermediate result table. The HAVING clause affects groups as the WHERE clause affects individual rows. If the HAVING clause is not preceded by a GROUP BY clause, SQL evaluates the predicate for all the rows in the intermediate result table as a single group.
Additional information available:
Restriction
SQL restricts which columns you can specify in the predicate of
a HAVING clause. Column names in a HAVING predicate must meet
one of the following conditions:
o Also be in the GROUP BY clause
o Be specified within a function
o Be an outer reference (possible only if the HAVING clause is
part of a column select expression)
singleton select
singleton-select =
SELECT -+------>------+-> select-list --+
+-> ALL ------+ |
+-> DISTINCT -+ |
+-------------------------------------+
+-> INTO --+-> parameter -+-+
+------ , <----+ |
+---------------------------+
+ FROM -++-> table-name -+-+----->----+-+-+--------->----------+-+
|+-> view-name --+ +-> alias -+ | +-> WHERE predicate -+ |
+---------- , <-----------------+ |
+------------------------------<---------------------------------+
++------------->------------------+-+---------->----------+-->
+-> GROUP BY -+-> column-name -+-+ +-> HAVING predicate -+
+------- , <-----+
Additional information available:
More Information
A singleton select statement is a special form of the SELECT statement that is legal only in programs, not in interactive SQL. A singleton select specifies a one-row result table. It includes an additional clause, INTO, to assign the values in the row to parameters in a program.
INTO
Names parameters representing program storage that will receive values from the columns of the one-row result table. If a parameter named in the list is corresponds to a program host structure, SQL considers the reference the same as a reference to each of the elements of the host structure. If the number of parameters specified, either explicitly or by reference to a host structure, does not match the number of values in the row of the result table, SQL generates an error when it precompiles the program or processes the SQL module containing the singleton select statement. If columns in the result table from a singleton select include null values, the corresponding parameters must include indicator parameters.
Value expression
value-expr = -+-+------+-+-> column-name --------------------------+-+----------> | +-> + -+ +-+-> SUM ---++-> (DISTINCT column-name) -+ +-> + -+-+ | +-> - -+ | +-> AVG ---++-> (ALL value-expr) -------+ +-> - -+ | | | +-> MAX ---+ | +-> * -+ | | | +-> MIN ---+ | +-> / -+ | | +---> COUNT -+--> (*) --------------------+ | | | +--> (DISTINCT column-name) -+ | | +-> literal ------------------------------+ | | +-> USER ---------------------------------+ | | +-> parameter ----------------------------+ | | +-> DBKEY --------------------------------+ | | +-> (col-select-expr) --------------------+ | | +-> (value-expr) -------------------------+ | +------------------------------<--------------------------------+
Additional information available:
More Information
A value expression is a symbol or string of symbols used to represent or calculate a single value. When you use a value expression in a statement, SQL retrieves or calculates the value associated with the expression and uses that value when executing the statement. Value expressions are also called scalar expressions or simply expressions. Select More_Information to continue.
Additional information available:
More Information
There are several different types of value expressions:
o A column name represents a value in table rows.
o A function calculates values for every row of a result
table. SQL functions are SUM, AVG, MAX, MIN, and COUNT.
o A literal directly specifies a value.
o A parameter represents a value in a host program.
o The DBKEY keyword represents the value of an internal
pointer, called a database key, to a table row.
o A column select expression used as a value expression
specifies a one-value result table.
You can also combine certain value expressions with arithmetic
operators to form value expression.
Literals, functions, DBKEYS and column select expressions are
described in separate Help topics.