SQL Statements
Quoted Pathname
Use a Quoted Pathname to supply a pathname to an executable object file when you register an external routine.
Syntax

|
Usage
A Quoted Pathname must be enclosed in single or double quotation marks. The opening and closing quotation marks must match. The filename in the Quoted Pathname must end in .so, because it refers to an executable object file in a shared library.
You can omit a pathname, and enter just a filename, if you want to refer to an internal function.
A pathname can begin with an environment variable, used as a location indicator. An environment variable begins with a dollar sign, and must be the first element in the pathname.
A pathname can also be absolute or relative. An absolute pathname always begins with a forward slash. A relative pathname need not begin with a period, and is relative from the current directory at the time the CREATE PROCEDURE or CREATE FUNCTION statement is run.
If you use a symbol, it refers to an optional entry point in the executable object file. Use a symbol only if the entry point has a name other than the name of the routine that you are registering with CREATE PROCEDURE or CREATE FUNCTION.
You can also specify the full pathname as a variable that begins with a dollar sign.
You can include spaces or tabs within a Quoted Pathname.
References
In this manual, see the CREATE FUNCTION and CREATE PROCEDURE statements and the External Routine Reference segment.
For information about how to create and use user-defined routines, see the Extending INFORMIX-Universal Server: User-Defined Routines manual. In the Informix Guide to SQL: Tutorial, see Chapter 14 for information about how to create and use SPL routines.
See the Extending INFORMIX-Universal Server: Data Types manual for information about how to create external routines that define opaque data types and distinct data types.
Quoted String
A quoted string is a string constant that is surrounded by quotation marks. Use the Quoted String segment whenever you see a reference to a quoted string in a syntax diagram.
Syntax
Restrictions on Specifying Characters in Quoted Strings
You must observe the following restrictions when you specify character in quoted strings:
- If you are using the ASCII code set, you can specify any printable ASCII character, including a single quote or double quote. For restrictions that apply to using quotes within quoted strings, see "Using Quotes in Strings".
- If you are using a nondefault locale, you can specify non-ASCII characters, including multibyte characters, that the code set of your locale supports. See the discussion of quoted strings in the Guide to GLS Functionality for further information.
- When you set the DELIMIDENT environment variable, you cannot use double quotes to delimit a quoted string. When DELIMIDENT is set, a string enclosed in double quotes is an identifier, not a quoted string. When DELIMIDENT is not set, a string enclosed in double quotes is a quoted string, not an identifier. See "Using Quotes in Strings" for further information.
- You can enter DATETIME and INTERVAL data as quoted strings. See "DATETIME and INTERVAL Values as Strings" for the restrictions that apply to entering DATETIME and INTERVAL data in quoted-string format.
- Quoted strings that are used with the LIKE or MATCHES keyword in a search condition can include wildcard characters that have a special meaning in the search condition. See "LIKE and MATCHES in a Condition" for further information.
- When you insert a value that is a quoted string, you must observe a number of restrictions. See "Inserting Values as Quoted Strings" for further information.
Usage
The string constant must be written on a single line; that is, you cannot use embedded new lines.
Using Quotes in Strings
The single quote has no special significance in string constants delimited by double quotes. Likewise, the double quote has no special significance in strings delimited by single quotes. For example, the following strings are valid:
If your string is delimited by double quotes, you can include a double quote in the string by preceding the double quote with another double quote, as shown in the following string:
When the DELIMIDENT environment variable is set, double quotes delimit identifiers, not strings. See "Delimited Identifiers" for further information on delimited identifiers.
DATETIME and INTERVAL Values as Strings
You can enter DATETIME and INTERVAL data in the literal forms described in the "Literal DATETIME" and "Literal INTERVAL" segments beginning on pages 1-995 and 1-998, respectively, or you can enter them as quoted strings. Valid literals that are entered as character strings are converted automatically into DATETIME or INTERVAL values. The following INSERT statements use quoted strings to enter INTERVAL and DATETIME data:
The format of the value in the quoted string must exactly match the format specified by the qualifiers of the column. For the first case in the preceding example, call_dtime must be defined with the qualifiers YEAR TO MINUTE for the INSERT statement to be valid.
LIKE and MATCHES in a Condition
Quoted strings with the LIKE or MATCHES keyword in a condition can include wildcard characters. See the "Condition" segment beginning on page 1-835 for a complete description of how to use wildcard characters.
Inserting Values as Quoted Strings
If you are inserting a value that is a quoted string, you must adhere to the following conventions:
References
In the Informix Guide to SQL: Syntax, see the discussion of the DELIMIDENT environment variable in Chapter 3.
In the Guide to GLS Functionality, see the discussion of quoted strings.
Relational Operator
A relational operator compares two expressions quantitatively. Use the Relational Operator segment whenever you see a reference to a relational operator in a syntax diagram.
Syntax
Each operator shown in the syntax diagram has a particular meaning.
Usage
For DATE and DATETIME expressions, greater than means later in time.
For INTERVAL expressions, greater than means a longer span of time.
For CHAR, VARCHAR, and LVARCHAR expressions, greater than means after in code-set order.
Locale-based collation order is used for NCHAR and NVARCHAR expressions. So for NCHAR and NVARCHAR expressions, greater than means after in the locale-based collation order. See the Guide to GLS Functionality for further information on locale-based collation order and the NCHAR and NVARCHAR data types. 
Using Operator Functions in Place of Relational Operators
Each relational operator is bound to a particular function, as shown in the table below. The function accepts two values and returns a boolean value of true, false, or unknown.
Connecting two expressions with a binary operator is equivalent to invoking the function on the expressions. For example, the following two statements both select orders with a shipping charge of $18.00 or more. The >= operator in the first statement implicitly invokes the greaterthanorequal() operator function.
The database server provides the functions associated with the relational operators for all built-in data types. When you develop a user-defined data type, you must define the functions for that type for users to be able to use the relational operator on the type.
Collating Order for English Data
If you are using the default locale (U.S. English), the database server uses the code-set order of the default code set when it compares the character expressions that precede and follow the relational operator. On UNIX platforms, the default code set is the ISO8859-1 code set, which consists of the following sets of characters:
This range contains control characters, punctuation symbols, English-language characters, and numerals.
This range includes many non-English-language characters (such as é, â, ö, and ñ) and symbols (such as £, ©, and ¿).
The following table shows the ASCII code set. The Num column shows the ASCII code numbers, and the Char column shows the ASCII character corresponding to each ASCII code number. ASCII characters are sorted according to their ASCII code number. Thus lowercase letters follow uppercase letters, and both follow numerals. In this table, the caret symbol (^) stands for the CTRL key. For example, ^X means CTRL-X .
Support for ASCII Characters in Nondefault Code Sets
Most code sets in nondefault locales (called nondefault code sets) support the ASCII characters. If you are using a nondefault locale, the database server uses ASCII code-set order for any ASCII data in CHAR and VARCHAR expressions, as long as the nondefault code set supports these ASCII characters. 
References
In the Informix Guide to SQL: Tutorial, see the discussion of relational operators in the SELECT statement in Chapter 2.
In the Guide to GLS Functionality, see the discussion of relational operator conditions in the SELECT statement.
Return Clause
Syntax
Usage
The Return clause is used in the CREATE FUNCTION statement to specify the data types of the value or values that a user-defined function returns. In the Return clause, you can use the keywords RETURNING and RETURNS interchangeably.
If you overload functions in your database, the data type of the return value is subject to routine resolution. For more information on routine resolution, see the Extending INFORMIX-Universal Server: User-Defined Routines manual.
For an SPL function, you can specify more than one data type in the Return clause.
If you write a stored procedure (a legacy SPL function), you can use a Return clause with the CREATE PROCEDURE statement. However, Informix recommends that you create new SPL functions with the CREATE FUNCTION statement. Any routine you create with a Return clause is considered a function. 
For an external function, specify exactly one value in the Return clause. However, an external function can return more than one row of data if it is an iterator function. For more information, see the description of the ITERATOR routine modifier in the Routine Modifier segment. 
SQL Data Types (Subset)
SPL functions and external functions can return values of any data type defined in the database, except SERIAL, SERIAL8, TEXT, BYTE, CLOB, or BLOB.
An external or SPL function can return values of COLLECTION, SET, MULTISET, LIST, or ROW data type, as the following example shows:
The calling routine must define variables of the appropriate complex types to hold the values the function returns.
A function can also return a value or values of an opaque or distinct data type that the database defines.
Referencing a Simple Large Object
Neither an SPL function nor an external function can return a TEXT or BYTE value (collectively called simple large objects) directly. A function can, however, use the REFERENCES keyword to return a descriptor that contains a pointer to a TEXT or BYTE object.
A function cannot return a CLOB or BLOB, or a pointer to a CLOB or BLOB.
References
See the CREATE FUNCTION, CREATE PROCEDURE, EXECUTE FUNCTION, EXECUTE PROCEDURE, and CALL statements in this manual.
In the Informix Guide to SQL: Tutorial, see Chapter 14 for information about how to create and use SPL functions.
See the Extending INFORMIX-Universal Server: User-Defined Routines manual for information about how to create and use external functions.
Routine Modifier
Use a Routine Modifier clause to specify attributes of a user-defined routine behaves. The Routine Modifier clause can be a Function Modifier or a Procedure Modifier.
Function Modifier
Function modifiers are valid in the WITH clause of the CREATE FUNCTION statement to register a user-defined function.
Procedure Modifier
Procedure modifiers are valid in the WITH clause of the CREATE PROCEDURE statement to register a user-defined procedure.
Modifier Descriptions
The following sections describe each of the routine modifiers.
HANDLESNULLS
You can use the HANDLESNULLS modifier with both external functions and external procedures. HANDLESNULLS specifies that an external routine can handle NULL values passed to it as arguments. If you do not specify HANDLESNULLS, and if you pass an argument with a NULL value to the routine, the routine does not execute and returns a NULL value.
By default, HANDLESNULLS is not set for external routines. That is, the database server assumes that an external routine does not handle null arguments. If your external routine handles NULL values, specify HANDLESNULLS in the WITH clause of the CREATE FUNCTION or CREATE PROCEDURE statement. 
Do not use HANDLESNULLS with SPL routines. SPL routines handle NULL values by default. You do not need to specify HANDLESNULLS so that an SPL routine handles NULL values. 
CLASS
You can use the CLASS modifier with both external functions and external procedures. The CLASS modifier runs the external routine in a virtual processor class (VP class) that you specify. The purpose of setting up classes of virtual processors is to group sets of routines, so that the routines in a group execute within the same context.
You can run external routines written in C in the CPU virtual processor (CPU VP) class or in an external virtual processor (EVP) class that you name with the CLASS modifier. If you do not specify a VP class, the external routine runs in the CPU VP class by default.
If an external routine is ill-behaved, you must run it in a class other than the CPU VP. A routine is ill-behaved if it does any of the following:
- Runs for a long time without yielding
- Makes an operating system call that can block other calls, for example, READ, WRITE, SELECT, POLL, PUTMSG, BGETMSG, SEMOP, MSGGET, PAUSE, and WAIT
- Modifies the global state of the virtual processor on which it is running by:
- Calls one of the following ill-behaved C library functions: stdio(), getpwent(), and gethostbyname().
Use the CLASS modifier in the WITH clause of the CREATE FUNCTION or CREATE PROCEDURE statement to name an external VP class for any routine that might cause the database server to hang, stop running, or behave erratically. 
Do not use CLASS with SPL routines. SPL routines always run in the CPU VP. 
VARIANT and NOT VARIANT
You can use VARIANT and NOT VARIANT with user-defined functions, both external functions and SPL functions. A function is variant if it returns different results when it is invoked with the same arguments, or if it modifies a database or variable state. For example, a function that returns the current date or time is a variant function.
By default, user-defined functions are variant. To define a non-variant function, specify NOT VARIANT in the WITH clause of the CREATE FUNCTION statement. If the function is non-variant, the database server may cache the return values of expensive functions or run parallel queries. You can create functional indexes only on non-variant functions. For more information on functional indexes, see the CREATE INDEX statement. 
You can specify VARIANT or NOT VARIANT in the Routine Modifier clause or in the External Routine Reference clause, which is described on page 1-960. If you specify the modifier in both places, you must use the same modifier in both. 
STACK
You can use the STACK modifier with both external procedures and external functions. The STACK modifier enables the database server to run an external routine in a stack that is larger than the stack size that the STACKSIZE configuration parameter specifies. When the external routine executes, the database server increases the stack size of the routine to the number of bytes specified. When the routine completes, the original stack size is restored. Specify a larger stack size to prevent stack overflow. 
You cannot use the STACK modifier with SPL routines. 
INTERNAL
You can use the INTERNAL modifier with both external procedures and external functions. The INTERNAL modifier specifies that an SQL or SPL statement cannot call the external routine. A routine that is specified INTERNAL is not considered during routine resolution. Use INTERNAL for external routines that define access methods, language managers, and so on. For more information on how to write iterator functions, see the DataBlade API Programmer's Manual.
By default, an external routine is not internal; that is, an SQL or SPL statement can call the routine. To define an internal function, specify INTERNAL in the WITH clause of the CREATE FUNCTION or CREATE PROCEDURE statement. 
You cannot use the INTERNAL modifier with SPL routines. 
ITERATOR
Use the ITERATOR modifier only with external functions. This modifier is not valid for external procedures. The ITERATOR modifier specifies that the external function is an iterator function; that is, it returns a set of values and is invoked repeatedly by the database server. An iterator function is similar to an SPL function that contains the RETURN WITH RESUME statement.
By default, an external function is not an iterator. To define an iterator function, specify ITERATOR in the WITH clause of the CREATE FUNCTION statement. 
You cannot use the ITERATOR modifier with SPL routines. 
Both an iterator function and an SPL function with RETURN WITH RESUME require a cursor to be executed. The cursor allows the client application to retrieve the values one at a time with the FETCH statement. 
References
In this manual, see the CREATE FUNCTION and CREATE PROCEDURE statements.
For information about how to create and use external routines, see the Extending INFORMIX-Universal Server: User-Defined Routines manual and the DataBlade API Programmer's Manual. For information about how to create and use SPL routines, see Chapter 14 in the Informix Guide to SQL: Tutorial.
Routine Parameter List
Use the Function Parameter List to define the parameters an external function or SPL function can accept. Use the Procedure Parameter List to define the parameters an external procedure or SPL procedure can accept.
Function Parameter List
Procedure Parameter List
Parameter
A Parameter is one item in a Function Parameter List or Procedure Parameter List.
Usage
To define a parameter when creating a routine, specify its name (required for SPL routines; optional for external routines) and its data type. The data type can be any data type in the database, except SERIAL, SERIAL8, TEXT, BYTE, CLOB, or BLOB.
The data type can be the name of an opaque, distinct, or row type you have defined. The data type can also be COLLECTION, SET, MULTISET, LIST, or ROW with the definition of an unnamed row type. For the complete syntax of all the SQL data types, see "Data Type".
SQL Data Type (Subset)
A routine can define a parameter of any data type defined in the database, except SERIAL, SERIAL8, TEXT, BYTE, CLOB, or BLOB. A parameter can have an opaque type, distinct type, built-in type (except the excluded data types just listed), collection type, named row type, or unnamed row type.
A parameter can also be of type COLLECTION, which is a generic collection type that can accept any SET, MULTISET, or LIST as an argument.
For more information on defining data types for parameters, see "Data Type".
LIKE Clause
The LIKE keyword specifies that the data type of a parameter is the same as a column defined in the database and changes with the column definition. If you define a parameter with LIKE, the parameter's data type changes as the data type of the column changes.
If any of the arguments for the routine are defined using the LIKE clause, you cannot overload the routine and the routine will not be considered in the routine resolution process.
For example, suppose you create the following routine:
Now you cannot create another routine named cost() in the same database with two arguments. However, you can create a routine named cost() with a number of arguments other than two.
REFERENCES Clause
Use the REFERENCES clause to specify that a parameter contains TEXT or BYTE data.
The REFERENCES keyword allows you to use a pointer to a TEXT or BYTE object as a parameter. You cannot use a TEXT or BYTE object directly.
If you use the DEFAULT NULL option in the REFERENCES clause, and you call the routine without a parameter, a null value is used.
Default Value
You can use the DEFAULT keyword followed by an expression to specify a default value for a parameter. If you provide a default value for a parameter, and the routine is called with fewer arguments than were defined for that routine, the default value is used. If you do not provide a default value for a parameter, and the routine is called with fewer arguments than were defined for that routine, the calling application receives an error.
The following example shows a CREATE FUNCTION statement that specifies a default value for a parameter. This function finds the square of the i parameter. If the function is called without specifying the argument for the i parameter, the database server uses the default value 0 for the i parameter.
Specifying an OUT Parameter (Functions Only)
When you register an external function written in C, you can specify that the last parameter in the list is an OUT parameter. The OUT parameter corresponds to a value the function returns indirectly, through a pointer. The value the function returns through the pointer is an extra value, in addition to the value it returns explicitly.
Once you register a function with an OUT parameter, you can use the function with a Statement Local Variable (SLV) in an SQL statement. You can only mark one parameter as OUT, and it must be the last parameter.
For example, the following declaration of a C language function allows you to return an extra value through the y parameter:
You would register the function with a CREATE FUNCTION statement similar to this one:
If you specify an OUT parameter, and if you use Informix-style parameters, the argument is passed to the OUT parameter by reference.
The OUT parameter is not significant in determining the routine signature.
References
In this manual, see the CREATE FUNCTION and CREATE PROCEDURE statements. See also the Argument segment.
For information about how to create and use external routines, see the Extending INFORMIX-Universal Server: User-Defined Routines manual. For information about how to create and use SPL routines, see Chapter 14 in the Informix Guide to SQL: Tutorial.
Specific Name
Use a Specific Name to give a routine a name that is unique in the database or name space.

|
Syntax
Element
|
Purpose
|
Restrictions
|
Syntax
|
---|
owner name
| The name of the owner of the routine
| This name, if used, must be the same owner name used in the Function Name or Procedure Name for this routine.
If no owner name is specified in the routine name, then the owner name you use in the Specific Name must be the user id of the person creating the routine.
If you omit owner name, the server uses the user id of the person creating the routine.
| Identifier, p. 1-966
|
specific identifier
| The unique name of the routine
| In a non-ANSI database, the specific identifier must be unique within the database. In other words, two specific names cannot have the same specific identifier even if they have two different owners.
In an ANSI database, the specific identifier must be unique for the owner. In other words, the same specific identifier can be used for two routines within the same database if the routines have different owners.
The specific identifier can be up to 128 characters long.
| Identifier, p. 1-966
|
Usage
A Specific Name is a unique identifier that you define in a CREATE PROCEDURE or CREATE FUNCTION statement to serve as an alternate name for a routine.Because you can create user-defined routines to overload routines, a database can have more than one routine with the same name and different parameter lists. You can assign a routine a Specific Name that uniquely identifies the specific routine.
If you give a routine a Specific Name when you create it, you can later alter or drop that routine using the Specific Name only. Otherwise, you need to include the parameter data types with the routine name when you drop the routine, if the routine name alone does not uniquely identify the routine.
You can use a Specific Name in the following SQL statements:
In an ANSI database, you can use the same specific identifier for two routines within the same database if the routines have different owners.
The Specific Name must be unique within the name space in which it is created:
References
In this manual, see the CREATE FUNCTION, CREATE PROCEDURE, DROP FUNCTION, DROP PROCEDURE, DROP ROUTINE, EXECUTE FUNCTION, and EXECUTE PROCEDURE statements. See also the Function Name and Procedure Name segments.
For information about how to create and use external routines, see the Extending INFORMIX-Universal Server: User-Defined Routines manual. For information about how to create and use SPL routines, see Chapter 14 in the Informix Guide to SQL: Tutorial.
Statement Block
Use a Statement Block, instead of an External Routine Reference, when you write an SPL routine.
Syntax
Usage
If the statement block portion of the statement is empty, no operation takes place when you call the routine. You might use such a routine in the development stage when you want to establish the existence of a routine but have not yet coded it.
Also, you cannot close the current database or select a new database within a routine. And you cannot drop the current stored routine within a stored routine. You can, however, drop another routine.
Subset of SQL Statements Allowed in the Statement Block
You can use any SQL statement in the statement block, except those listed in the following table.
Figure 1-7
SQL Statements That Cannot Be Used in an SPL Routine
Subset of SPL Statements Allowed in the Statement Block
You can use any of the following SPL statements in the statement block.
Figure 1-8
SPL Statements that Can Be Used in an SPL Routine
Restrictions on SELECT Statement
You can use a SELECT statement in only two cases:
Support for Roles and User Identity
You can use roles with routines you create. You can execute role-related statements (CREATE ROLE, DROP ROLE, and SET ROLE) and SET SESSION AUTHORIZATION statements within a routine. You can also grant privileges to roles with the GRANT statement within a routine. Privileges that a user has acquired through enabling a role or by a SET SESSION AUTHORIZATION statement are not relinquished when a routine is executed.
For further information about roles, see the CREATE ROLE, DROP ROLE, GRANT, REVOKE, and SET ROLE statements in this guide.
Restrictions on a Routine Called in a Data Manipulation Statement
If a routine is called as part of an INSERT, UPDATE, DELETE, or SELECT statement, the called routine cannot execute any statement listed in Figure 1-9. This restriction ensures that the routine cannot make changes that affect the SQL statement that contains the routine call.
Figure 1-9
SQL Statements Not Allowed in an SPL Routine That a Data Manipulation Statement Calls
For example, if you use the following INSERT statement, the execution of the called procedure dup_name is restricted:
In this example, dup_name cannot execute the statements listed in Figure 1-9. However, if dup_name is called within a statement that is not an INSERT, UPDATE, SELECT, or DELETE statement (namely EXECUTE PROCEDURE), dup_name can execute the statements listed in Figure 1-9.
You can use the BEGIN WORK and COMMIT WORK statements in procedures. You can start a transaction, finish a transaction, or start and finish a transaction in a procedure. If you start a transaction in a procedure that is executed remotely, you must finish the transaction before the procedure exits.
Adding Comments to an SPL Routine
To add a comment to any line of a routine, place a double-dash (--) before the comment or enclose the comment in braces ({}). The double dash complies with the ANSI standard. The curly brackets are an Informix extension to the ANSI standard.
References
In this manual, see the CREATE FUNCTION and CREATE PROCEDURE statements.
In the Informix Guide to SQL: Tutorial, see Chapter 14 for information about how to create and use SPL routines.
Synonym Name
The Synonym Name segment specifies the name of a synonym. Use the Synonym Name segment whenever you see a reference to a synonym name in a syntax diagram.
Syntax
Usage
The actual name of the synonym is an SQL identifier.
If you are using a nondefault locale, you can use characters from the code set of your locale in the names of synonyms. For more information, see the Guide to GLS Functionality. 
If you are creating the synonym, the name of the synonym must be unique within a database. The name cannot be the same as table names, temporary table names, or view names. It is possible to have a public and private synonym with the same name.
If you are creating the synonym, the combination owner.name must be unique within a database.
The owner name is case sensitive. In an ANSI-compliant database, if you do not use quotes around the owner name, the name of the table owner is stored in uppercase letters. For more information, see the discussion of case sensitivity in ANSI-compliant databases on page 1-1049. 
References
See the CREATE SYNONYM statement in this manual for information on creating synonyms.
In the Informix Guide to SQL: Tutorial, see the discussion of synonyms in Chapter 11.
Table Name
The Table Name segment specifies the name of a table. Use the Table Name segment whenever you see a reference to a table name in a syntax diagram.
Syntax
Usage
The name of a table is an SQL identifier. The following example shows a table specification:
If you are using a nondefault locale, you can use characters from the code set of your locale in the names of tables. For more information, see the Guide to GLS Functionality. 
If you are creating or renaming a table, the name of the table must be unique among all the tables, synonyms, temporary tables, and views that already exist in the database.
If you are creating or renaming a table, you must make sure that the combination of owner and name is unique within a database.
In an ANSI-compliant database, the table name must include owner. unless you are the owner. For system catalog tables, the owner is informix. 
Case Sensitivity in ANSI-Compliant Databases
The database server shifts the owner name to uppercase letters before the statement executes, unless the owner name is enclosed in quotes. Put quotes around the owner portion of a name if you want the owner to be read exactly as written. In the following example, the name cathl in the first statement is upshifted to CATHL before it is used; the name nancy in the second statement is not upshifted:
No problem exists if you create a table with an implicit owner in uppercase letters and the owner's real login name is also in uppercase letters. For example, suppose that you are the user BROWN, and you create a view with the following statement:
You, BROWN, can run the following SELECT statements on the view:
In the first query in the preceding example, the database server automatically upshifts brown before the SELECT statement executes. In the second query, the database server returns the owner name BROWN already upshifted. In the third query, USER returns the login name as it is stored-in this case, in uppercase letters. If you are the user nancy, and you use the following statement, the resulting view has the name NANCY.njcust:
If you are nancy, and you use the following statement, the resulting view has the name nancy.njcust:
The following SELECT statement fails because it tries to match the name NANCY.njcust to the actual owner and table name of nancy.njcust:
References
See the CREATE TABLE statement in this manual for information on creating tables.
In the Informix Guide to SQL: Tutorial, see the discussion of tables in Chapter 9.
View Name
The View Name segment specifies the name of a view. Use the View Name segment whenever you see a reference to a view name in a syntax diagram.
Syntax
Usage
The name of a view is an SQL identifier.
If you are using a nondefault locale, you can use characters from the code set of your locale in the names of views. For more information, see the Guide to GLS Functionality. 
The use of the prefix owner. is optional; however, if you use it, the database server does check owner for accuracy. If you are creating a view, the name of the view must be unique among all the tables, synonyms, temporary tables, and views that already exist in the database.
If you are creating a view, the owner.view-name must be unique among all the tables, synonyms, and views that already exist in the database.
The owner name is case sensitive. In an ANSI-compliant database, if you do not use quotes around the owner name, the name of the table owner is stored as uppercase letters. For more information, see the discussion of case sensitivity in ANSI-compliant databases on page 1-1049. 
References
See the CREATE VIEW statement in this manual for information about how to create views.
In the Informix Guide to SQL: Tutorial, see the discussions of views in Chapter 11.
|