-------------------------------------------------------------------------- Interactive SQL execution program ( HiRDB SQL Executer ) -------------------------------------------------------------------------- Contents ( 1 ) Functional overview ( 2 ) Executer ( 3 ) Format ( 4 ) Options ( 5 ) Description ( 6 ) Environment variable ( 7 ) Executable SQL and the end of a SQL statement ( 8 ) pdsql commands ( 9 ) Return values (return codes) ( 10 ) Rules ( 11 ) Troubleshooting Appendix A. pdsql command detail Appendix B. Messages Appendix C. Data input using ? parameter Appendix D. "*" input rules Appendix E. XDM/RD E2 Connection Appendix F. Differences between the SJIS Version and Unicode Version Appendix G. Effect of The SQL Reserved Word Deletion Function ----------------------------------------------------------------------- ( 1 ) Functional overview HiRDB SQL Executer (line mode version) is an interactive SQL execution program that enables users to interact with a HiRDB database to execute SQL. The program comes in the SJIS version and the Unicode version. For details about the difference between the two versions, see Appendix F, Differences between the SJIS Version and Unicode Version. When using the program, you enter SQL at the MS-DOS or command prompt (hereafter referred to as the MS-DOS prompt) or from your file, and the program outputs the execution results on the MS-DOS prompt or in the file. ( 2 ) Executer Users authorized to connect to HiRDB can execute HiRDB SQL Executer. However, higher authorization may be required depending on the SQL to be executed. ( 3 ) Format Execute the following command from the MS-DOS prompt. The user can also execute this command with [Run] and shortcuts. The activation program file (PDSQLX.EXE) enables the program to select either the SJIS version or the Unicode version according to the value of the environment variable before activation. The program registers a shortcut for the activation program file in the start menu. ------------------------------------------------------------------ [drive-name:path-name\]pdsql.exe [-u authorization-identifier[/password]] [-h host-name] [-n port-number] ------------------------------------------------------------------ "drive-name:path-name" specifies a HiRDB SQL Executer installation destination. pdsql.exe is the program for the SJIS version. When activating the Unicode version, change pdsql.exe to pdsqlu.exe. When using the activation program file, change pdsql.exe to pdsqlx.exe. c:\Program files\hitachi\pdsql\pdsql.exe ( 4 ) Options ** -u authorization-identifier[/password] Specifies the authorization identifier of the user who executes this program. If only authorization-identifier is specified in this option, a message with responses is displayed that asks the user to enter his or her password. If authorization-identifier/password is specified, the specified values are assumed to be the authorization identifier and password. If this option is omitted, authorization-identifier/password is assumed in any of the following methods: - This program uses the value set in the PDUSER environment variable at execution. If you cannot enter your password as in batch execution, set PDUSER. - If the PDUSER environment variable is not set, the name of the user who logged in is assumed. Then, when a message with responses is displayed that asks you to enter your password, enter your password. - If the authorization identifier and password specified in the -u option are enclosed in \"...\", they are case-sensitive. The password that is enclosed in "..." and was entered in reply to the password input request is also case-sensitive. If these authorization identifier and password are not enclosed in \"...\" and "..." , they are treated as upper case. ** -h host-name - Specifies the host name of the HiRDB system to be connected. If this option is omitted, the value set in the PDHOST environment variable is used. ** -n port-number - Specifies the port number of the HiRDB system to be connected. If this option is omitted, the value set in the PDNAMEPORT environment variable is used. [Examples of option specification] - When -u is specified pdsql -u user1<> <- The password input request is displayed. password1<> (#1) <- This program waits for the input of your password. - When a lower case authorization identifier and password are specified in the -u option pdsql -u \"user1\"<> <- The password input request is displayed. "password1"<> (#1) <- This program waits for the input of your password. - When the -u option is not specified but the PDUSER environment variable is set pdsql<> (The authorization identifier and password set in PDUSER are used) <-This program waits for the input of your password. - When the -u option is not specified and the PDUSER environment variable is also not set pdsql<> (The user name in the Login window is used as the authorization identifier.) <-The password input request is displayed. password1<> (#1) <-This program waits for the input of your password. #1: This request is hidden during password entry. ( 5 ) Description Write the SQL and pdsql commands to be executed after starting this program. You can enter the SQL and pdsql commands to be executed from the MS-DOS prompt or a file. [When entering the SQL and pdsql commands to be executed from the MS-DOS prompt] - When started, this program enters the input wait state. Enter the SQL and pdsql commands that you want to enter. When this program enters the input wait state, the MS-DOS prompt appears. The display format of this prompt varies with input conditions. - COMMAND ?: Normal input wait - NEXT ?: Wait for input of a continuation line - BLOCK(n) ?: Wait for input of a value in reply to the BLOCK/ITERATE statement - DATA(n) ?: Wait for input of a value in reply to the ? parameter For the values to be entered in reply to the ? parameter, see Appendix C. Specify a semicolon (;) at the end of each SQL and pdsql command and at the end of the value to be entered in reply to the ? parameter. To exit this program, enter the EXIT command. [When entering the SQL and pdsql commands to be executed from a file] Create the SQL and pdsql commands to be executed in a file in advance and then redirect the input source of the standard input to the file. (Example) pdsql < infile Contents of infile description --------------------------- SELECT C1,C2 FROM T1; . . EXIT; --------------------------- Information displayed as search results: The search results described here include the following information: - Search results for the SELECT statement - Output parameters for the CALL statement or GET DIAGNOSTICS statement - Results-set for the CALL statement Search results will be displayed according to the specified display format. The display format will be either hexadecimal or character format. The default setting is character format. The display format can be changed by using the SET DUMPMODE command or the environment variable PDUAPDUMP. Table 5-1 indicates the display area size of the column for each data type, and table 5-2 lists the data display formats. Table 5-1 : Display area size (character format) Data type Display area size (column) (see #1) ------------------------+------------------------------------------- ROW Total number of bytes for all the columns INTERVAL YEAR TO SECOND 16+scale INTERVAL YEAR TO DAY 10 INTERVAL HOUR TO SECOND 8+scale DATE 10 TIME 8(If the scale greater than 0, 9+scale) TIMESTAMP 19(If the scale greater than 0, 20+scale) BINARY Maximum number of stored bytes.(#2) BLOB Maximum number of stored bytes.(#2) CLOB Maximum number of stored bytes.(#2) MVARCHAR Maximum number of stored bytes.(#2) MCHAR Number of stored bytes.(#2) NVARCHAR Maximum number of stored characters.*2(#2) NCHAR Number of stored characters.*2(#2) VARCHAR Maximum number of stored bytes.(#2) CHAR Number of stored bytes.(#2) FLOAT 23 SMALLFLT 23 DECIMAL precision+2 INTEGER 12 SMALLINT 6 #1: If the display area size is smaller than the length of the column name, the length of the column name will be applied. #2: You can use the SET xxxx LIMIT command to reduce the size. Table 5-2 : Data display format for each data type Data type Column data display format (see #1) -----------------+---------------------------------------------------- ROW - Data is output in character format. - If the data contains an invalid character (ASCII code 0x00 to 0x1F, such as a null character), the invalid character is displayed as a colon (:). - If the data length is 0 bytes, no data is output. INTERVAL YEAR - A right-align numerical value is output in [-]yyyymmddhhmmss.[nnnnnn] format. TO SECOND - A minus sign (-) is added to column data. - The fractional part depends on the data definition length. INTERVAL YEAR - A right-align numerical value is output in [-]yyyymmdd. format. TO DAY - A minus sign (-) is added to column data. INTERVAL HOUR - A right-align numerical value is output in [-]hhmmss.[nnnnnn] format. TO SECOND - A minus sign (-) is added to column data. - The fractional part depends on the data definition length. DATE - Column data is output in the yyyy-mm-dd format (character string format). TIME - Column data is output in the hh:mm:ss[.nnnnnn] format (character string format). - The fractional part depends on the data definition length. TIMESTAMP - Column data is output in the yyyy-mm-dd hh:mm:ss [.nnnnnn] format (character string format). - The fractional part depends on the data definition length. BINARY AND - Data is output in character format. BLOB AND - If the data contains an invalid character (ASCII CLOB AND code 0x00 to 0x1F, such as a null character), the MVARCHAR AND invalid character is displayed as a colon (:). MCHAR AND - If the data length is 0 bytes, no data is output. NVARCHAR AND NCHAR AND VARCHAR AND CHAR FLOAT AND - A right-align numerical value is output as a decimal number character string. SMALLFLT AND - A minus sign (-) is added to column data. DECIMAL AND - "Integer.decimal" is output as a decimal point. INTEGER AND - The exponent (e) of mantissa is output as a floating point. SMALLINT #1: Excluding ROW data, if the data is a null value, a null value (the initial value is an asterisk (0x2A)) equal to the size of the display area is displayed. ( 6 ) Environment variable You can set environment variables to change the default settings of this program. Environment variables set in the Windows system properties are automatically set at the activation of this program. You can set the following environment variables: ------------------------------------------------------------------------ PDUAPAUTOCOMMIT Set whether to issue a commit request automatically after an SQL statement is executed. ON : Issues a commit request automatically. OFF: Does not issue a commit request automatically. The default is ON. - If you need to change the set values while the program is running, execute the pdsql command SET AUTO COMMIT. ------------------------------------------------------------------------ PDUAPDUMP Set the display format of the search results. ON : Displays the search results in hexadecimal. OFF: Displays the search results as strings. The default is OFF. - If you need to change the set values while the program is running, execute the pdsql command SET DUMPMODE. ------------------------------------------------------------------------ PDUAPPTFNULL Set how the PUTFILE command handles NULL data. ON : Outputs nothing. OFF: Outputs an asterisk ("*"). The default is OFF. - When OFF is set, nothing is output for the following data types: CHARACTER, VARCHAR, NCHAR, NVARCHAR, MCHAR, MVARCHAR, BLOB,BINARY - This environment variable is not effective for the PUTFILE BINARY command. ------------------------------------------------------------------------ PDSQLBINARYLIMIT The command limits the length of the BINARY type data that can be input and output. 0 : Uses the defined length. Between 1 and 2147483647 : Limits the length to the specified value. The value 0 is assumed if no setting exists. - If you need to change the set values while the program is running, execute the pdsql command SET BINARY LIMIT. ------------------------------------------------------------------------ PDSQLBLOBLIMIT The command limits the length of the BLOB type data that can be input and output. 0 : Uses the defined length. Between 1 and 2147483647 : Limits the length to the specified value. The value 0 is assumed if no setting exists. - If you need to change the set values while the program is running, execute the pdsql command SET BLOB LIMIT. ------------------------------------------------------------------------ PDSQLCLOBLIMIT The command limits the length of the CLOB type data that can be input and output. 0 : Uses the defined length. Between 1 and 2147483647 : Limits the length to the specified value. The value 0 is assumed if no setting exists. - If you need to change the set values while the program is running, execute the pdsql command SET CLOB LIMIT. ------------------------------------------------------------------------ PDSQL_CHARCODE This environment variable is valid only for the Windows. The command sets the program to be activated by the activation program files(PDSQLX.EXE and PDSQLWX.EXE and PDSQLWX8.EXE) SJIS : Activates the SJIS version (PDSQL.EXE and PDSQLW.EXE and PDSQLW8.EXE). UNICODE : Activates the Unicode version (PDSQLU.EXE and PDSQLWU.EXE and PDSQLWU8.EXE). If PDSQL_CHARCODE is not set, set the program to start by referring to PDCLTCNVMODE (environment variable or HIRDB.INI) in the client environment definition. If the value of PDCLTCNVMODE is a character string that begins with "UCS2": Start the Unicode version. If the value of PDCLTCNVMODE is other than the above: Start the SJIS version. If neither PDSQL_CHARCODE nor PDCLTCNVMODE has been set, Activates the SJIS version. ------------------------------------------------------------------------ PDSQL_SPLITSIZE Set the size of division acquisition of the BINARY/BLOB/CLOB type data. 0 : The division acquisition is not done. Between 4 and 2097152 : The division acquisition is done by the specified value(Unit of KB). - If you need to change the set values while the program is running, execute the pdsql command SET SPLIT SIZE. ------------------------------------------------------------------------ PDSQL_CONVSPACE Set whether to convert one-byte space into character codes except changing line in character string of command ON : The control character code is converted at the one-byte space. OFF: The control character code is not converted. - If you need to change the set values while the program is running, execute the pdsql command SET CONVSPACE. ------------------------------------------------------------------------ PDSQL_EXEC_SEMICOLON_ENTER Specify the relationship between the semicolon and the execution trigger. This environment variable is enabled in the following cases: - in the command line version, it is entered - a command or SQL statement is entered from a file YES or 0: After the beginning of an enclosed annotations (/*), if a semicolon is immediately followed by a linefeed character(#1), the SQL statement is executed. NO or 1 : After the beginning of an enclosed annotations (/*), if a semicolon is immediately followed by a linefeed character(#1), the SQL statement is not executed. The semicolon is treated as a character in the enclosed annotations. The system waits for a continuing statement to be entered. 2 : If the portion of a line that starts from a semicolon that is not within an enclosed annotations and that ends at the end of the line (the linefeed code) is only an enclosed annotations, the SQL statement is executed. At such a time, the enclosed annotations that is between the semicolon and the linefeed character is not sent to the server. If nothing is set, NO is assumed. In versions 08-02 and earlier, the YES operation was performed. Example 1: Comparison between when PDSQL_EXEC_SEMICOLON_ENTER is set to 0 and when it is set to 1 (Input) /*COM11*/SELECT * FROM T01/*COM12; SELECT * FROM T02/*COM22*/; If PDSQL_EXEC_SEMICOLON_ENTER is set to 0 (or YES), when entry of the first row is complete, the enclosed portion below (1) is executed. When entry of the second row is complete, (2) is executed. (1) /*COM11*/SELECT * FROM T01/*COM12 (2) SELECT * FROM T02/*COM22*/ If PDSQL_EXEC_SEMICOLON_ENTER is set to 1 (or NO), when entry of the second row is complete (a line feed is entered), the enclosed portion (1) below is executed. (1) /*COM11*/SELECT * FROM T01/*COM12; SELECT * FROM T02/*COM22*/ Example 2: Comparison between when PDSQL_EXEC_SEMICOLON_ENTER is set to 1 and when PDSQL_EXEC_SEMICOLON_ENTER is set to 2 (Input) /*COM11*/SELECT * FROM T01/*COM12*/;/*COM13*/ /*COM21*/SELECT * FROM T02/*COM22*/;/*COM23*/ /*COM31*/ /*COM41*/SELECT * FROM T04/*COM42*/ /*COM51*/WHERE C1 <200; If PDSQL_EXEC_SEMICOLON_ENTER is set to 1 (or NO), when entry of the fifth row is complete (a line feed is entered), the SQL in the enclosed portions (1), (2), and (3) below is executed. (1) (2) /*COM11*/SELECT * FROM T01/*COM12*/ /*COM13*/ (2) (3) /*COM21*/SELECT * FROM T02/*COM22*/ /*COM23*/ (3) /*COM31*/ /*COM41*/SELECT * FROM T04/*COM42*/ /*COM51*/WHERE C1 <200 If PDSQL_EXEC_SEMICOLON_ENTER is set to 2, when entry of the first row is complete, the enclosed portion (1) below is executed. When entry of the second row is complete, (2) is executed. When entry of the fifth row is complete, (3) is executed. (1) /*COM11*/SELECT * FROM T01/*COM12*/ /*COM13*/ (2) /*COM21*/SELECT * FROM T02/*COM22*/ /*COM23*/ (3) /*COM31*/ /*COM41*/SELECT * FROM T04/*COM42*/ /*COM51*/WHERE C1 <200 In the GUI version or the simplified GUI version, when data is entered from the SQL input screen, this environment variable is not enabled. The NO operation is always performed. #1: Either CR (X'0d') + NL (X'0a') or NL (X'0a') is interpreted as a line feed. ------------------------------------------------------------------------ PDSQL_REMOVE_LINEFEED_CHARACTER Set whether to remove the line feed code (NL (X'0a'), CR (X'0d')) from the character string in the SQL statement or the pdsql command line. ON: Remove the linefeed character. OFF: Do not remove the line feed character. If nothing is set, OFF is assumed. To change the value during execution of the program, execute the SET REMOVE LINEFEED CHARACTER pdsql command. In versions 09-01 and earlier, the NO operation was performed. In the simplified GUI version, when data is entered from the SQL input screen, the settings are not enabled. The NO operation is always performed. For the effects when this setting is ON, see in "Rules". ------------------------------------------------------------------------ PDSQL_IDENT_QUOT In the TABLEINF command and the SEQINF command, set whether to use double quotation marks (") to enclose the name to be output. ON : Output the name enclosed by double quotation marks. OFF : Output the name not enclosed by double quotation marks except when the name includes a lowercase character If nothing is set, ON is assumed. In versions 09-01 and earlier, the NO operation was performed. ------------------------------------------------------------------------ ( 7 ) Executable SQL and the end of a SQL statement (a)SQL that can be executed by this program. Table 7-1 displays SQL that can be executed by this program. For information about SQL syntax, see the manual HiRDB SQL Reference. In the XDM/RD E2 connection status, the executable SQL are different. For more details, see "Appendix E. XDM/RD E2 Connection". Table 7-1 : SQL that can be executed by this program. SQL that can be executed Description ---------------------------------------------------------------------------- Definition Schema definition CREATE SCHEMA Defines a schema. SQL DROP SCHEMA Drops a schema. Table definition ALTER TABLE Alters table definition. CREATE TABLE Defines a table. DROP TABLE Drops a table. View definition CREATE [PUBLIC] Defines a viewed table. VIEW DROP [PUBLIC] Drops a viewed table. VIEW Index definition ALTER INDEX Alters index definition. CREATE INDEX Defines an index. DROP INDEX Drops an index. Procedure ALTER PROCEDURE Alters a procedure. definition CREATE [PUBLIC] Defines a procedure. PROCEDURE(#1) DROP [PUBLIC] Deletes a procedure. PROCEDURE Alias definition CREATE ALIAS Defines an alias. DROP ALIAS Drops an alias. Altering function ALTER ROUTINE Alters a function or procedure. Function definition CREATE [PUBLIC] Defines a function. FUNCTION(#2) DROP [PUBLIC] Drops a function. FUNCTION Index type CREATE INDEX TYPE Defines an index type. definition DROP INDEX TYPE Drops an index type. Type definition CREATE TYPE(#3) Defines an abstract data type. User-defined type DROP DATA TYPE Drops abstract data type, deletion individual type, or named line type. Trigger definition ALTER TRIGGER Recreates a trigger SQL object. CREATE TRIGGER(#4) Defines a trigger. DROP TRIGGER Drops a trigger. Security audit CREATE AUDIT Defines the audit event target definition to be registered as audit trial and the audit target. Security audit DROP AUDIT Excludes the defined audit target exclusion target. CONNECT-related CREATE CONNECTION Defines security security facility SECURITY items related definition to the CONNECT-related security facility. CONNECT-related DROP CONNECTION Deletes security items security facility SECURITY related to the deletion CONNECT-related security facility. Sequence definition CREATE SEQUENCE Defines a sequence. DROP SEQUENCE Drops a sequence. Definition of|DBA GRANT DBA Grants DBA privilege. privilege | privilege REVOKE DBA Revokes DBA privilege. |Schema GRANT SCHEMA Grants schema definition | definition privilege. | privilege REVOKE SCHEMA Revokes schema definition | privilege. |CONNECT GRANT CONNECT Grants CONNECT privilege. | privilege REVOKE CONNECT Revokes CONNECT privilege. |Access GRANT access Grants access privilege. | privilege privilege | REVOKE access Revokes access privilege. | privilege |RDAREA usage GRANT RDAREA Grants RDAREA | privilege usage privilege. | REVOKE RDAREA Revokes RDAREA | usage privilege. Memory DB table ALLOCATE MEMORY Defines a memory DB definition TABLE table. DEALLOCATE MEMORY Drops a memory DB TABLE table. Comment addition COMMENT Adds a comment to a table or column. ---------------------------------------------------------------------------- Data List creation ASSIGN LIST Creates a list. manipu- Procedure call CALL(#5) Calls a procedure. lation Row deletion DELETE Deletes a row. SQL Dropping list DROP LIST Drops a list. Inserting row INSERT Inserts a row. Deleting all rows PURGE TABLE Deletes all rows. TRUNCATE TABLE Deletes all rows. Retrieval SELECT(#6) Retrieves table data. Updating row UPDATE Updates table data. ---------------------------------------------------------------------------- Control Transaction COMMIT Terminates a transaction. SQL termination Table lock LOCK Locks a table. Transaction ROLLBACK Rolls back a transaction. rollback User change SET SESSION Changes the connected user. AUTHORIZATION(#7) ---------------------------------------------------------------------------- Others Getting diagnostic GET DIAGNOSTICS(#8) Gets diagnostic information. information Running command/ CALL COMMAND(#9) Executes the command/utility. utility execution ---------------------------------------------------------------------------- #1: When specifying CREATE [PUBLIC] PROCEDURE, add END_PROC to the end of a line. (Example) CREATE PROCEDURE P1() BEGIN INSERT INTO T1 (C1) VALUES(10) ; UPDATE T1 SET C1 = 0 WHERE C1 < 10 ; END END_PROC; #2: When specifying CREATE [PUBLIC] FUNCTION, add END_FUNC to the end of a line. (Example) CREATE FUNCTION FUNC1( NUM1 INTEGER,NUM2 INTEGER ) RETURNS INTEGER BEGIN DECLARE SUM1 INTEGER; SET SUM1 = NUM1 + NUM2; RETURN SUM1; END END_FUNC; #3: When specifying CREATE TYPE, add END_TYPE to the end of a line. (Example) CREATE TYPE TEL( NAME VARCHAR(15),TEL_NO INTEGER ) END_TYPE; #4: When specifying CREATE TRIGGER, add END_TRIG to the end of a line. (Example) CREATE TRIGGER TRIG1 AFTER INSERT ON T0 FOR EACH ROW INSERT INTO T1 VALUES(10, 'ABC') END_TRIG; #5: If the argument of Procedure called by the CALL statement is an input parameter, you can specify a value expression or "?". If the argument of Procedure is an output parameter or input/output parameter, specify "?" in the argument. If "? Parameter Input Dialog" is displayed for the input or input/output parameter after you have entered the CALL statement, specify the corresponding value. When the executed CALL statement terminates normally after you have entered the corresponding value in "? Parameter Input Dialog", the result of the output or input/output parameter is displayed. If the CALL statement terminates with the cursor for the results-set being opened in Procedure, the contents of the results-set are displayed. (Example) Procedure: CREATE PROCEDURE ORDERED_EMPS(IN REGION INTEGER,OUT CNT INTEGER) DYNAMIC RESULT SETS 2 BEGIN DECLARE CUR1 CURSOR WITH RETURN FOR SELECT id_no, name FROM emps_1 WHERE id_no < REGION ORDER BY id_no; DECLARE CUR2 CURSOR WITH RETURN FOR SELECT id_no, name FROM emps_2 WHERE id_no < REGION ORDER BY id_no; OPEN CUR1; OPEN CUR2; SET CNT = 2; END END_PROC; CALL Statement: call ORDERED_EMPS(?,?); DATA ( 1) ? : INTEGER : VALUE(NULL) ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+ 6000; CNT ------------ 2 KFPA12120-I Processing of SQL completed, dynamic result set returned ID_NO NAME ------------ -------------------------------- 3201 Mishima 4001 Shimizu 4201 Yoshida 4501 Iwata 5301 Kawasaki 5401 Matsuda KFPA12121-I Processing of SQL completed, additional result set returned ID_NO NAME ------------ -------------------------------- 1301 Ibaragi 1901 Kagawa 2501 Matsue KFPA12100-I No rows satisfying search condition #6: Only dynamic SELECT statements can be specified. The cursor cannot be specified. #7: Specify a authorization-identifier in place of a embedded variable 1 in SET SESSION AUTHORIZATION statement. Specify a password in place of a embedded variable 2 in SET SESSION AUTHORIZATION statement. (Example) SET SESSION AUTHORIZATION USER0001 IDENTIFIED BY PASS0002; #8: Specify a "?" in place of a embedded variable in GET DIAGNOSTICS statement. (Example) GET DIAGNOSTICS ?=NUMBER; Specify a "?" in place of a condition number in GET DIAGNOSTICS statement. This program ask you to enter values of the condition number(1,2...) corresponding to the "?" after the GET DIAGNOSTICS statement is issued. (Example) GET DIAGNOSTICS EXCEPTION ? ?=RETURNED_SQLCODE; Condition details that can be specified in the GET DIAGNOSTICS statement are displayed. If other condition details are specified, SQL Executer returns an error. RETURNED_SQLCODE ERROR_POSITION ERROR_SQL_NO ERROR_SQL ROUTINE_TYPE ROUTINE_SCHEMA ROUTINE_NAME TRIGGER_SCHEMA TRIGGER_NAME CONSTRAINT_SCHEMA CONSTRAINT_NAME MESSAGE_TEXT QUERY_NAME CONDITION_IDENTIFIER #9: If the embedded variable when using the CALL COMMAND statement is an input parameter, you can specify a value expression or ?. If the embedded variable is an output parameter, specify ?. Clauses where the embedded variable is an input parameter: - CALL COMMAND - WITH - INPUT - ENVIRONMENT - SERVER Clauses where the embedded variable is an output parameter: - OUTPUT TO - ERROR TO - RETURN CODE TO After executing the CALL COMMAND statement, response requests are made for the number of input parameters to which ? was specified. Therefore, you must specify a value that satisfies the response requests. After responding to all the input requests, output parameter results are displayed when the CALL COMMAND statement is executed and ends normally. Note that the data type returned by the OUTPUT TO or ERROR TO clause is BLOB(2G). Therefore, we recommend that you use the SET BLOB LIMIT command to change the maximum length to an appropriate value and then execute the statement. (b) Specifying the end of a SQL statement Each SQL statement requires a semicolon (;) at the end of the line. If a semicolon is missing from the end of the line, the line is assumed to continue to the next line. (Example) CREATE TABLE T1(C1 INT, (continue) C2 CHAR(10), (continue) C3 CHAR(10)); (end of SQL statement) When the PDSQL_EXEC_SEMICOLON_ENTER environment variable is set to 2, even if an enclosed annotations exists between a semicolon (;) and the end of the line, the setting is treated as an end specification. In such a case, processing is performed by considering the portion before the semicolon as the SQL statement or the epdsql command line. For an operational example, see the PDSQL_EXEC_SEMICOLON_ENTER environment variable. However, when specifying CREATE [PUBLIC] PROCEDURE, add END_PROC to the end of a line, when specifying CREATE [PUBLIC] FUNCTION, add END_FUNC to the end of a line, when specifying CREATE TYPE, add END_TYPE to the end of a line, when specifying CREATE TRIGGER, add END_TRIG to the end of a line. In these cases, even if a semicolon is specified at the end of the line, the line is assumed to continue to the next line. (Example) CREATE PROCEDURE P1() (continue) BEGIN (continue) INSERT INTO T1 (C1) VALUES(10) ; (continue) UPDATE T1 SET C1 = 0 WHERE C1 < 10 ; (continue) END (continue) END_PROC ; (end of SQL statement) The semicolon, END_PROC;, END_FUNC;, END_TYPE; or END_TRIG; written at the end of a line is assumed to be the end of the SQL statement even if the semicolon, END_PROC;, END_FUNC;, END_TYPE; or END_TRIG; is enclosed in double quotation marks (") in the SQL statement. If all the conditions below are met, the end specification of the SQL statement is unavailable. In such a case, forcibly terminate the HiRDB SQL Executer. (i) On the connected server, 'Y' is specified for the pd_sql_simple_comment_use system definition. (ii) The line-feed deletion setting is ON. This setting can be made by using the PDSQL_REMOVE_LINEFEED_CHARACTER environment variable or the SET REMOVE LINEFEED CHARACTER command. In the simplified GUI version, when data is entered from the SQL input screen, the line-feed deletion setting is always ON. (iii) The SQL statement includes two hyphens (--). The length of each line must be less than or equal to 65530 characters. ( 8 ) pdsql commands After starting this program, you can enter not only SQL statements but also pdsql commands that simplify input and execution of SQL statements and specify an execution result format. Table 8-1 displays pdsql commands that can be executed by this program. Table 8-1 : pdsql commands that can be executed by this program. No. pdsql command Outline of function -----+------------------------+--------------------------------------- 1 BLOCK/ITERATE Iterates a command 2 CHANGE Changes a character string 3 COLUMNS(#1) Displays table columns 4 CONNECT Connects HiRDB SQL Executer to HiRDB 5 CONSTRAINTS(#1) Lists the constraint names defined by the specified authorization identifier 6 DESCRIPTORS(#1) Displays abstract data type attributes 7 DISCONNECT Disconnects HiRDB SQL Executer from HiRDB 8 EXIT Exit HiRDB SQL Executer 9 FILES(#1) Displays RDAREA file information 10 GETFILE Input parameters from a file 11 HELP Displays Help. 12 INDEXCLM(#1) Displays index columns 13 INDEXES(#1) Displays indexes 14 ITERATE Terminates command iteration 15 LOBS(#1) Displays LOB RDAREA 16 PRPARAMS(#1) Displays parameters 17 PUTFILE Outputs the results to a file 18 RDAREAINF(#1) Displays RDAREA information 19 RDAREAS(#1) Displays RDAREA 20 REPEAT Executes a SQL repeatedly 21 ROUTINES(#1) Displays routines 22 SEQINF(#1) Displaying ordinal number creator information 23 SEQUENCES(#1) Displaying a list of ordinal number creators 24 SERVERS(#1) Lists the constraint names defined by the specified authorization identifier 25 SET ANALYSIS MODE Execution of only SQL pre-processing 26 SET ARRAY DISPLAY MODE Switches repetition column information 27 SET ARRAY LIMIT Limits the maximum number of elements 28 SET ARRAY NOVALUE Sets display characters for elements that have no repetition column values 29 SET AUTO COMMIT Automatically issues COMMIT 30 SET BINARY LIMIT Limits the BINARY-type length 31 SET BLOB LIMIT Limits the BLOB-type length 32 SET CHAR LIMIT Limits the CHAR-type length 33 SET CLOB LIMIT Limits the length of the CLOB type 34 SET CMDBUF Limits the output length of the server command execution result 35 SET CONVSPACE Converts control character codes to single-byte spaces 36 SET DISPLAY Changes the output format 37 SET DUMPMODE Displays the retrieval result in both the hexadecimal format and character format or only in the character format 38 SET ECHOBACK Echoes back a command 39 SET FETCH ARRAY SIZE Setting of the number of rows to be searched at one FETCH 40 SET FETCH LIMIT Limits the number of the rows to be retrieved 41 SET NCHAR LIMIT Limits the NCHAR-type output length 42 SET NULL CHARACTER Sets the display character for the null value 43 SET PADDING CHAR Changes padding characters 44 SET REMOVE LINEFEED Deletion of linefeed character CHARACTER 45 SET RESULT FILEOUT Outputs the execution result both to the screen and a file 46 SET SPLIT SIZE Specify the split acquisition size of the BINARY/BLOB/CLOB type in kilobytes 47 SET TBLMODE Displays a table format 48 SET WHENEVER Exception control specification 49 SINGLE ROW Single-row SELECT statement 50 SOURCE(#1) Displays the definition source 51 STATUS Displays the operating status 52 TABLEINF(#1) Displays table information 53 TABLES(#1) Displays a table list 54 TRIGGERS(#1) Displays a trigger list 55 TYPES(#1) Displays an abstract data type 56 USERS(#1) Displays a user list 57 < Enters the SQL and pdsql commands from a file 58 > Outputs to a file 59 /* Comment line 60 ! Executes a DOS command 61 : Executes a server command -----+------------------------+--------------------------------------- #1: This is a dictionary display command. The dictionary display commands internally issue one or more SQLs and display dictionary information. The following dictionary display commands only issue one SQL: CONSTRAINTS, DESCRIPTORS, FILES, INDEXCLM, INDEXES, LOBS, PRPARAMS, RDAREAS, ROUTINES, SEQUENCES, SERVERS, TABLES, TRIGGERS, TYPES, USERS You can use these commands together with other commands, such as SET CHAR LIMIT. For details on each command, see "Appendix A. pdsql command detail". Some limitations are applied to the XDM/RD E2 connection. For more details, see also "Appendix E. XDM/RD E2 Connection". When SQL reserved word deletion function is used, there is a command not to be able to execute the function. Refer to "Appendix G. Effect of The SQL Reserved Word Deletion Function" together. ( 9 ) Return values (return codes) When this program ends, the return code shown in Table 9-1 is returned. Table 9-1 : Return values Return value Description ------------------+-------------------------------------------------- 0 No error has occurred. 4 Only one or more HiRDB SQL Executer errors (KFPX27 and later) occurred. 8 Only one or more HiRDB access errors (KFPA and later) occurred. 12 One or more HiRDB SQL Executer errors (KFPX27 and later) and one or more HiRDB access errors (KFPA and later) occurred. -32768 through -1 When the program ends due to the exception control specification (When an integer constant is specified in the EXIT phrase) -1999 through 3999 When the program ends due to the exception control specification (When SQLCODE is specified in the EXIT phrase) ------------------+-------------------------------------------------- ( 10 ) Rules (a) This program can be executed only when HiRDB is running. (b) To output the execution result of this program to a file, redirect the output destination of the standard output to the file. (Example) pdsql > outfile To output only the retrieval result to the file, use the PUTFILE command. (c) SQL lowercase characters are converted to uppercase characters. When using lowercase characters, enclose them in double quotation marks ("). (Example) INSERT INTO "t1" VALUES(1000); (d) The maximum length of the SQL statement that can be executed is 2000000 bytes (It is 2000000 characters for the Unicode version). (e) The display result of one line or the file output result cannot be retrieved beyond 2097152 bytes. (f) The semicolon, END_PROC;, END_FUNC;, END_TYPE; or END_TRIG; written at the end of a line is assumed to be the end of the SQL statement even if the semicolon, END_PROC;, END_FUNC;, END_TYPE; or END_TRIG; is enclosed in double quotation marks (") in the SQL statement. (g) If a file/directory name contains symbols other than backslash (\) or space characters, enclose it in double quotation marks ("). (h) Processing of the enclosed annotations in the SQL statement depends on the version of the server to be connected. - When the server version is 06-01 or earlier The enclosed annotations is replaced by one space and the SQL statement is sent to the server side. If no enclosed annotations end symbol exists in the line, the entire line is replaced as the enclosed annotations. - When the server version is 06-02 or later The SQL statement is sent to the server side without the enclosed annotations edited. (i) The interpretation of "--" in the SQL statement depends on the system definition of the server to be connected. - If the system definition pd_sql_simple_comment_use is set to "Y", it is interpreted as a simple annotation. Even if there is a semicolon between a simple annotation and a line feed (NL (X'0a')), it is not interpreted as the end of the SQL statement. If the facility for deleting new line characters is enabled, all line feeds (NL (X'0a') and CR (X'0d')) are deleted before execution. Accordingly, all entries after a simple annotation are interpreted as annotations. Likewise, all entries after a simple annotation that are entered in the simple GUI-based SQL entry window are interpreted as annotations. - If the system definition pd_sql_simple_comment_use is not set or not set to "Y", it is interpreted as an operator. A semicolon (;) that is not enclosed with quotation marks (' or ") is interpreted as the end of the SQL statement. (j) You cannot enter enclosed annotations (/* - */) or simple annotations (--) in the following locations. (i) In a pdsql command (#1) (ii) Between CREATE and PROCEDURE in CREATE [PUBLIC] PROCEDURE (iii) Between CREATE and FUNCTION in CREATE [PUBLIC] FUNCTION (iv) Between CREATE and TYPE in CREATE TYPE (v) Between CREATE and TRIGGER in CREATE TRIGGER (vi) In the same row as END_PROC;, END_FUNC;, END_TYPE;, or END_TRIG; #1: You can enter enclosed annotations before a pdsql command (between a line feed (NL (X'0a')) and a pdsql command) or after a pdsql command (between a semicolon and a line feed (NL (X'0a')). Behavior when enclosed or simple annotations are entered: If annotations are entered in location (i), a syntax error may occur. If annotations are entered in either of locations (ii) to (v), the semicolon (;) in the SQL procedure statement is incorrectly interpreted as the end of the SQL statement, and the incorrect SQL statement is sent to the server. If annotations are entered in location (vi), the program waits for the entry of succeeding lines, as the semicolon (;) is not interpreted as the end of the SQL statement. (k) The following characters can be specified as delimiters of SQL statements and pdsql commands. Character SQL statement pdsql command ------------------------+-------------+------------- Space (X'20') Y Y TAB (X'09') Y Y NL (X'0a')(#2) C C CR (X'0d')(#2) C C Enclosed annotation C(#3) N Simple annotation C(#3) N Double-byte space C(#3) N Y: Can be specified C: Can be specified (with conditions) N: Cannot be specified #2: The behavior depends on whether the facility for deleting new line characters is enabled or not. If the facility for deleting new line characters is enabled: All line feeds (NL (X'0a') and CR (X'0d')) in the SQL statement or the pdsql command are deleted before execution. Accordingly, they are not interpreted as delimiters. However, the new line character immediately before END_PROC;, END_FUNC;, END_TYPE;, or END_TRIG; is interpreted as a delimiter. If the facility for deleting new line characters is disabled: New line characters are interpreted as delimiters. #3: You cannot enter enclosed annotations, simple annotations, and double-byte spaces as delimiters in the following locations. - Between CREATE and PROCEDURE in CREATE [PUBLIC] PROCEDURE - Between CREATE and FUNCTION in CREATE [PUBLIC] FUNCTION - Between CREATE and TYPE in CREATE TYPE - Between CREATE and TRIGGER in CREATE TRIGGER - In the same row as END_PROC;, END_FUNC;, END_TYPE;, or END_TRIG; (l) The following symbols (single-byte character codes) in a pdsql command(#4) are interpreted as one meaningful phrase regardless of delimiters appearing before or after the symbols. Comma (,) Period (.) Hyphen or minus sign (-) Plus sign (+) Asterisk (*) Single quotation mark (') Double quotation mark (") Left parenthesis (( ) Right parenthesis ( )) Less than sign (<) Greater than sign (>) Equals sign (=) Circumflex (^) Exclamation mark (!) Forward slash (/) Question mark (?) Colon (:) Semicolon (;) Percent sign (%) Vertical bar (|) Left square bracket ([) Right square bracket (]) Back apostrophe (`) Left big parenthesis ({) Right big parenthesis (}) Dollar ($) To specify options, you need to enter the delimiters in the defined format. (Example) PUTFILE .... [-q enclosing-character] .... TO .... You must not enter a delimiter between the hyphen and q. You must enter a delimiter between q and the wrap character. You can enter delimiters before the hyphen or after the wrap character. #4: This rule does not apply to the following commands, as the entries before the semicolon at the end are regarded as one operand. - Executing a UNIX command (!) - Executes a server command (:) (m) If there one or more space characters at the beginning or end of the statement, the consecutive space characters are removed. (n) If you use the default null value setting facility when Executer is connected to XDM/RD E2, set the default value of the null value in the DEFAULT NULL VALUE OPTION clause of the XDM/RD E2 RD environment definition statement and at the same time set the PDDFLNVAL=USE environment variable. (o) In case of BINARY/BLOB/CLOB type includes in search result, operate as follows. In SJIS Version SQL Executer, except when the character-code type that HiRDB Server uses is a shift JIS code, the garble and the column gap are generated including characters other than ASCII Code. In Unicode Version SQL Executer, except when the character-code type that HiRDB Server uses is a Unicode(UTF-8), the garble and the column gap are generated including characters other than ASCII Code. Notes on rules: The behavior described below is the same as the previous versions. - If all of the following conditions are satisfied, the error KFPA11106-E occurs when an invalid SQL statement composed only of annotations is executed. Conditions: (i) You enter the SQL statement in the GUI- or simple GUI-based SQL entry window. (ii) You enter a statement composed only of annotations (and the semicolon at the end of the statement), a new line character, and then a statement not including annotations. (iii) You execute the statements. Example: /**/; SELECT COUNT(*) FROM table001; ....An error occurs, as the first row is executed as one SQL statement. - If all of the following conditions are satisfied, an SQL syntax error occurs, as the delimiter at the end of the first statement is ignored and combined with the subsequent statement. Conditions: (i) You enter the SQL statement in the GUI- or simple GUI-based SQL entry window. (ii) The statement does not start with any of the SQL statements or commands in Table 7-1 and Table 8-1, and ends with a semicolon and a new line character. (iii) The subsequent statement is displayed on the screen. (iv) You execute the statements. Example: TRADE T1 TO T2; SELECT COUNT(*) FROM table001; ....A syntax error occurs, as the two rows are executed as one SQL statement. - If all of the following conditions are satisfied, new line characters are deleted even when the facility for deleting new line characters is disabled. Conditions: (i) There is a semicolon before an enclosed annotation to indicate the end of the statement. (ii) There is only one or more space characters between the semicolon indicating the end of the statement and the enclosed annotation. (iii) There is only one or more characters listed below in the enclosed annotation. - Asterisk (*) - Apostrophe (') - Double quotation mark (") - Forward slash (/) - Space - Semicolon (;) (iv) There is only one or more space characters between the enclosed annotation and a new line character. Example: SELECT COUNT(*) FROM table001; /*"'*'"*/ SELECT COUNT(*) FROM table002; .... The new line character between "/*"'*'"*/" and "SELECT." ( 11 ) Troubleshooting When a failure occurs in SQL and in the pdsql commands that issue SQL to obtain information from the HiRDB server, use the HiRDB Client's troubleshooting features to investigate causes of the failure. For more details about the HiRDB Client's troubleshooting features, see UAP Troubleshooting in the HiRDB Manual UAP Developer's Guide. Appendix A. pdsql command detail ---------------------------------------------------------------------- Symbols Meaning ---------------------------------------------------------------------- [ ] The items enclosed by this symbol can be omitted. (Example) REPEAT [repetition-count] repetition-count can be omitted. | The items delimited by this symbol can be selected. { } Specify one of the multiple symbols enclosed by this symbol. (Example) SET AUTO COMMIT {ON | OFF} ON or OFF can be selected. ::= Indicates that the term on the left side of this symbol is defined as the term on the right side. Indicates the default that is assumed by the system when ~~~~~~ the operand is omitted. (Underline) (Example) CHANGE [HOLD | NOHOLD] ~~~~~~ NOHOLD is assumed. ---------------------------------------------------------------------- ---------------------------------------------------------------------- Symbols Meaning ---------------------------------------------------------------------- ~ Those written after this symbol indicate the attributes of a user-specified value. << >> Indicates the value assumed when the user does not specify the appropriate item. < > Indicates the member of a user-specified value. ( ) Indicates the range within which the user can specify a value. ---------------------------------------------------------------------- --------------+------------------------------------------------------- Members Meaning --------------+------------------------------------------------------- Alphabetic Alphabetic (A to Z, a to z) and _ (underscore) character Alphabetic Alphabetic (A to Z, a to z) and symbols (#, @, \) character and symbol Alphanumeric Alphabetic characters and numeric digits (0 to 9) Alphanumeric Alphabetic characters, symbols, and numeric digits (0 to 9) and symbol Unsigned Numeric digits integer Hexadecimal Numeric digits and letters (A to F, a to f) Identifier Alphanumeric string beginning with an alphabetical character (For RDAREA, alphanumeric string includes a space.) Symbol name Alphanumeric symbol string beginning with an alphabetic symbol Character Character string string Path name Symbol names, /, and period (.), '(' and ')' File name File name complying with the OS rules File name "file-name", ""file-name"", "path-name\file-name", ""path-name\file-name"" (If a space, '(', or ')' is included in the file name, describe it enclosed in double quotations " ". --------------+------------------------------------------------------- ---------------------------------------------------------------------- BLOCK / ITERATE ( Iterates SQL or pdsql commands ) ---------------------------------------------------------------------- Function The BLOCK/ITERATE command repeatedly executes the SQL or pdsql command specified between BLOCK and ITERATE. Format 1 : Simple iteration -------------------------------------- BLOCK SQL or pdsql command ITERATE [repetition-count] -------------------------------------- Operands ** repetition-count ~ (1 to 2147483647) <<1>> Specifies the number of times the specified SQL or pdsql command is to be executed. Format 2 : Repetition using a variable -------------------------------------------------------------------------- BLOCK variable-name = initial-value TO end-value [BY incremental-value] [LENGTH length] [HEX] SQL or pdsql command ITERATE -------------------------------------------------------------------------- Operands ** variable-name ~ (1 to 8 characters) Specifies the name used in the specified SQL or pdsql command as a variable. The value of the variable changes within the range from the initial value to the end value. Naming convention: - Must begin with a one-byte alphabetic character. - Must consist of one-byte alphanumeric characters. - Must not exceed 8 bytes. - Must be case-sensitive. - Must differ from a reserved word. ** initial-value ~ (-2147483648 to 2147483647) Specifies the initial value of the variable. ** end-value ~ (-2147483648 to 2147483647) Specifies the end value of the variable. ** incremental-value ~ When the initial value is less than the end value (1 to 2147483647) <<1>> When the initial value is more than the end value (-2147483648 to -1)<<-1>> Specifies the incremental value of the variable. ** length ~ (1 to 255) <> Specify this operand when converting the number of digits of the variable to be replaced. Example: When LENGTH 3 is specified, the variable is replaced as 1->001, 2->002. ** HEX <> Specify this operand when representing the variable to be replaced in hexadecimal notation. Example: The variable is replaced as 11->A, 20->14. Rules (1) It becomes the input wait state of the BLOCK/ITERATE statement when accept the input of the BLOCK statement. In the input wait state of the BLOCK/ITERATE statement, SQL statement or pdsql command is not executed. Please input ITERATE or QUIT to make normal input wait state from the input wait state of the BLOCK/ITERATE statement. (2) In the input wait state of the BLOCK/ITERATE statement, Up to 50 SQL or pdsql command statements can be specified. If input more than 51 statements, KFPX27069-E error is outputted. (3) When accept the input ITERATE, the SQL or pdsql command in the input wait state of the BLOCK/ITERATE statement is execute repeatedly. When input SQL or pdsql commands were more than 51 statements, between 1 and 50 statement is execute repeatedly. After, becomes to normal input wait state. (4) When accept the input QUIT, the SQL or pdsql command in the input wait state of the BLOCK/ITERATE statement is canceled and not executed. Becomes to normal input wait state. (5) When an error except KFPX27069-E occurs in the input wait state of the BLOCK/ITERATE statement, the inputted SQL or pdsql command is canceled and not executed. Becomes to normal input wait state. (6) If the same character string, as variable-name exists in a SQL or pdsql command, it is replaced by the value of the variable. (7) The BLOCK statement cannot be nested (the BLOCK statement cannot be respecified in BLOCK/ITERATE). Notes (1) The number of times the specified SQL or pdsql command is executed is "end value - initial value + 1". (2) Take sufficient care for a variable name in the phrase delimited by a space or symbol because it is replaced. (See Example 2 below.) (3) When appoint the SQL including the ? parameter in the input wait state of the BLOCK/ITERATE statement, ? parameter cannot appoint the data for the parameter just after SQL. Just after ITERATE, please appoint the data of the number of times unit to repeat BLOCK and ITERATE. BLOCK X=1 TO 50; INSERT INTO T1 VALUES(?); ITERATE; 1; 2; 3; : 49; 50; Examples (1) The following example inserts data from 1 to 50 with the INSERT statement. BLOCK X=1 TO 50; INSERT INTO T1 (C1) VALUES(X); ITERATE; The execution result of this example is equivalent to the following execution result: INSERT INTO T1 (C1) VALUES(1) INSERT INTO T1 (C1) VALUES(2) .. INSERT INTO T1 (C1) VALUES(50) (2) The following example deletes T005DATA from table T001DATA. BLOCK AX=1 TO 5 LENGTH 3; DROP TABLE TAXDATA; ITERATE; The execution result of this example is equivalent to the following execution result: DROP TABLE T001DATA; DROP TABLE T002DATA; .. DROP TABLE T005DATA; ---------------------------------------------------------------------- CHANGE ( Changes a character string ) ---------------------------------------------------------------------- Function The CHANGE command changes the character string in the immediately preceding SQL and executes the SQL. Format ---------------------------------------------------------------------- CHANGE character-string-1 character-string-2 [{HOLD | NOHOLD}] ~~~~~~ [{DISPLAY | NODISPLAY}] ~~~~~~~~~ ---------------------------------------------------------------------- Operands ** character-string-1 ~ (1 to 255 characters) Specifies a pre-change character string. ** character-string-2 ~ (1 to 255 characters) Specifies a post-change character string. ** HOLD | NOHOLD HOLD: Does not execute the SQL after the character string is changed. NOHOLD: Executes the SQL after the character string is changed. ** DISPLAY | NODISPLAY DISPLAY: Displays the SQL before and after the character string is changed. NODISPLAY: Does not display the SQL before and after the character string is changed. Notes (1) The SQL length cannot exceed 2 megabytes after the character string is changed. (2) Enclose character-string-1 and character-string-2 in an apostrophe ('). To use an apostrophe as a character, specify two apostrophes continuously. Example: If the character string is A'BC, specify 'A''BC'. (3) Character strings are case-sensitive. Examples Table (T2) is retrieved after table (T1) is retrieved. SELECT * FROM USER1.T1; The following execution result is displayed. CHANGE 'T1' 'T2'; The following SQL is executed. SELECT * FROM USER1.T2; ---------------------------------------------------------------------- COLUMNS ( Displays table columns ) ---------------------------------------------------------------------- Function The COLUMNS command displays specified table columns. Format -------------------------------------------------------------------------- COLUMNS [[RD-node-name [.]] authorization-identifier [.]] table-identifier [+COMMENT][+LIKE] -------------------------------------------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier of the user possessing the table. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** table-identifier ~ (1 to 30 characters) Specifies the table identifier used to display column information. ** [+COMMENT] Outputs the column comment. If this operand is not specified, no column comment is output. ** [+LIKE] Displays a list of columns in partially-matched tables by including special characters in the table identifier,. If multiple tables match, the TABLE_NAME column is output, and the data is sorted in ascending order by using the TABLE_NAME column as the first key and the COLMNN_ID column as the second key. The special characters include the underscore (_) and the percent sign (%), which have the following meanings: _ (underscore) Any one character % (percent sign) A character string of any length (0 or more characters) When using the special character %, enclose the table identifier with quotation marks. If this operand is not specified, a list of the table columns that exactly match the table identifier is displayed. In versions 09-01 or earlier, the list of the columns of partially matched tables is always displayed. Examples The following example displays the columns of table ZAIKO. COLUMNS ZAIKO; Notes (1) When a string that starts with a plus sign (+)is specified as the operand, if the character string following the plus sign is not COMMENT or LIKE, an error occurs. Output contents: # Column name Number of Type Contents characters --+------------+-----------+---------+------------------------------------ 1 COLUMN_ID 9 Numeric Column ID(#1) 2 COLUMN_NAME 30 Character Column name 3 DATA_TYPE 39 Character Data type(#2) 4 DATA_LENGTH 11 Character Data length(#3) 5 MAX_ELM 7 Numeric Number of repetition columns(#4) 6 COMMENT 255 Character Column comment(#5) 7 TABLE_NAME 30 Character Table identifier(#1)(#6) #1: The results are sorted by this row in ascending order. #2: If the data type is abstract data type, the data type identifier is displayed. #3: If the data type is abstract data type, the data length is not displayed. #4: The number of repetition columns is displayed only in HiRDB Version 5.0 05-03 or later. #5: Output when the +COMMENT option is specified. #6: Output when the +LIKE option is specified and multiple tables are matched. ---------------------------------------------------------------------- CONNECT ( Connects HiRDB SQL Executer to HiRDB ) ---------------------------------------------------------------------- Function The CONNECT command connects HiRDB SQL Executer to HiRDB. Format ------------------------------------------------------------------------- CONNECT [authorization-identifier [/password] [host-name/port-number]] ------------------------------------------------------------------------- Operands ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier used to connect HiRDB SQL Executer to HiRDB. ** password ~ (1 to 30 characters) Specifies the password corresponding to the authorization identifier. ** host-name ~ (1 to 255 characters) Specifies the host name of the HiRDB system to be connected. ** port-number ~ (1 to 2147483647) Specifies the port number of the HiRDB system to be connected. Notes (1) If the operands are omitted, the CONNECT window appears after the CONNECT command has been entered. The authorization identifier and password to be entered are converted to upper case. When using lower case, enclose it in double quotation marks ("). (2) To connect HiRDB SQL Executer to HiRDB with another authorization identifier after the entering the CONNECT command, DISCONNECT it from HiRDB once with the DISCONNECT command and then specify the CONNECT command. (3) If password is omitted, HiRDB SQL Executer is connected to HiRDB on the assumption that no password is specified. Reference DISCONNECT ---------------------------------------------------------------------- CONSTRAINTS ---------------------------------------------------------------------- Function The CONSTRAINTS command lists the constraint names defined by the specified authorization identifier. Format -------------------------------------------------------------- CONSTRAINTS [ { authorization-identifier | ALL } ] -------------------------------------------------------------- Operands ** authorization-identifier ~ (1 to 8 characters) Specify the authorization identifier of the user who defines constraint names. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** ALL Displays all the defined constraints. Output contents: # Column name Number of Type Contents characters --+---------------+-----------+---------+--------------------------------- 1 CONSTRAINT_NAME 39 Character Constraint name(#1)(#2) 2 TABLE_NAME 30 Character The table name of the table where the constraint name is defined 3 TYPE 4 Character Constraint type #1: The results are sorted by this row in ascending order. #2: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 61. ---------------------------------------------------------------------- DESCRIPTORS ( Displays abstract data type attributes ) ---------------------------------------------------------------------- Function The DESCRIPTORS command displays abstract data type attributes. Format ------------------------------------------------------------------ DESCRIPTORS [[RD-node-name [.]] authorization-identifier [.]] abstract-data-type-identifier or DESCS ------------------------------------------------------------------ Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier of the user possessing the table. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** abstract-data-type-identifier ~ (1 to 30 characters) Specifies the abstract data type identifier used to display attribute information. Notes (1) This command can be used only in HiRDB Version 5.0 or later. Output contents: # Column name Number of Type Contents characters --+------------+-----------+---------+------------------------------------ 1 POSITION 8 Numeric Attribute ID(#1) 2 OBJECT_NAME 30 Character Attribute name 3 DATA_TYPE 39 Character Data type(#2)(#3) 4 DATA_LENGTH 11 Character Data length(#4) #1: The results are sorted by this row in ascending order. #2: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 61. #3: If the data type is abstract data type, the data type identifier is displayed. #4: If the data type is abstract data type, the data length is not displayed. ---------------------------------------------------------------------- DISCONNECT ( DISCONNECTs HiRDB SQL Executer from HiRDB ) ---------------------------------------------------------------------- Function The DISCONNECT command DISCONNECTs HiRDB SQL Executer from HiRDB after COMMIT has been issued. Format -------------------------------------- DISCONNECT -------------------------------------- Notes (1) This program does not terminate even if it is DISCONNECTed by the DISCONNECT command. To reconnect this program to HiRDB, execute the CONNECT command. To exit this program, execute the EXIT command. (2) The DISCONNECT command issues COMMIT before DISCONNECTing HiRDB SQL Executer from HiRDB. For this reason, to roll back a transaction, you must issue ROLLBACK in advance. Reference CONNECT , EXIT ---------------------------------------------------------------------- EXIT ( Exit HiRDB SQL Executer ) ---------------------------------------------------------------------- Function Exit this program after issuing COMMIT and DISCONNECT. Format -------------------------------------- EXIT -------------------------------------- Notes (1) The EXIT command issues COMMIT and DISCONNECT before exiting this program. For this reason, to roll back a transaction, you must issue ROLLBACK in advance. (2) If you enter the EXIT command when this program dose not connect to a HiRDB, EXIT command only exit this program. Reference DISCONNECT ---------------------------------------------------------------------- FILES ( Displays RDAREA file information ) ---------------------------------------------------------------------- Function The FILES command displays RDAREA structure files. Format ---------------------------------------------------------------------- FILES [[RD-node-name [.]] {RD-area-name | ALL}] ---------------------------------------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** RD-area-name ~ (1 to 30 characters) Specifies the name of the RD area where structure files are to be displayed. ** ALL Displays all the defined structure files. Examples The following example displays the structure files of RDAREA PDBUSER01. FILES PDBUSER01; Output contents: # Column name Number of Type Contents characters --+------------------+-----------+---------+------------------------------ 1 RDAREA_ID 12 Character RDAREA ID(#1) 2 RDAREA_NAME 30 Character RDAREA name 3 SERVER 8 Character Server name 4 PHYSICAL_FILE_ID 16 Character File ID(#1) 5 PHYSICAL_FILE_NAME 167 Character File name 6 INITIAL_SIZE 12 Character Number of initially allocated segments #1: The results are sorted by the following rows. - RDAREA_ID (ascending order) - PHYSICAL_FILE_ID (ascending order) ---------------------------------------------------------------------- GETFILE ( Input parameters from a file ) ---------------------------------------------------------------------- Function GETFILE command gets data corresponding to the ? parameter specified in the SQL statement from a file. Format ---------------------------------------------------------------------- GETFILE [COMMIT commit-interval] [-k LOB-file-type [source-directory]] [-mf file-name-for-the-message-output-location]] [-int] [-errstop] FROM input-data-file-name SQL-statement ---------------------------------------------------------------------- Operands ** COMMIT commit-interval - (0-2147483647) Specify the interval at which COMMIT should be issued with a numeric value. If a value other than 0 is specified, COMMIT is issued when the end of file is reached regardless of the AUTO COMMIT mode. If 0 is specified, COMMIT is not issued until the end of file is reached. Whether or not to issue COMMIT when the end of file is reached depends on the AUTO COMMIT mode. If this operand is omitted, 0 is assumed. ** [-k LOB-file-type [source-directory]] When inputting column data of the BLOB/CLOB data column, you must specify the file type and source directory. LOB-file-type: f f: Reads data from files that have been created for each item of LOB data. source-directory: Specify a directory that contains an LOB data file. If a relative path is specified for an LOB data file, the directory is referenced. If the path is omitted, the same location as the input data file is assumed. ** [-mf file-name-for-the-message-output-location] Specify the file name of the file to which the message is output. If the file name contains non-existent path, an error will occur when the message is output. If a file already exists, the message is added to that file. If the specified file name is same as the input data file name, an error occurs. If this operand is specified, the message is output to both the window and file. ** [-int] If the input data is a decimal point value for a column of INTEGER/SMALLINT data, the value after the decimal point will be truncated. If this operand is not specified, the operation is assumed to be an invalid data input error. ** [-errstop] If an invalid input data error or SQL execution error occurs, processing will be suspended. If this operand is not specified, input data will continue processing until the end, even if an error occurs. ** input-data-file-name ~ Specifies the name of the file in which the data corresponding to the ? parameter is to be stored. ** SQL-statement - The following SQL statements can be specified. - INSERT statement - DELETE statement - UPDATE statement - Specify ? parameters corresponding to the columns to which the data is inputted from the file. - For details on ? parameter, see "Appendix C. Data input using ? parameter" and "Appendix D. "*" input rules". - For information about SQL syntax, see the manual HiRDB SQL Reference. Notes (1) If the number of ? parameters dose not correspond the number of columns in the file, an error occurs and the next row is processed. (2) 8-00 and later versions support large files exceeding 2GB. This enables input from an input file even if its size is larger than 2GB. (3) The maximum allowed length for GETFILE command is the length specified by an environment variable PDSQLBLOBLIMIT, PDSQLBINARYLIMIT or PDSQLCLOBLIMIT, or a pdsql command SET ARRAY LIMIT, SET BINARY LIMIT, SET BLOB LIMIT, SET CLOB LIMIT, SET CHAR LIMIT, SET FETCH LIMIT or SET NCHAR LIMIT. (If data exceeding the maximum allowed length is entered, message:KFPX27059-E is output.) Restrictions (1) "FILE file-name" value input formats for the ? parameter cannot be used. For details on "FILE file-name", see "Appendix C. Data input using ? parameter" (2) Do not include non-printable characters (ASCII code 0x00-0x1F such as a null character) in the data. Input formats - Put data corresponding to the ? parameters into a row of the file. (Add a line feed character to the end of each line). - Put a comma(,) between two columns data as column delimiter. - One row consists of up to 2,097,152 bytes. Table A-6 : Data input format for each data type Data type Column data input format(See #1) ---------------+------------------------------------------------------- INTERVAL YEAR - Specify in numeric value [-]yyyymmddhhmmss.[nnnnnn] format. TO SECOND - For minus, attach a symbol "-". INTERVAL YEAR - Specify in numeric value [-]yyyymmdd. format. TO DAY - For minus, attach a symbol "-". INTERVAL HOUR - Specify in numeric value [-]hhmmss.[nnnnnn] format. TO SECOND - For minus, attach a symbol "-". DATE - Specify in character string "yyyy-mm-dd" format. TIME - Specify in character string "hh:mm:ss[.nnnnnn]" format. TIMESTAMP - Specify in character string "yyyy-mm-dd hh:mm:ss[.nnnnnn]" format. BINARY and - Specify a character enclosed with double quotations (") MVARCHAR and - To include double quotations in the data, MCHAR and describe two consecutive double quotations. NVARCHAR and NCHAR and VARCHAR and CHARACTER FLOAT and - Specify a numeric value with characters SMALLFLT and - For minus, attach a symbol "-". DECIMAL and - Specify a decimal number in "integer.decimal" format. INTEGER and - Specify a floating point number in SMALLINT "mantissa + 'e' + exponent" format. BLOB and (#3) CLOB #1: When inputting a null value for a data type, the character string NULL, an asterisk, or a space can be specified. If an asterisk or space is specified, one of the values described in Appendix D# input rule will be stored. #3: Depending on whether the -k option is specified, the data input will differ: When -k option is not specified: A value for the column data will be specified as the value for the ? parameter. When the -k option is specified: A value stored in the file indicated by the column data will be specified as the value for the ? parameter. Examples CREATE TABLE T1(C1 INT, C2 CHAR(10); GETFILE FROM c:\tmp\data INSERT INTO T1 VALUES(?, ?); Contents of the file c:\tmp\data 1000,"AAAAAAAAAA" 2000,"BBBBBBBBBB" 3000,NULL ---------------------------------------------------------------------- HELP ( Displays Help. ) ---------------------------------------------------------------------- Function HELP command displays Help. Format -------------------------------------------- HELP [ { pdsql-command | pdsql } ] or ? -------------------------------------------- Operands ** pdsql-command ~ (1 to 30 characters) Specify the name of pdsql command whose Help you want to see. ** pdsql If you want to see the description of this program(pdsql), specify "pdsql". Notes (1) If no operand is specified, HELP command displays command list. ---------------------------------------------------------------------- INDEXCLM ( Displays index columns ) ---------------------------------------------------------------------- Function The INDEXCLM command displays columns of the specified index. Format ---------------------------------------------------------------------- INDEXCLM [[RD-node-name [.]] authorization-identifier [.]] index-identifier ---------------------------------------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier of the user possessing the specified index. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** index-identifier ~ (1 to 30 characters) - Specifies the index identifier used to display column information. - If the index is a cluster key, enclose it in a double quotation mark ("). Example: INDEXCLM "(CLUSTER0000131196)"; Examples The following example displays columns of index I1. INDEXCLM I1; Output contents: # Column name Number of Type Contents characters --+----------------+-----------+---------+-------------------------------- 1 INDEX_ORDER 12 Numeric Order in which indexes are defined(#1) 2 COLUMN_ID 9 Numeric Column ID 3 COLUMN_NAME 30 Character Column name 4 DATA_TYPE 39 Character Data type(#2) 5 DATA_LENGTH 11 Character Data length 6 MAX_ELM 7 Numeric Number of repetition columns(#3) 7 ASC_DESC 8 Character ASC/DESC #1: The results are sorted by this row in ascending order. #2: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 61. #3: The number of repetition columns is displayed only in HiRDB Version 5.0 05-03 or later. ---------------------------------------------------------------------- INDEXES ( Displays indexes ) ---------------------------------------------------------------------- Function The INDEXES command displays the indexes of the user possessing the specified authorization identifier. Format ---------------------------------------------------------------------- INDEXES [[RD-node-name [.]] {authorization-identifier | ALL}] ---------------------------------------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier of the user possessing the indexes. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** ALL Displays all the defined indexes. Examples The following example displays the indexes of the user whose authorization identifier is USER1. INDEXES USER1; Notes (1) The number of repetition columns is displayed only in HiRDB Version 5.0 05-03 or later. Output contents: # Column name Number of Type Contents characters --+------------+-----------+---------+------------------------------------ 1 INDEX_NAME 39 Character Index name(#1)(#2) 2 INDEX_ID 12 Numeric Index ID 3 TABLE_NAME 30 Character Table identifier 4 UNIQUE_TYPE 11 Character Unique type 5 ARRAY 5 Character Repetition column (M)(#3) 6 COLUMN 6 Numeric Number of index structure columns #1: The results are sorted by this row in ascending order. #2: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 61. #3: The number of repetition columns is displayed only in HiRDB Version 5.0 05-03 or later. ---------------------------------------------------------------------- ITERATE ( Terminates command iteration ) ---------------------------------------------------------------------- Function The ITERATE command terminates SQL or pdsql command specification between BLOCK and ITERATE. Reference For details on this command, see BLOCK. -------------------------------------------------------------------------- LOBS ( Displays LOB RDAREA ) -------------------------------------------------------------------------- Function The LOBS command displays LOB RDAREA. Format -------------------------------------- LOBS [RD-node-name] -------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. Output contents: # Column name Number of Type Contents characters --+------------+-----------+---------+------------------------------------ 1 RDAREA_NAME 30 Character RDAREA name(#1) 2 COLUMN_NAME 70 Character Column name(#2) 3 DIV_NO 6 Numeric Order in which partitioning conditions are specified 4 DATA_LENGTH 11 Character Data length #1: The results are sorted by this row in ascending order. #2: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 92. ---------------------------------------------------------------------- PRPARAMS ( Displays parameters ) ---------------------------------------------------------------------- Function The PRPARAMS command displays parameters for the specified procedure. Format ---------------------------------------------------------------------- PRPARAMS [[RD-node-name [.]] authorization-identifier [.]] procedure-name ---------------------------------------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier of the user possessing the specified procedure. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** procedure-name ~ (1 to 30 characters) Specifies the procedure name used to display parameter information. Examples The following example displays parameters for procedure P1. PRPARAMS P1; Output contents: # Column name Number of Type Contents characters --+--------------+-----------+---------+---------------------------------- 1 NO 6 Numeric Order in which parameters are specified(#1) 2 MODE 5 Character Parameter I/O mode 3 PARAMETER_NAME 30 Character Parameter name 4 DATA_TYPE 24 Character Data type 5 DATA_LENGTH 11 Character Data length #1: The results are sorted by this row in ascending order. ---------------------------------------------------------------------- PUTFILE ( Outputs the results to a file ) ---------------------------------------------------------------------- Function The PUTFILE command outputs the retrieval result to a file. - DAT format for pdload - Extend DAT format for pdload - Binary format for pdload - Fixed-size data format for pdload Format ---------------------------------------------------------------------- PUTFILE [ADD][COL_NAME] [{DAT | EXTDAT | BINARY | FIX | SEPARATOR_TAB | BIN_PDRORG}] [QUOT_OFF] [{LF | CRLF}][SUP] [DATE_TO_CHAR] [TIME_TO_CHAR] [TIMESTAMP_TO_CHAR] [-q enclosing-character] [-k LOB-file-type [storage-directory]] [-s separator-character] [-m message-output-interval] [-mf message-output-file-name] TO file-name SELECT-statement ---------------------------------------------------------------------- Operands ** ADD If the specified file already exists, data is added to the file. The format check for the existing file is not performed. If the specified file already exists and this operand is not specified, the file is overwritten (the existing information is erased and replaced). ** COL_NAME Outputs the extracted column name to the first row when the retrieval result is output in DAT format or extended DAT format. If this operand is specified when BINARY, FIX, or BIN_PDRORG is specified for the output format, an error occurs. ** {DAT | EXTDAT | BINARY | FIX | SEPARATOR_TAB | BIN_PDRORG} <> - DAT Specify DAT if you want to output the retrieval result in DAT format. (The column delimiter is a comma.) Output files in this format can be used by input data files in DAT format in the database creation utility (pdload). - EXTDAT Specify EXTDAT if you want to output the retrieval result in extended DAT format. (The column delimiter is a comma). Output files in this format can be used by as input data files in extended DAT format in the database creation utility (pdload). - BINARY Specify this operand when you output the retrieval result in the binary format for pdload (for FIX table). The output file in this format can be used as input file in binary format for database load utility(pdload) when the table has FIX attribute. - FIX Specify this operand when you output the retrieval result in the fixed-length data format for pdload. - SEPARATOR_TAB Specify this operand when you output the retrieval result in the DAT format for pdload (column delimiter: Tab). - BIN_PDRORG Specify this operand when you output the retrieval result in the binary format for pdload (for non-FIX table). The output file in this format can be used as input file in binary format for database load utility(pdload) when the table does not have FIX attribute. ** QUOT_OFF Specify QUOT_OFF if you do not want the output data to be enclosed in double quotations when the retrieval result is output in DAT or extended DAT format. If this operand is specified when BINARY, FIX, or BIN_PDRORG is specified for the output format, an error occurs. The target data types are CHAR/VARCHAR/MCHAR/MVARCHAR/ NCHAR/NVARCHAR/BINARY. If this operand is omitted, data of above data types is output enclosed in double quotations. ** {LF | CRLF} Specify how to output the line feed to indicate the end of each retrieval row when the retrieval result is output in DAT format, extended DAT format or fixed-length data format. If no value is specified, the output will differ by platform. Windows, Windows IPF : <> Other : <> If this operand is specified when BINARY or BIN_PDRORG is specified for the output format, an error occurs. LF : Outputs 0x0A as line feed code. CRLF : Outputs 0x0D and 0x0A as line feed code (carriage return and line feed). ** SUP Specify SUP if you do not want consecutive spaces to be output after the column data when the retrieval result (column data of CHAR, NCHAR or MCHAR type) is output in DAT format or extended DAT format. If this operand is specified when BINARY, FIX or BIN_PDRORG is specified for the output format, an error occurs. Using this operand can reduce the amount of output data. Where the meaning of "space" differs depending on the data type: CHAR type, MCHAR type : Single-byte space NCHAR type : Double-byte space Output example: Data type : MCHAR(32) Inserted data : " Naka-Ku Yokohama " When the SUP operand is not specified : " Naka-Ku Yokohama " When the SUP operand is specified : " Naka-Ku Yokohama" ** [DATE_TO_CHAR] [TIME_TO_CHAR] [TIMESTAMP_TO_CHAR] Specify this operand to enclose the output data with double quotations when the retrieval result is output in DAT or extended DAT format. If this operand is specified when BINARY, FIX or BIN_PDRORG is specified for the output format, an error occurs. If DATE_TO_CHAR is specified, the target is DATE type data. If TIME_TO_CHAR is specified, the target data type will be the Time data that was used when connecting HiRDB. If TIMESTAMP_TO_CHAR is specified, the target is TIMESTAMP type data. If this operand is omitted, data of the above data types is output without being enclosed in double quotations. ** [-q enclosing-character] 0 to 9, a to z, A to Z, or 1-byte characters Specify an enclosing character when outputting search results in DAT format or extended DAT format. If this operand is specified when BINARY, FIX, or BIN_PDRORG has been specified as the output format, an error will occur. If this operand is specified when the QUOT_OFF operand has been specified, an error will occur. The enclosing character must be enclosed by single quotation marks ('). If a single quotation mark is specified as the enclosing character, add another single quotation mark. If the backslash mark (\) is specified as the enclosing character, add another backslash mark. If multiple characters are specified as enclosing characters, only the first character will be valid. The latter characters will be disregarded. If a character that is also used as a separator is specified, an error will occur. If nothing is specified, a double quotation mark (") will be assumed. Examples: When a percent sign (%) is specified as the enclosing character: -q '%' When a single quotation mark (') is specified as the enclosing character: -q '''' ** [-k LOB-file-type [storage-directory]] When outputting column data of the BLOB/CLOB data column to a file that is not an output data file, you must specify the format and output location. If this operand is specified when BINARY, FIX, or BIN_PDRORG has been specified as the output format, an error will occur. LOB file-type:{f | c} f: A file is created for each item of LOB data. The file name will made up of the LOB column name and a serial number. c: A file is created containing multiple items of LOB data from the same LOB column. The file name is LOB-column-name. If the LOB column name contains a lower-case character, the column name must be enclosed by parentheses (()). If the same file name already exists, the file will be overwritten. storage-directory: Specify the directory to which the LOB data file is output. If non-existent directory is specified, an error will occur when the file is output. If nothing is specified, the same location as the output data file will be used. ** [-s separator-character] 0 to 9, a to z, A to Z, single-byte characters, or tab When outputting search results in DAT format or extended DAT format, a line separator must be specified. If this operand is specified when BINARY, FIX, or BIN_PDRORG has been specified as the output format, an error will occur. The separator character must be enclosed by single quotation marks ('). If a single quotation mark is specified as the separator character, add another single quotation mark. If the backslash mark (\) is specified as the separator character, add another backslash mark. To specify a tab as the separator character, specify '\t'. If multiple separator characters are specified, only the first character is used as the separator character. The latter characters will be disregarded. If the specified character is same as the enclosing character, an error will occur. If nothing is specified, a comma is assumed. ** [-m message-output-interval] Integer without signs (100 to 100000000) Specify the output interval for historical messages. The output interval is the number of output rows. If nothing is specified, historical messages will not be output. ** [-mf message-output-file-name] Specify a file name to which historical messages are output. If a file name that does not exist is specified, an error will occur when historical messages are output. If a specified file name already exists, the message is added to that file. If this operand is specified when the -m operand has not been specified, an error will occur. If the specified file name is the same as the output data file, an error will occur. If this operand is specified, historical messages are output to both window and file. ** file-name ~ Specifies the name of the file in which the retrieval result is to be stored. If a path name is specified, the retrieval result is output to the specified directory. If no path name is specified, the retrieval result is output to the current directory. ** SELECT-statement For information about the syntax of the SELECT statement, see the manual HiRDB SQL Reference. Notes (1) In 02-04 or later, the program supports large file sizes over 2 GB, enabling retrieval results exceeding 2GB to be output to a file. (2) The PUTFILE command outputs the retrieval results that are limited as specified by the environment variables PDSQLBLOBLIMIT, PDSQLBINARYLIMIT, and PDSQLCLOBLIMIT, and by the pdsql commands SET ARRAY LIMIT, SET BINARY LIMIT, SET BLOB LIMIT, SET CLOB LIMIT, SET CHAR LIMIT, SET FETCH LIMIT, and SET NCHAR LIMIT. Output format Retrieval results including data types not listed below will result in an error. - One row data is output for each retrieved row. (Line feed code is attached to the end of each row.) - Each column data is separated by a column delimiter. - One row consists of up to 2,097,152 bytes. - Data output to a file can be used as input data to pdload. - If the retrieved character data or BINARY type data includes unprintable characters (ASCII code 0x00-0x1F, such as a null character), the output differs depending on the output format. DAT format : Unprintable characters are converted to spaces and output. Extended DAT format: Unprintable characters are output without being converted. - If the retrieved character data or BINARY type data includes a character identical to the enclosing character (double quotation), the output differs depending on the output format: DAT format : The character is output without being converted. Extended DAT format: The character is output twice consecutively. Since the enclosing character does not exist when QUOT_OFF is specified, the characters are output without being converted either in the DAT format and extend DAT format. Output example when QUOT_OFF operand is not specified: Data to store : famous "Suzuki" DAT format : "famous "Suzuki"" Extended DAT format: "famous ""Suzuki""" Table A-1 shows the different formats for data output. Note that if the search results contain a data type that is not listed in the table, an error will occur. Table A-1 : Data output format for each data type Data type Column data output format Null value ---------------+---------------------------------------------------+------ INTERVAL YEAR - Column data is output in the [-]yyyymmddhhmmss. *(#1) [nnnnnn] format (numerical value format). TO SECOND - A minus sign (-) is added to column data. - The fractional part depends on the data definition length. INTERVAL YEAR - Column data is output in the [-]yyyymmdd. format *(#1) (numerical value format). TO DAY - A minus sign (-) is added to column data. INTERVAL HOUR - Column data is output in the [-]hhmmss.[nnnnnn] *(#1) format (numerical value format). TO SECOND - A minus sign (-) is added to column data. - The fractional part depends on the data definition length. DATE - Column data is output in the yyyy-mm-dd format *(#1) (character string format). - If DATE_TO_CHAR operand is specified, data is output enclosed with double quotations. TIME - Column data is output in the hh:mm:ss[.nnnnnn] (#5) format (character string format).(#4) - If TIME_TO_CHAR operand is specified, data is output enclosed with double quotations. - The fractional part depends on the data definition length. TIMESTAMP - Column data is output in the yyyy-mm-dd hh:mm:ss [.nnnnnn] format (character string format). *(#1) - If TIMESTAMP_TO_CHAR operand is specified, data is output enclosed with double quotations. - The fractional part depends on the data definition length. BINARY Column data is output, enclosed in double quotation Not marks (").(#3) output If the byte length is 0, column data is not output. BLOB AND (#6) (#6) CLOB MVARCHAR AND Column data is output, enclosed in double quotation Not marks (").(#3) output MCHAR AND If the byte length is 0, column data is not output. NVARCHAR AND NCHAR AND VARCHAR AND CHAR FLOAT AND - A numerical value is output as a decimal number *(#1) SMALLFLT AND character string. DECIMAL AND - A minus sign (-) is added to column data. INTEGER AND - "Integer.decimal" is output as a decimal point. SMALLINT - The exponent (e) of mantissa is output as a floating point. #1: If ON is set in the PDUAPPTFNULL environment variable, no column data is output. If OFF is set in the PDUAPPTFNULL environment variable, * is output. If the PDUAPPTFNULL environment variable is not set, * is output. #3: If the QUOT_OFF operand is specified, the data is output without enclosed characters. #4: The data output differs by connecting server. When connecting to HiRDB: The data is output without enclosed characters. To output data with enclosing characters, the TIME_TO_CHAR operand must be specified. When connecting to XDM/RD E2: The data is output with enclosed characters. To output data without enclosing characters, specify the QUOT_OFF operand. #5: Depending on the server to which you connect, the null value output will differ. When connecting to HiRDB: See #1). When connecting to XDM/RD E2: Nothing is output. #6: The data output will differ depending on whether the -k option is specified: When the -k option is not specified: - If the data length is 0 bytes, no data is output. - If the data length is at least 1 byte, a null value is output. For details about how null values are output, see #1). When the -k option is specified: - A value other than a null value, a file name of an LOB data file, or a file name of a LOB column data file is output. - If the data is a null value, nothing is output. - The format is for the case where FIX table is unloaded with the pdrorg command. For more details about output formats, see HiRDB Command References. - When you use the database creation utility pdload to load a file that is output in this data format, specify the null value in the null value and function information file for the output value above. Note that, in this case, if real data exists that has the same value as the output value of the null value, the data will also be loaded as the null value. - If ROW is specified as the selection expression in the SELECT statement, binary data is output. When using row data obtained by ROW to migrate data, the endian and character code for the servers must be matched. - Table A-2 indicates the output values for when the data is a null value. Note that if a search result contains a data type that is not listed in the table, an error will occur. Table A-2 : Output value for when the data is a null value (binary (FIX table compatible) format) Data type Output value (when null value) ------------------------+------------------------------------------- INTERVAL YEAR TO SECOND 00000000000000. INTERVAL YEAR TO DAY 00000000. INTERVAL HOUR TO SECOND 000000. DATE 0001-01-01 TIME (#2) TIMESTAMP 0001-01-01 00:00:00 BINARY Data whose length is 0 byte BLOB Data whose length is 0 byte MVARCHAR 1-byte space MCHAR Space NVARCHAR 1-character space NCHAR Space VARCHAR 1-byte space CHAR Space FLOAT 0 SMALLFLT 0 DECIMAL 0 INTEGER 0 SMALLINT 0 #2: Depending on the server to which you connect, output value will differ. When connecting to HiRDB: 00:00:00 When connecting to XDM/RD E2: - 8 bytes of empty space (If a digit grouping separator is included, 9 bytes and the separator) - This format is the format in which the database reorganization utility (pdrorg) unloads a non-FIX table. For more details about output formats, see HiRDB Command References. - You cannot use the database creation utility pdload to load the data of the file that is output using this data format into the FIX table. - Data is output for each of retrieved lines (a line feed character is added to the end of each line). - There is no space between column data and column data. - One line cannot exceed 2,097,152 bytes. - Data output to files can be used as input data for pdload. - If ROW is specified as the selection expression in the SELECT statement, data is output as character data (CHAR type). When using row data obtained by ROW to migrate data, the endian and character code for the servers must be matched. Table A-3 indicates the output area size, and Table A-4 lists output data formats. Note that if a search result contains a data type that is not listed in the table, an error will occur. Table A-3 : Output area length (Fixed-length data format) Data type Output area length[bytes] ------------------------+------------------------------------------- INTERVAL YEAR TO SECOND 16+scale INTERVAL YEAR TO DAY 10 INTERVAL HOUR TO SECOND 8+scale DATE 10 TIME 8(If the scale greater than 0, 9+scale) TIMESTAMP 19(If the scale greater than 0, 20+scale) BINARY Maximum number of stored bytes.(#2) BLOB Maximum number of stored bytes.(#2) MVARCHAR Maximum number of stored bytes.(#2) MCHAR Number of stored bytes.(#2) NVARCHAR Maximum number of stored characters.*2(#2) NCHAR Number of stored characters.*2(#2) VARCHAR Maximum number of stored bytes.(#2) CHAR Number of stored bytes.(#2) FLOAT 23 SMALLFLT 23 DECIMAL precision+2 INTEGER 11 SMALLINT 6 #2: To reduce the size, use the SET xxxx LIMIT command. Table A-4 : Output data format (Fixed-length data format) Data type Data output format(#1) ---------------+----------------------------------------------------------- INTERVAL YEAR - Column data is output in the [-]yyyymmddhhmmss.[nnnnnn] format. TO SECOND - A minus sign (-) is added to column data. - The fractional part depends on the data definition length. INTERVAL YEAR - Column data is output in the [-]yyyymmdd. format. TO DAY - A minus sign (-) is added to column data. INTERVAL HOUR - Column data is output in the [-]hhmmss.[nnnnnn] format. TO SECOND - A minus sign (-) is added to column data. - The fractional part depends on the data definition length. DATE Column data is output in the yyyy-mm-dd format. TIME - Column data is output in the hh:mm:ss[.nnnnnn] format. - The fractional part depends on the data definition length. TIMESTAMP - Column data is output in the yyyy-mm-dd hh:mm:ss[.nnnnnn] format. - The fractional part depends on the data definition length. BINARY AND - Data is output in character format. BLOB - Undisplayable characters (e.g., null characters (ASCII codes 0x00 to 0x1F)) in retrieved character data are converted to a colon (:) and output. MVARCHAR AND - If column data is a variable-length character string shorter than the defined length, it is padded with space characters (0x20) by the defined length. MCHAR AND NVARCHAR AND NCHAR AND VARCHAR AND CHAR FLOAT AND - A right-align numerical value is output as a decimal SMALLFLT AND number character string. DECIMAL AND - A minus sign (-) is added to column data. INTEGER AND - "Integer.decimal" is output as a decimal point. SMALLINT - The exponent (e) of mantissa is output as a floating point. #1: If the data is a null value, spaces (0x20) equal to the output area size for the row are output. ---------------------------------------------------------------------- RDAREAINF ( Displays RDAREA information ) ---------------------------------------------------------------------- Function The RDAREAINF command displays information for the specified RDAREA. Format -------------------------------------- RDAREAINF [RDAREA-name] -------------------------------------- Operands ** RDAREA-name ~ (1 to 30 characters) Specifies the RDAREA whose information you want to display. Output example: TYPE USER NAME USED_TABLE -------- ---------- ------------ ---------- aaaa bbbb cccc dddd aaaa : Type of stored data (TABLE, INDEX, BLOB, SEQUENCE) bbbb : Creator (authorization identifier) cccc : Name Table identifier when aaaa is TABLE, Index identifier when aaaa is INDEX, Column name when aaaa is BLOB, Sequence identifier when aaaa is SEQUENCE dddd : Original table identifier when aaaa is INDEX or BLOB ---------------------------------------------------------------------- RDAREAS ( Displays RDAREA ) ---------------------------------------------------------------------- Function The RDAREAS command displays RDAREAS. Format -------------------------------------- RDAREAS [RD-node-name] -------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. Output example: RDAREA_ID RDAREA_NAME SERVER TYPE PAGE_SIZE --------- ------------------------------ -------- ---- --------- aaaa bb....bb cccccccc de fffff SEGMENT_SIZE INITIAL_SIZE FILE_COUNT N_TABLE N_INDEX N_SEQ ------------ ------------ ---------- ------- ------- ------ ggggg hhhhh iiiii jjjjj kkkkk lllll aaaa : RDAREA ID(#1) bb....bb : RDAREA name cccccccc : Server name d : RDAREA type(#3) e : Attribute of RDAREA for temporary table(#3)(#4) fffff : Page length ggggg : Segment size hhhhh : Number of initially allocated segments iiiii : Number of files jjjjj : Number of stored tables kkkkk : Number of stored indexes lllll : Number of stored sequences(#2) #1: The results are sorted by this row in ascending order. #2: This column is displayed when HiRDB V8 08-05 or later is connected. #3: For details about the meaning of the displayed content, see "Appendix G. Data Dictionary Table Retrieval" and "Table G-3 SQL_RDAREAS table contents" in "HiRDB UAP Development Guide". #4: When HiRDB V9 09-02 or earlier is connected, nothing is output. ---------------------------------------------------------------------- REPEAT ( Executes a SQL repeatedly ) ---------------------------------------------------------------------- Function The REPEAT command re-executes the immediately preceding SQL. Format ---------------------------------------------------------------------- REPEAT [repetition-count] [{DISPLAY | NODISPLAY}] ~~~~~~~~~ ---------------------------------------------------------------------- Operands ** repetition-count ~ (1 to 2147483647) <<1>> Specifies the number of times the immediately preceding SQL is executed. ** DISPLAY | NODISPLAY DISPLAY: Displays the SQL to be re-executed. NODISPLAY: Does not display the SQL to be re-executed. Notes (1) This command cannot re-execute control SQL such as COMMIT and ROLLBACK. (2) If the RDAREAINF, SEQINF, SOURCE, or TABLEINF command to issue SQL was immediately executed before, the KFPX27923-E error occurs. Examples The following example inserts the same data into table T1 by 100 lines with the INSERT statement. INSERT INTO T1 (C1,C2) VALUES(1000,2000); REPEAT 99; ---------------------------------------------------------------------- ROUTINES ( Displays routines ) ---------------------------------------------------------------------- Function The ROUTINES command displays the routines possessed by the user of the specified authorization identifier. Format ---------------------------------------------------------------------- ROUTINES [[RD-node-name [.]] {authorization-identifier | ALL}] ---------------------------------------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier of the user possessing the routines. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** ALL Displays all the defined routines. Examples The following example displays the routines of the user whose authorization identifier is USER1. ROUTINES USER1; Output contents: # Column name Number of Type Contents characters --+-------------+-----------+---------+----------------------------------- 1 ROUTINE_NAME 39 Character Routine name(#1)(#2) 2 SPECIFIC_NAME 30 Character Specific name 3 TYPE 4 Character Routine type P : Procedure F : Function 4 N_PARAM 7 Numeric Number of parameters 5 OBJECT_SIZE 12 Numeric Defined source size (unit: bytes)(#3) 6 CREATE_TIME 14 Character Routine creation time(#4) #1: The results are sorted by this row in ascending order. #2: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 61. #3: For the procedure for external routine operation or registry operation, the defined source size is 0. #4: For the SQL procedure statement, it indicates SQL analysis time; for the external routine, it indicates routine definition creation time. ---------------------------------------------------------------------- SEQINF (Displaying ordinal number creator information) ---------------------------------------------------------------------- Function Displays information about a specified ordinal number creator. Format ---------------------------------------------------------------------- SEQINF [authorization-identifier[.]] ordinal-number-creator-identifier ---------------------------------------------------------------------- Operands ** authorization-identifier Authorization identifier (1 to 8 characters) Specify the authorization identifier for the user that has the ordinal number creator. If the authorization identifier is not specified, an authorization identifier for CONNECT is assumed. ** ordinal-number-creator-identifier Identifier (1 to 30 characters) Specify the ordinal number creator whose information you want to display. Notes: (1) If unidentifiable data is acquired for the output items, either "?Unknown" is displayed or no value is output for the item. Output format: Sequence Schema : bb....bb ....Authorization identifier Sequence Name : cc....cc ....Ordinal number creator identifier Sequence ID : dddddddddd(dd....dd) ....Ordinal number creator ID The value is displayed as a hexadecimal number (decimal number). Public Usage : e ....Indicates whether PUBLIC USAGE is specified. (Y: specified; Space: not specified) Data Type : ff....ff ....Data type Start Value : gg....gg ....Start value (Space: no start value is specified) Maximum Value : hh....hh ....Maximum value (Space: no maximum value is specified) Minimum Value : ii....ii ....Minimum value (Space: no minimum value is specified) Increment : jj....jj ....Increment value (Space: no increment value is specified) Cycle Option : k ....Cycle option (Y:CYCLE; N:NO CYCLE) Log Interval : ll....ll ....Log output interval RDAREA Name : mm....mm ....RD area name for the storage location of the ordinal number creator Depending on the specification of the PDSQL_IDENT_QUOT environment variable, the following names vary when they are output: - Sequence Schema - Sequence Name - RDAREA Name If the PDSQL_IDENT_QUOT environment variable is set to ON: The name is output enclosed by double quotation marks. If the PDSQL_IDENT_QUOT environment variable is set to OFF: The name is output not enclosed by double quotation marks, except when the name includes a lowercase character. If the PDSQL_IDENT_QUOT environment variable is not set: The name is output enclosed by double quotation marks. ---------------------------------------------------------------------- SEQUENCES (Displaying a list of ordinal number creators) ---------------------------------------------------------------------- Function Displays a list of ordinal number creators. Format ---------------------------------------------------------------------- SEQUENCES [ { authorization-identifier | ALL } ] ---------------------------------------------------------------------- Operands ** authorization-identifier Authorization identifier (1 to 8 characters) Specify the authorization identifier for the user that has the ordinal number creator. If the authorization identifier is not specified, an authorization identifier for CONNECT is assumed. A list of ordinal numbers owned by the specified user is displayed. ** ALL A list of ordinal numbers owned by all the users is displayed. Output contents: # Column name Number of Type Contents characters --+---------------+----------+---------+--------------------------------- 1 SEQUENCE_SCHEMA 15 Character Authorization identifier (#1)(#2) 2 SEQUENCE_NAME 30 Character Ordinal number creator identifier (#1) 3 PUBLIC_USAGE 1 Character Indicates whether PUBLIC USAGE is specified (Y: specified; Space: unspecified) 4 CREATE_TIME 14 Character Time needed to create ordinal numbers #1: The results are sorted by this row in ascending order. #2: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 30. ---------------------------------------------------------------------- SERVERS ---------------------------------------------------------------------- Function SERVERS command lists the foreign servers owned by the specified authorization identifier. Format ---------------------------------------------------------------------- SERVERS [ { authorization-identifier | ALL } ] ---------------------------------------------------------------------- Operands ** authorization-identifier ~ (1 to 8 characters) Specify the authorization identifier of the user who owns foreign servers. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** ALL Displays all the defined routines. Output contents: # Column name Number of Type Contents characters --+---------------+----------+---------+--------------------------------- 1 SERVER_ID 12 Numeric Foreign server ID(#1) 2 SERVER_NAME 39 Character Foreign server name(#2) 3 BES 8 Character BES name to access the foreign server 4 TYPE 30 Character Server type 5 VERSION 30 Character Server version 6 N_TABLE 12 Numeric The number of tables defined on the foreign server 7 MAPPING_USER_ID 10 Character User name on the foreign server(#3) #1: The results are sorted by this row in ascending order. #2: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 61. #3: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 30. ---------------------------------------------------------------------- SET ANALYSIS MODE ( Execution of only SQL pre-processing ) ---------------------------------------------------------------------- Function This command executes only the SQL pre-processing. This is used to acquire the access path without changing the data. Format -------------------------------------------- SET ANALYSIS MODE { ON | OFF } -------------------------------------------- Operands ** ON | OFF ON : Performs only the pre-processing of the entered SQL statement. OFF : Performs both the pre-processing and execution of the entered SQL statement. Notes (1) The following shows the SQL statements for which this command is enabled: - ASSIGN LIST - DELETE - DROP LIST - INSERT - PURGE TABLE - SELECT - UPDATE - LOCK COMMIT and ROLLBACK are executed even if this mode is ON. When this mode is ON, if SQL statements other than the above is executed, the KFPX27922-E error occurs. (2) The following shows the dictionary search commands for which this command is enabled: COLUMNS, CONSTRAINTS, DESCRIPTORS, FILES, INDEXCLM, INDEXES, LOBS, PRPARAMS, RDAREAS, ROUTINES, SEQUENCES, SERVERS, TABLES, TRIGGERS, TYPES, USERS If the RDAREAINF, SEQINF, SOURCE, and TABLEINF dictionary search commands, which are not included in the above, are used, the pre-processing and execution are performed even if the mode is ON. ---------------------------------------------------------------------- SET ARRAY DISPLAY MODE ( Switches repetition column information ) ---------------------------------------------------------------------- Function The SET ARRAY DISPLAY MODE command switches the output contents of repetition column information. Format -------------------------------------------- SET ARRAY DISPLAY MODE { DATA | NUM } -------------------------------------------- Operands ** DATA | NUM DATA :Displays the data stored as the retrieval result. NUM :Displays the number of data stored as the retrieval result. Notes (1) The number of stored data includes NULL value data. (2) This command is valid only when the SQL statement is executed with the retrieval result display format set to the table format. If the PUTFILE command is executed, "stored data" is always output. (3) If the number of stored data is greater than the number of elements specified in the SET ARRAY LIMIT command, the number of elements specified in the SET ARRAY LIMIT command is returned. Examples CREATE TABLE T (ID CHAR(11),V SMALLINT ARRAY[5],C DECIMAL(10,5)); INSERT INTO T VALUES('A19Y3946122',ARRAY[4,7,1,6,5],+100.35); INSERT INTO T VALUES('D25Y7788792',ARRAY[9,NULL,NULL,3,2],+120.02); INSERT INTO T VALUES('J03Y9750756',ARRAY[1,6,3],+99.56); ... SET ARRAY DISPLAY MODE NUM; SELECT ID,V,C FROM T ORDER BY ID;...Displays the number of stored data. ... SET ARRAY DISPLAY MODE DATA; SELECT ID,V,C FROM T ORDER BY ID;...Displays stored data. Output examples: The following shows examples of repetition column information output when the retrieval SQL is executed using the table in Example. - When SET ARRAY DISPLAY MODE DATA is executed ID NUMELM(V) C ----------- ------------ ------------ A19Y3946122 5 00100.35000 D25Y7788792 5 00120.02000 J03Y9750756 3 00099.56000 - When SET ARRAY DISPLAY MODE DATA is executed ID V[0] V[1] V[2] V[3] V[4] C ----------- -------- -------- -------- -------- -------- ------------ A19Y3946122 4 7 1 6 5 00100.35000 D25Y7788792 9 ****** ****** 3 2 00120.02000 J03Y9750756 1 6 3 ****** ****** 00099.56000 ---------------------------------------------------------------------- SET ARRAY LIMIT ( Limits the maximum number of elements ) ---------------------------------------------------------------------- Function The SET ARRAY LIMIT command limits the maximum number of elements. Format ---------------------------------------------- SET ARRAY LIMIT maximum-number-of-elements ---------------------------------------------- Operands ** maximum-number-of-elements ~ ({0 | 2 to 30000}) Specifies the maximum number of elements limited in repetition columns. Specify 0 when no limit exists for the maximum number of elements in repetition columns (uses the maximum number of elements set in the column definition). Examples The following example retrieves columns where 50 are defined as the repetition count only by 10 elements, starting from the beginning of the table. CREATE TABLE T1(C1 INTEGER ARRAY[50]); ... SET ARRAY LIMIT 10; SELECT C1 FROM T1; ---------------------------------------------------------------------- SET ARRAY NOVALUE( Sets display characters for elements without repetition column values ) ---------------------------------------------------------------------- Function Sets characters to display elements with no values in repetition columns. Format -------------------------------------- SET ARRAY NOVALUE 'Character' -------------------------------------- Operands ** 'Character' - (one character) <<'*'>> Sets a character to be displayed when elements in the repetition columns have no value. Notes (1) Settings are valid when retrieval results are set to be displayed in the table-format. (2) The settings do not apply to the PUTFILE command. (3) You can use single-byte alphanumeric characters and symbols. ---------------------------------------------------------------------- SET AUTO COMMIT ( Automatically issues COMMIT ) ---------------------------------------------------------------------- Function The SET AUTO COMMIT command automatically issues COMMIT when SQL execution terminates normally. Format -------------------------------------- SET AUTO COMMIT {ON | OFF} -------------------------------------- Operands ** ON | OFF ON : Automatically issues COMMIT when SQL execution terminates normally. OFF : Does not automatically issue COMMIT when SQL execution terminates normally. environment variable ** PDUAPAUTOCOMMIT = ON | OFF ON : Automatically issues COMMIT. OFF : Does not automatically issue COMMIT. If PDUAPAUTOCOMMIT is not defined, ON is assumed. Notes (1) If execution of a SQL designed to automatically issue COMMIT terminates normally, this SQL automatically issues COMMIT despite the fact that OFF is specified. Examples The following example automatically issues COMMIT: SET AUTO COMMIT ON; INSERT INTO T1 (C1,C2) VALUES(1000,2000); The following example does not automatically issue COMMIT: SET AUTO COMMIT OFF; INSERT INTO T1 (C1,C2) VALUES(1000,2000); COMMIT; ---------------------------------------------------------------------- SET BINARY LIMIT ( Limits the BINARY-type length ) ---------------------------------------------------------------------- Function The SET BINARY LIMIT command limits the length of the BINARY-type transfer area. Format -------------------------------------- SET BINARY LIMIT length -------------------------------------- Operands ** length ~ (0 to 2147483647) Specifies the length of the BINARY-type transfer area. If you do not limit the length of the BINARY-type transfer area, specify 0. If 0 is specified, the length of the BINARY-type transfer area complies with the defined column length. Notes (1) You can use the environment variable PDSQLBINARYLIMIT to set limitations at the activation of this program. You can use the STATUS command to check the status. Examples The following example retrieves character strings whose length of the BINARY-type transfer area is 2147483647 bytes only by 100 bytes. CREATE TABLE T1(C1 BINARY (2147483647)); ... SET BINARY LIMIT 100; SELECT C1 FROM T1; ---------------------------------------------------------------------- SET BLOB LIMIT ( Limits the BLOB-type length ) ---------------------------------------------------------------------- Function The SET BLOB LIMIT command limits the length of the BLOB-type transfer area. Format -------------------------------------- SET BLOB LIMIT length -------------------------------------- Operands ** length ~ (0 to 2147483647) Specifies the length of the BLOB-type transfer area. If you do not limit the length of the BLOB -type transfer area, specify 0. If 0 is specified, the length of the BLOB-type transfer area complies with the defined column length. Notes (1) You can use the environment variable PDSQLBLOBLIMIT to set limitations at the activation of this program. You can use the STATUS command to check the status. Examples The following example retrieves character strings whose length of the BLOB-type transfer area is 2 gigabytes only by 100 bytes. CREATE TABLE T1(C1 BLOB(2G); ... SET BLOB LIMIT 100; SELECT C1 FROM T1; ---------------------------------------------------------------------- SET CHAR LIMIT ( Limits the CHAR-type length ) ---------------------------------------------------------------------- Function The SET CHAR LIMIT command limits the length of the CHAR/VARCHAR/MCHAR/MVARCHAR-type transfer area. Format -------------------------------------- SET CHAR LIMIT length -------------------------------------- Operands ** length ~ (0 to 32000) Specifies the length of the CHAR/VARCHAR/MCHAR/MVARCHAR-type transfer area. If you do not limit the length of the CHAR/VARCHAR/MCHAR/MVARCHAR-type transfer area, specify 0. If 0 is specified, the length of the CHAR/VARCHAR/MCHAR/MVARCHAR-type transfer area complies with the defined column length. Examples The following example retrieves character strings whose length of the CHAR/VARCHAR/MCHAR/MVARCHAR-type transfer area is 30000 bytes only by 100 bytes. CREATE TABLE T1(C1 CHAR(30000)); ... SET CHAR LIMIT 100; SELECT C1 FROM T1; Notes (1) This command is also valid for dictionary information display commands. ---------------------------------------------------------------------- SET CLOB LIMIT ( Limits CLOB type data length ) ---------------------------------------------------------------------- Function Limits the length of the data transfer area for the CLOB type data. Format -------------------------------------- SET CLOB LIMIT length -------------------------------------- Operands ** length ~ (0 to 2147483647) Specifies the length of the CLOB type data. When you do not limit the length of the CLOB type data (use the length defined for columns), specify 0. Notes (1) You can use the environment variable PDSQLCLOBLIMIT to set limitations at the activation of this program. You can use the STATUS command to check the status. Examples Retrieval results only 100 bytes in columns with the CLOB type data length of 2GB. CREATE TABLE T1(C1 CLOB(2G) IN ULOB1); ... SET CLOB LIMIT 100; SELECT C1 FROM T1; ---------------------------------------------------------------------- SET CMDBUF (Limits the output length of the server command execution result ) ---------------------------------------------------------------------- Function The SET CMDBUF command changes the length of the area used to receive the execution result of the commands executed by the server. Format -------------------------------------- SET CMDBUF length -------------------------------------- Operands ** length ~ (1 to 2147483647) Specifies the length of the area used to receive the execution result of the commands executed by the server. The initial value is 30,000 bytes. ---------------------------------------------------------------------- SET CONVSPACE ---------------------------------------------------------------------- Function If control characters (0x01-0x1F) other than a line feed exist in a character string of an SQL statement or pdsql command, SET CONVSPACE command converts the control character codes to singe-byte spaces. Format -------------------------------------- SET CONVSPACE { ON | OFF } -------------------------------------- Operands ** ON | OFF <> ON : Converts control character codes to single-byte spaces. OFF : Does not convert control character codes. Environment variable ** PDSQL_CONVSPACE = ON | OFF ON : Converts control character codes to single-byte spaces. OFF : Does not convert control character codes. If not specified, OFF is assumed. Notes (1) You can use the STATUS command to check the status. ---------------------------------------------------------------------- SET DISPLAY ---------------------------------------------------------------------- Function SET DISPLAY command changes the output format. Format ------------------------------------------------------ SET DISPLAY [{ ALL | OFF }] [{ PROMPT | NOPROMPT }] ------------------------------------------------------ Operands ** { ALL | OFF } <> ALL : Outputs the retrieval results and messages. OFF : Outputs messages only. ** { PROMPT | NOPROMPT } <> PROMPT : Displays a command input prompt. NOPROMPT : Does not display a command input prompt. Environment variable ** PDSQL_DISPLAY = ALL | OFF ALL : Outputs retrieval results and messages. OFF : Outputs messages only. If not specified, ALL is assumed. ** PDSQL_DISPLAYNOLINE = YES | NO YES : Does not display a command input prompt. NO : Displays a command input prompt. If not specified, NO is assumed. Notes (1) You can use the STATUS command to check the status ---------------------------------------------------------------------- SET DUMPMODE ( Displays the retrieval result in both the hexadecimal format and character format or only in the character format ) ---------------------------------------------------------------------- Function The SET DUMPMODE command displays the retrieval result in both the hexadecimal format and character format or only in the character format. Format -------------------------------------- [ SET ] DUMPMODE { ON | OFF } -------------------------------------- Operands ON : When the retrieval result is displayed in the table format (TBLMODE is ON), it is displayed in the hexadecimal format. When the retrieval result is displayed in the list format (TBLMODE is OFF), it is displayed in both the hexadecimal format and character format. OFF : The retrieval result is displayed in the character format. Environment variable ** PDUAPDUMP = { ON | OFF } | { YES | NO } ON or YES : When the retrieval result is displayed in the table format (TBLMODE is ON), it is displayed in the hexadecimal format When the retrieval result is displayed in the list format (TBLMODE is OFF), it is displayed it both in the hexadecimal format and character format. OFF or NO : The retrieval result is displayed in the character format. If this operand is not specified, OFF is assumed. ---------------------------------------------------------------------- SET ECHOBACK ( Echoes back a command ) ---------------------------------------------------------------------- Function The SET ECHOBACK command echoes back the entered command character string. Format -------------------------------------- SET ECHOBACK {ON | OFF} -------------------------------------- Operands ** ON | OFF ON : Echoes back the entered command. OFF : Does not echo back the entered command. ---------------------------------------------------------------------- SET FETCH ARRAY SIZE ( Setting of the number of rows to be searched at one FETCH ) ---------------------------------------------------------------------- Function This command specifies the number of rows to be searched at one FETCH by using the array FETCH function. Format -------------------------------------------------- SET FETCH ARRAY SIZE (Number of rows) -------------------------------------------------- Operands ** (Number of rows) (0, 2 to 32767)<<0>> - Specify the number of rows to be searched at one FETCH. - To return to the normal FETCH operation (one item is searched at one FETCH), specify 0. Notes (1) The following are the dictionary search commands that enable this command: COLUMNS, CONSTRAINTS, DESCRIPTORS, FILES, INDEXCLM, INDEXES, LOBS, PRPARAMS, RDAREAINF, RDAREAS, ROUTINES, SEQINF, SEQUENCES, SERVERS, TABLES, TRIGGERS, TYPES, USERS When the SOURCE and TABLEINF dictionary search commands, which are not included in the above, are used, rows are not collectively acquired, even if the collective acquisition of multiple rows is specified. One row is acquired at a time. ---------------------------------------------------------------------- SET FETCH LIMIT ( Limits the number of the rows to be retrieved ) ---------------------------------------------------------------------- Function This command restricts the number of rows to be searched (the number of rows for which FETCH is executed). Format -------------------------------------------------- SET FETCH LIMIT number-of-search-target-rows -------------------------------------------------- Operands ** number-of-search-target-rows ~ (0 to 2147483647) - Specify the number of rows to be searched (the number of rows for which FETCH is executed). - To not restrict the number of rows to be searched (the number of rows for which FETCH is executed), specify 0. Examples Restrict the number of search target rows to 10: SET FETCH LIMIT 10; SELECT * FROM T1 ORDER BY C1 ASC; Notes (1) The following shows the dictionary search commands that enable this command: COLUMNS, CONSTRAINTS, DESCRIPTORS, FILES, INDEXCLM, INDEXES, LOBS, PRPARAMS, RDAREAS, ROUTINES, SEQUENCES, SERVERS, TABLES, TRIGGERS, TYPES, USERS When the RDAREAINF, SEQINF, SOURCE, and TABLEINF dictionary search commands, which are not included in the above, are used, all the results are output regardless of the number of search target rows specified. (2) The result set of the CALL statement outputs all the results regardless of the number of search target rows specified. ---------------------------------------------------------------------- SET NCHAR LIMIT ( Limits the NCHAR-type output length ) ---------------------------------------------------------------------- Function The SET NCHAR LIMIT command limits the length of the NCHAR/NVARCHAR-type transfer area. Format -------------------------------------- SET NCHAR LIMIT length -------------------------------------- Operands ** length ~ (0 to 16000) Specifies the length of the NCHAR/NVARCHAR-type transfer area. If you do not limit the length of the NCHAR/NVARCHAR-type transfer area, specify 0. If 0 is specified, the length of the NCHAR/NVARCHAR-type transfer area complies with the defined column length. Examples The following example retrieves character strings whose length is 15000 characters only by 100 characters. CREATE TABLE T1(C1 NCHAR(15000)); ... SET NCHAR LIMIT 100; SELECT C1 FROM T1; Notes (1) This command is also valid for dictionary information display commands. ---------------------------------------------------------------------- SET NULL CHARACTER ( Sets the display character for the null value ) ---------------------------------------------------------------------- Function Sets characters to display the null value in the table-format display feature for the retrieval results. Format -------------------------------------- SET NULL CHAR[ACTER] 'Character' -------------------------------------- Operands ** 'Character' - (one character) <<'*'>> Sets a character to be displayed for the null value. Notes (1) Settings are valid when retrieval results are set to be displayed in the table format. (2) The settings do not apply to the PUTFILE command. (3) You can use single-byte alphanumeric characters and symbols. ---------------------------------------------------------------------- SET PADDING CHAR ( Changes padding characters ) ---------------------------------------------------------------------- Function Specifies, for the input ? parameters of the CHAR and MCHAR types, whether to add padding characters after the input data. Format -------------------------------------- SET PADDING CHAR { SPACE | NONE } -------------------------------------- Operands ** SPACE | NONE SPACE : Pads space characters after the input data so that the data length becomes the same as that of the defined length, and uses the data as the ? parameter value. NONE : Uses the data with the same length as that of the input data as the ? parameter value. Notes (1) At activation, the program selects the SPACE operand. (2) When XDM/RD E2 is connected, if data including 2-byte characters are input in the input ? parameter with the fixed length (the CHAR or MCHAR type), XDM/RD E2 will execute character code conversion and extend the data length, resulting in an SQL error. You can avoid this problem by specifying the NONE operand. This problem does not occur with the NCHAR type data because the data length does not change after the character code conversion. (3) When you input SQL statements having input ? parameters, the program obtains the input ? parameter information, such as data type and definition length, from the server (HiRDB or XDM/RD E2). The program displays the ? parameter information obtained from the server in a message requesting the input of the ? parameter value. Data types of the input ? parameter created by the program are as follows: Data type of the ? parameter information obtained from the server CHAR MCHAR -------------------------------------------+---------+------------ Data type of the input ? parameter value created by the program - When the SPACE operand is specified CHAR MCHAR - When the NONE operand is specified VARCHAR MVARCHAR ---------------------------------------------------------------------- SET REMOVE LINEFEED CHARACTER ---------------------------------------------------------------------- Function This command removes the line-feed code (0x0A, 0x0D) if it is included in the SQL statement or in the character string of the pdsql command. Format ----------------------------------------------- SET REMOVE LINEFEED CHARACTER { ON | OFF } ----------------------------------------------- Operands ** ON | OFF <> ON : Removes the line-feed code. OFF: Does not remove the line-feed code. Environment variable ** PDSQL_REMOVE_LINEFEED_CHARACTER = ON | OFF ON : Removes the line-feed code. OFF: Does not remove the line-feed code. If nothing is set, OFF is assumed. Notes (1) The status can be checked by using the STATUS command. (2) In versions 09-01 and earlier, the ON operation was performed. (3) In the simplified GUI version, if the command is entered from the SQL input screen, the setting is not enabled. The ON operation is always performed. (4) For the effects when this setting is ON, see (i) in "Rules". ---------------------------------------------------------------------- SET RESULT FILEOUT ---------------------------------------------------------------------- Function SET RESULT FILEOUT command outputs the execution result both to the screen and a file. Format ----------------------------------------------- SET RESULT FILEOUT { ON [file-name] | OFF } ----------------------------------------------- Operands ** ON [file-name] Outputs the execution result to the specified file. If the file name is omitted, the previously specified file name is used. If this command is executed for the first time after the program is started, the file name is mandatory. ** OFF Terminates the output of the execution result to a file. Notes (1) The execution result of the line mode HELP command is not output to a file. (2) The executed SQL statement and pdsql command are not output. If you want to output them, use SET ECHOBACK command together. (3) If an existing file is specified, the execution result is added to the file. ---------------------------------------------------------------------- SET SPLIT SIZE ---------------------------------------------------------------------- Function The size to which the BINARY/BLOB/CLOB type does the split acquisition is specified. To use this command, the retrieval output can be done by evading memory shortage when the data stored in the BINARY/BLOB/CLOB type is retrieved. Format ----------------------------------------- SET SPLIT SIZE SPLIT_ACQUISITION_SIZE ----------------------------------------- Operands ** SPLIT_ACQUISITION_SIZE ~ (0,4 to 2097152) <<0>> Specify the split acquisition size of the BINARY/BLOB/CLOB type in kilobytes. If you do not want to perform split acquisition, specify 0. Notes (1) This command will be effective only when the connected server and client are HiRDB V7 07-01 or a later version. (2) Astandard, specify a value so that there will be the fewest number of split acquisition times and the memory shortage will not occur, taking into account the distribution of the real data lengths. Example of obtaining the standard value when the distribution of real data lengths is unknown: /* (Under the same condition as for Retrieval SQL,) obtain the average value of the real data lengths of the longest data type (blob1) included in the acquired row data. */ SELECT AVG(LENGTH(blob1)) FROM table1 WHERE int1<100; (3) The split acquisition size can be specified in advance by environment variable PDSQL_SPLITSIZE at program start time. The specified value can be checked by STATUS command. (4) If split acquisition specification is performed by this command, the communication with HiRDB and output processing is also split. Therefore, the performance may be degraded depending on the number of split acquisition times. If you can determine that the maximum real data length will not cause memory shortage, try to execute retrieval by specifying the maximum data length for each of SET BINARY LIMIT, SET BLOB LIMIT and SET CLOB LIMIT commands. (5) This command supports retrieval by the SELECT statement. However, it does not support the CALL statement. (6) Even if BINARY/BLOB/CLOB type data is retrieved when the output format of the retrieval result is specified as the list format, the retrieval data is not displayed. Use example If two columns (int1 AS INTEGER and blob1 AS BLOB (2G)) are retrieved and output to a file, the maximum real data length is 700MB and the average real data length is 100MB File output command: PUTFILE BIN_PDRORG TO C:\TEMP\T1.DAT SELECT int1,blob1 FROM T1; /* Execute the command with nothing specified => Memory as large as the defined length (2G + 4) is required. */; /* If memory shortage occurs, specify the maximum real data length for the maximum length of BLOB type data. */; SET BLOB LIMIT 734003200; /* (Execute the command) => Memory as large as the length specified for BLOB LIMIT (700M + 4) is required. */; /* If memory shortage still occurs, specify the average real data length for the split acquisition size. */; SET SPLIT SIZE 102400; /* (Execute the command) => Memory as large as the size specified for SPLIT SIZE (100M + 4) is required. */; /* If memory shortage still occurs, specify half of the split acquisition size. */; SET SPLIT SIZE 51200; ... ---------------------------------------------------------------------- SET TBLMODE ( Displays a table format ) ---------------------------------------------------------------------- Function The SET TBLMODE command displays the retrieval result in the table format or in the list format. Format -------------------------------------- SET TBLMODE { ON | OFF } -------------------------------------- Operands ** ON | OFF ON : Displays the retrieval result in the table format (horizontal display of columns). OFF : Displays the retrieval result in the list format (vertical display of columns). Notes Null values are represented by ********. ---------------------------------------------------------------------- SET WHENEVER ---------------------------------------------------------------------- Function This command specifies the processing that HiRDB SQL Executer should take after executing an SQL statement. Format ------------------------------------------------------ SET WHENEVER { SQLERROR | SQLWARNING | NOT FOUND } { EXIT return value [ COMMIT | ROLLBACK ] | CONTINUE [ COMMIT | ROLLBACK | NONE ] } return value::= { integer constant | SQLCODE} ------------------------------------------------------ Operands ** { SQLERROR | SQLWARNING | NOT FOUND } SQLERROR : Specifies the processing to be performed when the SQL statement is not executed normally due to an error caused by the user or with HiRDB. SQLWARNING : Specifies the processing to be performed when the SQL statement was executed normally but a status was detected that the user is to be warned of. NOT FOUND : Specifies the processing to be performed when no result is found after all the tables are searched. ** {EXIT return value [COMMIT|ROLLBACK] |CONTINUE [COMMIT|ROLLBACK|NONE]} EXIT : Exit HiRDB SQL Executer with the return value specified by the user. If COMMIT or ROLLBACK is not specified, COMMIT is assumed. CONTINUE : Continues the execution of HiRDB SQL Executer. If COMMIT, ROLLBACK, or NONE is not specified, NONE is assumed. COMMIT : Commits the current transaction. ROLLBACK : Rolls back the current transaction. NONE : For SQLERROR, commit or rollback is not performed. For SQLWARNING or NOT FOUND, when the AUTO COMMIT mode is ON, the current transaction is committed. ** Return value ::= {integer constant|SQLCODE} Integer constant: The specified value (in the range from -32768 to -1) is the return value. SQLCODE : SQLCODE is the return value. Notes (1) The setting status at the time of startup is the same as when the following command is executed. SET WHENEVER SQLERROR CONTINUE NONE; SET WHENEVER SQLWARNING CONTINUE NONE; SET WHENEVER NOT FOUND CONTINUE NONE; (2) If the SQL is normally executed, the transaction is resolved depending on the AUTO COMMIT mode. (3) If the exception control specification specified for SQLWARNING is in use, if an SQLWARNING occurs during the search operation, the display of the search result stops at the rows where the SQLWARNING occurred. "Search" in this case indicates the SELECT statement, CALL statement, and GET DIAGNOSTICS statement. (4) This command is not applied to an SQL statement that is internally issued in HiRDB SQL Executer processing. ---------------------------------------------------------------------- SINGLE ROW (single-row SELECT statement) ---------------------------------------------------------------------- Function Executes a single-row SELECT statement. Format ---------------------------------------------------------------------- SINGLE ROW SELECT statement ---------------------------------------------------------------------- Operands ** SELECT statement - Specify a single-row SELECT statement. - For details about the grammar for a single-row SELECT statement, see the HiRDB SQL Reference. Notes (1) Do not specify the INTO clause. (2) If the result has more than two rows, an error (KFPA11449-E) occurs. ---------------------------------------------------------------------- SOURCE ---------------------------------------------------------------------- Function SOURCE command displays the definition source. Format ---------------------------------------------------------------------- SOURCE { VIEW | PROCEDURE | FUNCTION | TRIGGER | ROUTINE } [authorization-identifier.] Definition-source-name ---------------------------------------------------------------------- Operands ** { VIEW | PROCEDURE | FUNCTION | TRIGGER | ROUTINE } Specify the type of the definition source. VIEW : Viewed table PROCEDURE : Procedure FUNCTION : Function TRIGGER : Trigger ROUTINE : Function, procedure, trigger ** authorization-identifier ~ (1 to 8 characters) Specify the authorization identifier of the user who owns the definition source. If the authorization identifier is omitted, the authorization identifier in CONNECT command is assumed. ** DEFINITION_SOURCE_NAME Specify the definition source name for which information is to be displayed. Notes (1) Even if the specified definition source name is defined, if the definition source stored in the data dictionary table is NULL, an asterisk (*) is displayed. (2) If ROUTINE is specified for an operand, the definition sources are retrieved in the order of procedures, functions and triggers. Therefore, if procedures, functions and triggers are specified with the same name, multiple sources are displayed. (3) In HiRDB, because the definition sources of the functions, procedures and triggers are stored in the BLOB type, operation will be as follows: In SJIS SQL Executer, if a character other than ASCII code is included when the character code classification used by the HiRDB server is other than Shift JIS code, the character is garbled. In Unicode SQL Executer, if a character other than ASCII code is included when the character code classification used by the HiRDB server is other than Unicode (UTF-8), the character is garbled. ---------------------------------------------------------------------- STATUS ( Displays the operating status ) ---------------------------------------------------------------------- Function The STATUS command displays the operating status of this program. Format -------------------------------------- { STATUS | ST } [ ALL ] -------------------------------------- Operands ** ALL The program displays all statuses, regardless of the settings for the SET command. Output format PROGRAM NAME : This program name PP-No. : Product ID VERSION : Version of Executer SERVER VERSION : Version of the connected HiRDB server CONNECT USER-ID : Authorization identifier connected to the HiRDB server FETCH LIMIT : Setting value for SET FETCH LIMIT FETCH ARRAY SIZE : Setting value for SET FETCH ARRAY SIZE DUMP FORMAT OUTPUT MODE : Setting value for SET DUMPMODE TABLE FORMAT DISPLAY MODE : Setting value for SET TBLMODE ARRAY DISPLAY MODE : Setting value for SET ARRAY DISPLAY MODE ECHOBACK : Setting value for SET ECHOBACK ANALYSIS MODE : Setting value for SET ANALYSIS MODE AUTO COMMIT MODE : Setting value for SET AUTO COMMIT BLOB LIMIT LENGTH : Setting value for SET BLOB LIMIT BINARY LIMIT LENGTH : Setting value for SET BINARY LIMIT CLOB LIMIT LENGTH : Setting value for SET CLOB LIMIT CHARACTER LIMIT LENGTH : Setting value for SET CHAR LIMIT NCHAR LIMIT LENGTH : Setting value for SET NCHAR LIMIT ARRAY LIMIT : Setting value for SET ARRAY LIMIT SERVER COMMAND BUFFER : Setting value for SET CMDBUF NULL CHARACTER : Setting value for SET NULL CHARACTER ARRAY NOVALUE : Setting value for SET ARRAY NOVALUE PADDING CHAR : Setting value for SET PADDING CHAR RESULT FILEOUT : Setting value for SET RESULT FILEOUT SPLIT SIZE : Setting value for SET SPLIT SIZE DISPLAY MODE : Setting value for SET DISPLAY CONVSPACE : Setting value for SET CONVSPACE REMOVE LINEFEED CHARACTER : Setting value for SET REMOVE LINEFEED CHARACTER WHENEVER SQLERROR : Setting value for SET WHENEVER SQLERROR WHENEVER SQLWARNING : Setting value for SET WHENEVER SQLWARNING WHENEVER NOT FOUND : Setting value for SET WHENEVER NOT FOUND Notes (1) If ALL operand is not specified, information other than the following information is not displayed by default. VERSION : SERVER VERSION : CONNECT USER-ID : FETCH LIMIT : DUMP FORMAT OUTPUT MODE : AUTO COMMIT MODE : ---------------------------------------------------------------------- TABLEINF (Displays table information) ---------------------------------------------------------------------- Function The TABLEINF command displays information for the specified table. Format ---------------------------------------------------------------------- TABLEINF [[RD-node-name [.]] [authorization-identifier [.]] table-identifier ---------------------------------------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier of the user possessing the table. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** table-identifier Specifies the table identifier used to display table information. Notes (1) In XDM/RD 10-01, If this command is executed for the table in which reference constraints or triggers are defined, an SQL statement error occurs and processing terminates because no HiRDB dictionary viewed table exists. Output format Table Type : aa....aa Table Schema : bb....bb Table Name : cc....cc Table ID : dddddddddd(dd....dd) Column : eeeee ff....ff gg....gg [hh....hh] Divide Info : ii....ii(#9)(#11) RDAREA Name : kk....kk(#9) Server Name : MM....MM(#10) Option : ll....ll(#9)(#10) Check : LL....LL(#9)(#11)(#13) Foreign Key : NN....NN(#9)(#11) ----------------------------------------------------------------------(#2) Index Information Index Type : mm....mm Index Name : nn....nn Index ID : oooooooooo(oo....oo) Column : ppppp qq....qq rrrr RDAREA Name : ss....ss Option : tt....tt -----------------------------------------------------------------(#8)(#11) Trigger Information EEEEE Trigger Name : FF....FF.GG....GG(HH....HH) Action Time : II....II Event : JJ....JJ Action Type : KK....KK ----------------------------------------------------------------------(#3) View Information uuuuu vv....vv.ww....ww -----------------------------------------------------------------(#4)(#12) Routine Information xxxxx yy....yy.zz....zz(AA....AA) yy....yy.OO....OO(PP....PP)(#11) yy....yy.QQ....QQ(RR....RR)(#11) ----------------------------------------------------------------------(#5) Base Table Information BBBBB CC....CC.DD....DD aa....aa : Table identifier type. Any one of the following table identifier types is output: TABLE [SHARE](#11) FIX TABLE FOREIGN TABLE [PUBLIC](#11) VIEW [PUBLIC](#11) READ ONLY VIEW bb....bb : Schema name (#1) cc....cc : Table identifier name (#1) dddddddddd(dd....dd) : Table ID. Displays the value in hexadecimal (decimal) notation. eeeee ~ hh....hh : Component column information. Displayed repeatedly as many times as the number of columns. eeeee : Column ID ff....ff : Column name (#1) gg....gg : Data type (#6) hh....hh : Column attribute information. The following contents are output. [CHARACTER SET [character-set-owner.]character-set-name] : character-set-attribute (#1) [ARRAY[number-of-repetition-columns]] : Repetition column attribute (#11) [NO SPLIT] : No-split option attribute (#11) [SUPPRESS] : column-data-suppression-attribute [RECOVERY {ALL | PARTIAL | NO }] : Column recovery restriction attribute [IN ((RDAREA-name)[,(RDAREA-name)]...)] : RDAREA name for LOB column [ALLOCATE (attribute-name IN (RDAREA-name) [,attribute-name IN (RDAREA-name)]...)] : Specification attribute for RDAREA for LOB in abstract data type definition {NULL | NOT NULL} : NULL/NOT NULL attribute [WITH DEFAULT] : WITH DEFAULT attribute [SYSTEM GENERATED] : SYSTEM GENERATED attribute.(#11) [PLUGIN (plug-in-option)] : Plug-in specification attribute (#11) [DEFAULT [default-value]] : DEFAULT attribute.(#11) [UPDATE ONLY FROM NULL] : Updatable column attribute (#11) [INNER CONSTRUCTOR OF TYPE1] : encryption-attribute ii....ii : Split information. Any one of the following is output: (#11) NON DIVISION KEY RANGE PARTITIONED BY (column-name) PARTITIONED BY MULTIDIM (matrix-partitioning-table-information) [FIX] HASH (hash-function-name) BY (column-name)[,( column-name)]... kk....kk : RDAREA information for table MM....MM : Foreign server name (#1) ll....ll : Table option information If the table identifier type is TABLE or FIX TABLE, the following contents are output. PCTFREE=((percentage-of-unused-space), ( percentage-of-free-pages-in-segment)) : Usage ratio information {LOCK ROW | LOCK PAGE} : Unit of locked resources [SUPPRESS DECIMAL] : Abbreviated data storage specification information [WITHOUT ROLLBACK] : Row locking information (#11) {{SEGMENT | UNIT} REUSE {[number-of-segments] | {NO | NOUSE}}}: Free space reuse information (#11) [INSERT ONLY [WHILE {date-interval-data | labeled-duration} BY column-name]]: Falsification prevented table attribute (#11) If the table identifier type is FOREIGN TABLE, information is output in the following syntax: OPTIONS(SCHEMA 'schema-name-on-foreign-server', TABLE 'table-name-on-foreign-server') LL....LL : Constraint decision information. Displayed repeatedly as many times as the number of constraint decisions. This information is output in the following syntax. (#11)(#13) CONSTRAINT constraint-name CHECK(check- constraint-retrieval-condition) NN....NN : Reference constraint information. Displayed repeatedly as much as the number of reference constraints. Output it by the following syntaxes. (#11) CONSTRAINT constraint-name FOREIGN KEY(table-column-name- with-foreign-key) REFERENCES table-name-of-the-table-to-be-referenced ON DELETE ON_DELETE trigger-name ON UPDATE ON_UPDATE trigger-name mm....mm ~ tt....tt : Index information Displayed repeatedly as many times as the number of indexes. mm....mm : Index type. Any one of the following is output: [UNIQUE] INDEX [UNIQUE] CLUSTER KEY UNIQUE PRIMARY [CLUSTER] KEY nn....nn : Index name (#1) oooooooooo(oo....oo) : Index ID. The value is displayed in hexadecimal (decimal) notation. ppppp ~ rrrr : Component column information. Displayed repeatedly as many times as the number of columns. ppppp : Column ID qq....qq : Column name (#1) rrrr : Ascending/descending order information {ASC | DESC} ss....ss : RDAREA name for index tt....tt : Index option information. The following contents are output. PCTFREE=((percentage-of-unused-space)) : Usage ratio information EEEEE ~ KK....KK : Usage ratio information (#11) Displayed repeatedly as many times as the number of triggers. EEEEE : Display serial number FF....FF : Schema name to which trigger belongs (#1) GG....GG : Trigger name (#1) HH....HH : Specific name (#7) II....II : Trigger action event{BEFORE | AFTER} JJ....JJ : Trigger event {INSERT | DELETE | UPDATE[OF column-name[,column-name]...]} KK....KK : Trigger action [{FOR EACH ROW | FOR EACH STATEMENT}] uuuuu ~ ww....ww : View information. Displayed repeatedly as many times as the number of views uuuuu : Display serial number vv....vv : Schema name (#1) ww....ww : View name (#1) xxxxx ~ AA....AA : Routine information (#12) Displayed repeatedly as many times as the number of routines. xxxxx : Display serial number yy....yy : Schema name(#1) zz....zz : Routine name(#1) AA....AA : Specific name (#7) OO....OO : Trigger name (#1)(#11) PP....PP : Specific name (#7)(#11) QQ....QQ : Constraint name (#1)(#11) RR....RR : Specific name (#7)(#11) BBBBB ~ DD....DD : Table information of reference destination Displayed repeatedly as many times as the number of reference destination tables. BBBBB : Display serial number CC....CC : Schema name to which the table belongs (#1) DD....DD : Table name (#1) #1: If lowercase letters are included in the name, those letters are enclosed in double quotations. #2: Displays the index information that references the table identifier specified by the command. #3: Displays the view information that references the table identifier specified by the command. #4: Displays the routine information that references the table identifier specified by the command. #5: Displays the table information that is referenced by the table identifier specified by the command. #6: The defined data code values and displayed character strings are listed in the table below: Table A-5 : Data Code Value and Displayed Character String Data Displayed Notes on length code value data type name ----------+------------------------+----------------------------------- 96 or INTERVAL YEAR TO SECOND Displayed in "(precision, scale)". 97 100 or INTERVAL YEAR TO DAY Displayed in "(precision, scale)". 101 110 or INTERVAL HOUR TO SECOND Displayed in "(precision, scale)". 111 112 or DATE Not displayed. 113 120 or TIME Displayed in "(scale)". 121 If the scale is 0, not displayed. 124 or TIMESTAMP Displayed in "(scale)". 125 If the scale is 0, not displayed. 131 ABSTRACT DATA TYPE NAME Not displayed. 144 or BINARY Maximum number of stored bytes. 145 146 or BLOB Maximum number of stored bytes. 147 152 or CLOB Maximum number of stored bytes. 153 160 or MVARCHAR Maximum number of stored bytes. 161 164 or MCHAR Number of stored bytes 165 176 or NVARCHAR Maximum number of 177 stored characters. 180 or NCHAR Number of stored characters. 181 192 or VARCHAR Maximum number of stored bytes. 193 196 or CHAR Number of stored bytes. 197 224 or FLOAT Not displayed. 225 226 or SMALLFLT Not displayed. 227 228 or DECIMAL Displayed in "(precision, scale)". 229 240 or INTEGER Not displayed. 241 244 or SMALLINT Not displayed. 245 Note that, in SQL Executer 02-06 or earlier, the display contents are limited as follows: - For the TIMESTAMP type data, the scale is not displayed. - For the abstract data type, a dot (.) is displayed. #7: For the specific name, refer to the manual "HiRDB UAP Development Guide." #8: Displays the trigger information that references the table identifier specified by the command. #9: Displayed when the table identifier type is TABLE or FIX TABLE. #10: Displayed when the table identifier type is FOREIGN TABLE. #11: Not output in SQL Executer 02-06 or earlier versions. #12: If the routine name is the specific name of the trigger, the trigger name is output. If the trigger name is the specific name of the reference constraint, the constraint name is output. In XDM/RD 10-01, if the above information exists, this information is not output because no HiRDB dictionary viewed table exists. #13: In HiRDB, because the definition source is stored in BLOB type, operation will be as follows: In SJIS SQL Executer, if a character other than ASCII code is included when the character code classification used by the HiRDB server is other than Shift JIS code, the character is garbled. In Unicode version SQL Executer, if a character other than ASCII code is included when the character code classification used by the HiRDB server is other than Unicode (UTF-8), the character is garbled. ---------------------------------------------------------------------- TABLES ( Displays a table list ) ---------------------------------------------------------------------- Function The TABLES command displays a list of the tables possessed by the user of the specified authorization identifier. Format ---------------------------------------------------------------- TABLES [[RD-node-name [.]] {authorization-identifier | ALL}] [+COMMENT] ---------------------------------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier of the user possessing tables. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** ALL Displays all the defined tables. ** [+COMMENT] This operand outputs the table comments. If this operand is not specified, no table comment is output. Notes: (1) If a character string that starts with a plus sign (+) is specified as the operand, and the character string that follows the plus sign is not COMMENT, an error occurs. Output contents: # Column name Number of Type Contents characters --+---------------+----------+---------+--------------------------------- 1 TABLE_SCHEMA 12 Character Authorization identifier(#1)(#2) 2 TABLE_NAME 30 Character Table identifier 3 N_COLS 6 Numeric Number of composition columns 4 N_INDEX 7 Numeric Number of index definitions 5 CREATE_TIME 14 Character Table creation time 6 COMMENT 255 Character Table comment(#3) #1: The results are sorted by this row in ascending order. #2: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 24. #3: Output when the +COMMENT option is specified. ---------------------------------------------------------------------- TRIGGERS ---------------------------------------------------------------------- Function TRIGGERS command lists the triggers owned by the specified authorization identifier. Format ---------------------------------------------------------------- TRIGGERS [ { authorization-identifier | ALL } ] ---------------------------------------------------------------- Operands ** authorization-identifier ~ (1 to 8 characters) Specify the authorization identifier of the user who owns the triggers. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** ALL Displays the triggers of all the defined users. Output contents: # Column name Number of Type Contents characters --+-------------+----------+---------+------------------------------------ 1 TRIGGER_NAME 39 Character Trigger name (#1) 2 SPECIFIC_NAME 30 Character Specific name of the trigger action procedure 3 TABLE_NAME 30 Character Name of the table in which the trigger is defined(#2) 4 ACT 3 Character Trigger action time(#2) 5 EVT 3 Character Trigger event type 6 TYP 3 Character Trigger action unit 7 VAL 3 Character Trigger/index enable flag 8 CREATE_TIME 16 Character Trigger creation time(#2) #1: (authorization-identifier.trigger-name) If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 61. #2: The results are sorted by the following rows. - TABLE_NAME (ascending order) - ACT (ascending order) - CREATE_TIME (ascending order) ---------------------------------------------------------------------- TYPES ( Displays an abstract data type ) ---------------------------------------------------------------------- Function The TYPES command displays the abstract data type possessed by the user of the specified authorization identifier. Format ---------------------------------------------------------------------- TYPES [[RD-node-name [.]] {authorization-identifier | ALL}] ---------------------------------------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier of the user possessing the abstract data type. If authorization-identifier is omitted, the authorization identifier in the CONNECT command is assumed. ** ALL Displays the abstract data types of all the defined users. Notes (1) This command can be used in HiRDB Version 5.0 or later. Output contents: # Column name Number of Type Contents characters --+-------------+----------+---------+------------------------------------ 1 TYPE_ID 12 Character Abstract data type ID(#1) 2 TYPE_NAME 39 Character Abstract data type name(#2) 3 N_ATTR 6 Numeric Number of composition attributes #1: The results are sorted by this row in ascending order. #2: If the setting to use mixed character data is specified in the default dictionary settings, the number of characters displayed will be 61. ---------------------------------------------------------------------- USERS ( Displays a user list ) ---------------------------------------------------------------------- Function The USERS command displays a user list. Format -------------------------------------------------------------- USERS [[RD-node-name[.]] {authorization-identifier | ALL}] -------------------------------------------------------------- Operands ** RD-node-name ~ (1 to 30 characters) Specifies the RD node name when the remote database is accessed. RD-node-name can be specified only when the remote database is HiRDB. If RD-node-name is omitted, the RD node name when the local database is accessed is assumed. ** authorization-identifier ~ (1 to 8 characters) Specifies the authorization identifier of the user to be displayed. If authorization-identifier is omitted, ALL is assumed. ** ALL Displays all users. Output contents: # Column name Number of Type Contents characters --+-------------+----------+---------+------------------------------------ 1 USER_ID 30 Character User ID(#1) 2 DBA 3 Character DBA privilege 3 SCHEMA 6 Character Schema definition privilege 4 CREATE_TIME 14 Character Schema creation time 5 TEST 4 Character Password restriction violator type code (if unchecked, space)(#2) #1: The results are sorted by this row in ascending order. #2: Output when connected to HiRDB V7 07-02 or a later version. ---------------------------------------------------------------------- < ( Enters the SQL and dsql commands from a file ) ---------------------------------------------------------------------- Function Read SQL or pdsql commands from a file and exeute them. Format -------------------------------------- < file-name << -------------------------------------- Operands ** file-name ~ Specifies the name of the file in which the SQL or pdsql commands are stored. Rules (1) If the file contains EXIT command, this program suspends reading process at the EXIT command. If you want to resume the reading process from the break point in the file, enter <<. (2) "<" command cannot be specified in a file to be read. Reference > ---------------------------------------------------------------------- > ( Outputs to a file ) ---------------------------------------------------------------------- Function Copy the SQL and pdsql commands read by this program into a file. Format -------------------------------------- > file-name -------------------------------------- Operands ** file-name ~ Specifies the name of the file into which the SQL or pdsql commands are copied. Rules (1) If you want to stop copying the SQL or pdsql commands, reenter ">". Notes (1) The ">" entered to stop copying is also copied into the file. If you want to use the file as input for "<" command, delete the ">" from the file before you use the file. Reference < ---------------------------------------------------------------------- /* ( Comment line ) ---------------------------------------------------------------------- Function This command treats a row as a comment line. Format -------------------------------------- /* comment [ */ ] -------------------------------------- Note - This command changes the whole line into comment. ---------------------------------------------------------------------- ! ( Executes a DOS command ) ---------------------------------------------------------------------- Function This program executes the DOS command specified after "!". Format -------------------------------------- ! DOS command -------------------------------------- Operands ** DOS command - Specify a DOS command. Note: - The semicolon character cannot be used as a DOS command. ---------------------------------------------------------------------- : ( Executes a server command ) ---------------------------------------------------------------------- Function This command executes the command specified after a colon (:) on the server side. Format -------------------------------------- : command -------------------------------------- Operands ** command Specifies the command to be executed on the server side. Notes - The HiRDB server that executes this command requires HiRDB Assist-Server. For details, see the following manuals: COMMAND EXECUTE Statement in the manual HiRDB SQL Reference Manual HiRDB UAP Development Guide - This function can be used in the following versions: HiRDB Version 6 06-00 or later Reference SET CMDBUF Appendix B. Messages -------------------------------------------------------------------------- (1)Format of message output -------------------------------------------------------------------------- -Messages are output to the standard output. ------------------------ KFPX27000-E xx....xx ------------------------ KFPX27000-E : Message ID xx....xx : Message text -------------------------------------------------------------------------- (2)Format of message description -------------------------------------------------------------------------- ---------------- KFPX27nnn-i ---------------------------------------------------------------- Message text ---------------------------------------------------------------- Provides the meaning of the message. (S):Indicates the action that this program takes for the output message. (P):Indicates the action that the user takes for the output message. nnn: Indicates the message number. i: Indicates the severity of the message. E: Error message (Indicates that a functional error has occurred.) W: Warning message (Either warns the user that, as a result of continuing the process, the system may enter an unexpected condition, or indicates that there was an error in a parameter value specification, but the process will continue by assuming a value.) I: Information message (Indicates a simple operational status that does not correspond to E or W above.) Q: Awaiting-response message (Indicates that the system is waiting for a user response in response to the output message.) Note For information about messages other than KFPX27nnn, see the manual, HiRDB Messages or XDM E2 System Messages (XDM/RD E2). -------------------------------------------------------------------------- (3)Message list -------------------------------------------------------------------------- ---------------- KFPX27001-I ---------------------------------------------------------------- Processing of SQL completed ---------------------------------------------------------------- Execution of the SQL statement has been completed. (S):Waits for the input of the next SQL or pdsql command. (P):Enter the next SQL or pdsql command. ---------------- KFPX27010-I ---------------------------------------------------------------- nnnn rows xxxx ---------------------------------------------------------------- nnn items of data were processed. xxxx: Indicates the data that was processed selected : nnn data items were selected. updated: nnn data items were updated. inserted: nnn data items were inserted. deleted: nnn data items were deleted. outputted: A file was output. (#1) #1: If an error message was displayed immediately before, the number of data items that contain error rows is displayed. If an error message was displayed immediately before, the operation specified by the SQL statement is suspended. Follow the instructions given in the error message and resolve the problem. (S):Waits for the input of the next SQL or pdsql command. (P):Enter the next SQL or pdsql command. ---------------- KFPX27011-E ---------------------------------------------------------------- PDSQLW2.EXE not found ---------------------------------------------------------------- PDSQLW2.EXE was not found. (S):This application is ended. (P):Install this program correctly. ---------------- KFPX27012-E ---------------------------------------------------------------- CODECONV.DLL not found ---------------------------------------------------------------- CODECONV.DLL was not found. (S):This application is ended. (P):Correctly install the code convert run time, and set the environment. ---------------- KFPX27013-E ---------------------------------------------------------------- KanjiLink XKP not found ---------------------------------------------------------------- KanjiLink XKP was not found. (S):This application is ended. (P):Correctly install KanjiLink XKP run time library, and set the environment. ---------------- KFPX27014-E ---------------------------------------------------------------- FILE I/O Error ( XXXXX ) ---------------------------------------------------------------- FILE I/O was failed. ( XXXXX ) (S):This application is ended. (P):Execute FILE I/O again after removing the error factor. XXXXX : Error code ---------------- KFPX27015-E ---------------------------------------------------------------- Shared Memory access Error ( XXXXX ) ---------------------------------------------------------------- Shared Memory processing was failed. ( XXXXX ) (S):When the problem is occured while processing the start, this application is ended. In other case, wait for the input of the next SQL or pdsql command. (P):Secure an enough memory, and start again or re-execute it. XXXXX : Error code ---------------- KFPX27016-E ---------------------------------------------------------------- Error occured on Code Convert Process ( RetCode=XXXXX, SysErr=YYYYY ) ---------------------------------------------------------------- Code Convert Run Time Process is wrong. ( code convert error code=XXXXX, error code=YYYYY ) (S):This application is ended. (P):Review the Code Convert Run Time Process, and reinstall it if necessary. ---------------- KFPX27017-E ---------------------------------------------------------------- Invalid character code in Input data ( RetCode=XXXXX ) ---------------------------------------------------------------- Invalid character code exists in Input data. ( code convert error code=XXXXX ) (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct data and then re-execute. ---------------- KFPX27018-E ---------------------------------------------------------------- nnn rows convert is failed, Line no. = XXXXX, YYYYY, ZZZZZ, ... ---------------------------------------------------------------- nnn rows convert has been failed. Line no = XXXXX, YYYYY, ZZZZZ, ... . (S):Waits for the input of the next SQL or pdsql command. (P):Enter the next SQL or pdsql command. ---------------- KFPX27021-E ---------------------------------------------------------------- More than 2097152 output length ---------------------------------------------------------------- The output length exceeds 2,097,152 bytes. (S):Waits for the input of the next SQL or pdsql command. (P):Correct the output length to 2,097,152 bytes or lower and then re-execute. ---------------- KFPX27032-I ---------------------------------------------------------------- 1 character changed ---------------------------------------------------------------- One character string has been changed. (S):If there are SQL waiting for execution, executes them as they are. (P):If there are no SQL waiting for execution, enter the next SQL or pdsql command. ---------------- KFPX27033-I ---------------------------------------------------------------- n characters changed ---------------------------------------------------------------- n character string has been changed. (S):If there are SQL waiting for execution, executes them as they are. (P):If there are no SQL waiting for execution, enter the next SQL or pdsql command. ---------------- KFPX27040-E ---------------------------------------------------------------- Invalid xxxx ---------------------------------------------------------------- xxxx is invalid. (S):Waits for the input of the next SQL or pdsql command. (P):Specify xxxx correctly and then re-execute. Cause and countermeasure when the variable section xxxx displays the password when the SET SESSION AUTHORIZATION statement is used to make an attempt to switch to a user whose password includes lower case letters and is 29 to 30 bytes long: A client library that cannot connect when a password that includes lowercase letters and is longer than 28 bytes is being referenced. Install a client library for which this connection problem has been corrected. ---------------- KFPX27041-E ---------------------------------------------------------------- Incomplete pdsql command ---------------------------------------------------------------- The command is incomplete. (S):Waits for the input of the next SQL or pdsql command. (P):Specify command correctly and then re-execute. ---------------- KFPX27042-E ---------------------------------------------------------------- More than nn ---------------------------------------------------------------- This value is greater than nn. (S):Waits for the input of the next SQL or pdsql command. (P):Specify a value less than nn and then re-execute. ---------------- KFPX27043-E ---------------------------------------------------------------- Not found before data ---------------------------------------------------------------- The pre-change character string does not exist. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct data and then re-execute. ---------------- KFPX27045-E ---------------------------------------------------------------- Number of variables invalid or number of parameters exceeds max parameters ---------------------------------------------------------------- The number of specified invalid variables or parameters exceeds the maximum number of parameters. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the number of valid variables or parameter so that it will not exceed the maximum number of parameters and then re-execute. ---------------- KFPX27047-E ---------------------------------------------------------------- Inconvertible data type of input variable ---------------------------------------------------------------- The data type of the entered variable cannot be converted. (S):Waits for the input of the next SQL or pdsql command. (P):Enter the correct variable and then re-execute. ---------------- KFPX27050-E ---------------------------------------------------------------- More then 32,000 characters in character string literal ---------------------------------------------------------------- The specified character string exceeds 32,000 bytes. (S):Waits for the input of the next SQL or pdsql command. (P):Specify a character string of 32,000 bytes or less and then re-execute. ---------------- KFPX27051-E ---------------------------------------------------------------- Invalid floating point numeric literal ---------------------------------------------------------------- The specified floating-point numeric literal is invalid. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct value and then re-execute. ---------------- KFPX27052-E ---------------------------------------------------------------- More then 30 characters in kanji identifier ---------------------------------------------------------------- The kanji identifier exceeds 30 characters. (S):Waits for the input of the next SQL or pdsql command. (P):Specify 30 kanji characters or less and then re-execute. ---------------- KFPX27053-E ---------------------------------------------------------------- More then 255 characters in identifier ---------------------------------------------------------------- The identifier exceeds 255 characters. (S):Waits for the input of the next SQL or pdsql command. (P):Specify 255 characters or less and then re-execute. ---------------- KFPX27054-E ---------------------------------------------------------------- Invalid national character string literal ---------------------------------------------------------------- The specified national character string literal is invalid. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct national character string literal and then re-execute. ---------------- KFPX27055-E ---------------------------------------------------------------- more then 16,000 characters in national character string literal ---------------------------------------------------------------- The specified national character string literal exceeds 16,000 characters. (S):Waits for the input of the next SQL or pdsql command. (P):Specify a national character string literal of 16,000 characters or less and then re-execute. ---------------- KFPX27056-E ---------------------------------------------------------------- Invalid kanji identifier ---------------------------------------------------------------- The specified kanji identifier is invalid. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct kanji identifier and then re-execute. ---------------- KFPX27057-E ---------------------------------------------------------------- Numeric literal out of range ---------------------------------------------------------------- The specified numeric literal is out of range. (S):Waits for the input of the next SQL or pdsql command. (P):Change the numeric literal to a value within the range and then re-execute. ---------------- KFPX27058-E ---------------------------------------------------------------- Invalid numeric literal ---------------------------------------------------------------- The specified numeric literal is invalid. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the valid numeric literal and then re-execute. ---------------- KFPX27059-E ---------------------------------------------------------------- Input data too large for column ---------------------------------------------------------------- Input data exceeds the column definition length or the maximum number of repetition elements. Alternatively, input data exceeds the range specified by the SET ARRAY LIMIT, SET BINARY LIMIT, SET BLOB LIMIT, or SET CHAR LIMIT command that changes the area size. (S):Waits for the input of a SQL or pdsql command. (P):Specify input data so that it will not exceed the column definition length or area size and then re-execute. Alternatively, execute a command that changes the area size. ---------------- KFPX27060-E ---------------------------------------------------------------- Insufficient memory on PROCESS, size=aa..aa ---------------------------------------------------------------- aa..aa : Size of the area that was to be allocated (in bytes) A memory shortage occurred on PROCESS. (S): Waits for the input of the next SQL or pdsql command. (P): Allocate sufficient memory and then re-execute. If this memory shortage occurred in the SQL that uses the ? parameter, the parameter area is too large. In this case, change the SQL to a SQL that narrows down target columns or execute a command that changes the area size to reduce the parameter area. In the retrieval SQL, the maximum length of the string data to be obtained may be too big. If the extracted string contains the BINARY/BLOB/CLOB type, execute the SET SPLIT SIZE command and set split and obtain. ---------------- KFPX27062-E ---------------------------------------------------------------- Invalid data type of operand ---------------------------------------------------------------- The data type of an invalid operand was specified. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the data type of the valid operand and then re-execute. ---------------- KFPX27063-E ---------------------------------------------------------------- Invalid precision or scale in scalar function ---------------------------------------------------------------- An invalid precision or scale was specified in the scalar function. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct value and then re-execute. ---------------- KFPX27064-E ---------------------------------------------------------------- Overflow in scalar function ---------------------------------------------------------------- The specified scalar function is out of range. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct scalar function within the range and then re-execute. ---------------- KFPX27065-E ---------------------------------------------------------------- Block/iterate cannot nest ---------------------------------------------------------------- The block statement cannot be specified in the Block/iterate statement. (S):Waits for the input of the next SQL or pdsql command. (P):Cancel the block statement specification and then re-execute. ---------------- KFPX27066-E ---------------------------------------------------------------- Invalid character expression for data type date ---------------------------------------------------------------- The character expression specified as the date attribute is invalid. (S):Waits for the input of a SQL or pdsql command. (P):Specify the correct character expression and then re-execute. ---------------- KFPX27067-E ---------------------------------------------------------------- Invalid token of operand ---------------------------------------------------------------- The syntax (token) of the operand is invalid. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct syntax (token) and then re-execute. ---------------- KFPX27068-E ---------------------------------------------------------------- Not found variable identifier ---------------------------------------------------------------- The specified variable was not found. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct variable and then re-execute. ---------------- KFPX27069-E ---------------------------------------------------------------- More than 50 block items, Enter ITERATE command ---------------------------------------------------------------- More than 50 SQL or pdsql command statements were specified in the Block/iterate statement. (S): Waits for the input of the next SQL or pdsql command. (P): Enter the ITERATE command. ---------------- KFPX27070-E ---------------------------------------------------------------- Command "<" cannot nest ---------------------------------------------------------------- The "<" command cannot be specified in the read file. (S):Skips the appropriate statement and reads the next statement. (P):Eliminate the "<" command from the read file and then re-execute. ---------------- KFPX27072-E ---------------------------------------------------------------- Command error, aa..aa not found ---------------------------------------------------------------- identifier type = aa..aa identifier type ::= { Table | Sequence } The specified aa..aa was not found. (S):Waits for the input of the next SQL or pdsql command. (P):Remove the cause of the error and then re-execute. ---------------- KFPX27073-E ---------------------------------------------------------------- System call error, func=aa..aa, errno=bbb ---------------------------------------------------------------- aa..aa : Name of the system call where the error occurred bbb : : Error number returned by the system call An error occurred in the system call indicated by aa....aa. (S):Waits for the input of a SQL or pdsql command. (P):Remove the cause of the error and then re-execute. ---------------- KFPX27074-E ---------------------------------------------------------------- ioctl error, errno=xx ---------------------------------------------------------------- ioctl error. Detailed error code =xx (S):Waits for the input of the next SQL or pdsql command. (P):Remove the cause of the error and then re-execute. ---------------- KFPX27075-E ---------------------------------------------------------------- fdopen error, errno=xx ---------------------------------------------------------------- fdopen error. Detailed error code =xx (S):Waits for the input of the next SQL or pdsql command. (P):Remove the cause of the error and then re-execute. ---------------- KFPX27076-E ---------------------------------------------------------------- fclose error, errno=xx ---------------------------------------------------------------- fclose error. Detailed error code =xx (S):Waits for the input of the next SQL or pdsql command. (P):Remove the cause of the error and then re-execute. ---------------- KFPX27077-E ---------------------------------------------------------------- fflush error, errno=xx ---------------------------------------------------------------- fflush error. Detailed error code =xx (S):Waits for the input of the next SQL or pdsql command. (P):Remove the cause of the error and then re-execute. ---------------- KFPX27078-E ---------------------------------------------------------------- open error, errno=xx ---------------------------------------------------------------- open error. Detailed error code =xx (S):Waits for the input of the next SQL or pdsql command. (P):Remove the cause of the error and then re-execute. ---------------- KFPX27079-E ---------------------------------------------------------------- aa..aa error, errno=bb..bb ---------------------------------------------------------------- aa..aa error. Detailed error code =bb..bb (S):Waits for the input of the next SQL or pdsql command. (P):Remove the cause of the error and then re-execute. ---------------- KFPX27080-E ---------------------------------------------------------------- Inconvertible data type in comparison predicate ---------------------------------------------------------------- An inconvertible data type was specified in the comparison predicate. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct data type and then re-execute. ---------------- KFPX27086-E ---------------------------------------------------------------- fputs error, errno=xx ---------------------------------------------------------------- fputs error. Detailed error code =xx (S):Waits for the input of the next SQL or pdsql command. (P):Based on the error number (errno: external variable indicating the error status), see the reference manuals for errno.h and fputs, eliminate the cause of the error, and then re-execute. ---------------- KFPX27087-E ---------------------------------------------------------------- Write error, errno=xx. ---------------------------------------------------------------- Write error. Detailed error code =xx. (S):Waits for the input of the next SQL or pdsql command. (P):Based on the error number (errno: external variable indicating the error status), see the reference manuals for errno.h and write, eliminate the cause of the error, and then re-execute. ---------------- KFPX27090-E ---------------------------------------------------------------- GUI MODE cannot "XXXXX" command ---------------------------------------------------------------- The command indicated by XXXXX cannot be used on GUI. (S):Waits for the input of the next SQL or pdsql command. (P):Specify this command in a file or specify another command and then re-execute. ---------------- KFPX27091-E ---------------------------------------------------------------- Not found ";" after command ---------------------------------------------------------------- A semicolon (;) was not found at the end of the SQL or pdsql command. (S):Waits for the input of the next SQL or pdsql command. (P):Add a semicolon (;) and then re-execute. ---------------- KFPX27092-I ---------------------------------------------------------------- Processing of SET XXXXX command completed ---------------------------------------------------------------- The SET XXXXX command (pdsql command) has been executed. (S):Waits for the input of the next SQL or pdsql command. (P):Enter the next SQL or pdsql command. ---------------- KFPX27093-E ---------------------------------------------------------------- GUI MODE cannot "?" parameter ---------------------------------------------------------------- The "?" parameter cannot be used on GUI. (S):Waits for the input of the next SQL or pdsql command. (P):Execute the SQL or pdsql command without using the "?" parameter. ---------------- KFPX27094-E ---------------------------------------------------------------- Error occurred on HiRDB. SQLCODE = xx ---------------------------------------------------------------- An error occurred in HiRDB. SQL code = xx (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct data type and then re-execute. ---------------- KFPX27097-I ---------------------------------------------------------------- Auto commit ( XXX -> YYY ) ---------------------------------------------------------------- The Auto Commit status changed from XXX to YYY. (S):Waits for the input of the next SQL or pdsql command. (P):Enter the next SQL or pdsql command. ---------------- KFPX27098-I ---------------------------------------------------------------- Auto rollback ( XXX -> YYY ) ---------------------------------------------------------------- The Auto Rollback status changed from XXX to YYY. (S):Waits for the input of the next SQL or pdsql command. (P):Enter the next SQL or pdsql command. ---------------- KFPX27901-I ---------------------------------------------------------------- Processing of XXXXX command completed ---------------------------------------------------------------- The XXXXX command (pdsql command) has been executed. (S):Waits for the input of the next SQL or pdsql command. (P):Enter the next SQL or pdsql command. ---------------- KFPX27903-W ---------------------------------------------------------------- Invalid environment definition, variable= XXXXX ---------------------------------------------------------------- The environment variable XXXXX is invalid. (S):Waits for the input of the next SQL or pdsql command. (P):Enter the next SQL or pdsql command. Alternatively, stop the pdsql command, specify the correct value, and then re-execute. ---------------- KFPX27904-I ---------------------------------------------------------------- Execute server command, return code = xx ---------------------------------------------------------------- A server command was input. xx: If this message was output together with the KFPZ02470-E or KFPZ02471-E message, it indicates the return code of the COMMAND EXECUTE statement. In all other cases, this message indicates the execution command return code of the COMMAND EXECUTE statement. In either case, see COMMAND EXECUTE in the manual "HiRDB SQL Reference." (S): Waits for the input of the next SQL or pdsql command. (P): Enter the next SQL or pdsql command. ---------------- KFPX27905-E ---------------------------------------------------------------- Invalid HiRDB Client Library Installed ---------------------------------------------------------------- An invalid HiRDB client library is installed. (S): Waits for the input of the next SQL or pdsql command. (P): Input the next SQL or pdsql command. The following indicates the prerequisite version of the HiRDB client library for the function. - Server command execution: Version 06-00 or later - Display of result collection: Version 07-02 or later Confirm the following and take appropriate action if necessary. - No old client library remains in the directory indicated by the environment variable PATH. ---------------- KFPX27906-E ---------------------------------------------------------------- Number of datas in input file not equal to questions, line = xx ---------------------------------------------------------------- The number of ? parameters to be stored does not match the number of questions. Input data line=xx (S):Processes the next data line. (P):Correct the data of the appropriate line number in the input data file. ---------------- KFPX27907-E ---------------------------------------------------------------- Unable to specify XXXX operand with YYYY operand ---------------------------------------------------------------- The XXXX operand cannot be specified when the YYYY operand is specified. (S):Waits for the input of the next SQL or pdsql command. (P):Specify the correct combination of operands and then re-execute. ---------------- KFPX27909-E ---------------------------------------------------------------- Command "QUIT" can be used only under BLOCK/ITERATE or ? paramete input exception ---------------------------------------------------------------- The "QUIT" command can be used only in the BLOCK statement or in ? parameter input. (S):Waits for the input of the next SQL or pdsql command. (P):Enter the next SQL or pdsql command. ---------------- KFPX27910-E ---------------------------------------------------------------- Sum of columns length exceeds 4GB ---------------------------------------------------------------- Retrieval results data length and input/output parameter length have exceeded 4 GB. (S): Wait for SQL or pdsql command input. (P): Change the length of the retrieval results data and input/output parameter equal to or less than 4GB and then re-execute the program. In the search SQL, the maximum length of the string data to be obtained may be too big. If the extracted string contains the BINARY/BLOB/CLOB type, execute the SET SPLIT SIZE command and set split and obtain. ---------------- KFPX27911-E ---------------------------------------------------------------- Invalid data type of retrieval item XX ---------------------------------------------------------------- The data type of the XXth retrieval item is incorrect. (S): Wait for SQL or pdsql command input. (P): Enter the following SQL or pdsql command: ---------------- KFPX27912-E ---------------------------------------------------------------- Invalid data type of "?" parameter XX ---------------------------------------------------------------- The data type of the XXth "?" parameter is incorrect. (S): Wait for SQL or pdsql command input. (P): Enter the following SQL or pdsql command: ---------------- KFPX27913-E ---------------------------------------------------------------- Invalid BOM in Unicode file ---------------------------------------------------------------- Unicode files include invalid BOMs (Byte Order Mark). BOMs are in the big endian mode. (S): Wait for SQL or pdsql command input. (P): Specify a file with the little endian mode and re-execute the program. ---------------- KFPX27914-E ---------------------------------------------------------------- Selected SQL not equal to the SQL to be executed ---------------------------------------------------------------- The selected SQL and the SQL to be executed do not match. (S): Waits for the input of the "OK" button. (P): Select the same SQL as the SQL to be executed. ---------------- KFPX27915-E ---------------------------------------------------------------- XXXX Error code=YY name=ZZZZ ---------------------------------------------------------------- The selected SQL and the SQL to be executed do not match. (S): Waits for the input of the "OK" button. (P): Select the same SQL as the SQL to be executed. ---------------- KFPX27916-E ---------------------------------------------------------------- More than 2000000 input length ---------------------------------------------------------------- Input of the SQL or pdsql command exceeds 2000000 bytes (in the Unicode version, 2000000 characters). (S): Suspends processing. (P): Input a SQL or pdsql command of 2000000 bytes (in the Unicode version, 2000000 characters) or less. ---------------- KFPX27917-E ---------------------------------------------------------------- More than 32760 input line length ---------------------------------------------------------------- The input character string in one line exceeds 32760 characters. (S): Suspends processing. (P): Edit the input character string so that one line does not contain more than 32760 characters. ---------------- KFPX27918-E ---------------------------------------------------------------- Invalid -u option on security mode ---------------------------------------------------------------- With a security enhancement mode, -u option is unjust. (S): Exit this program. (P): Review an argument at the time of the start, and, please carry it out. ---------------- KFPX27919-E ---------------------------------------------------------------- HiRDB SQL Executer not installed ---------------------------------------------------------------- There is an error of either next. - HiRDB SQL Executer not installed - Installation environment of HiRDB SQL Executer is injustice. (S):Exits HiRDB SQL Executer. (P):Reinstall HiRDB SQL Executer. ---------------- KFPX27921-E ---------------------------------------------------------------- No data in input data file ---------------------------------------------------------------- The input data file does not contain any data. (S): Waits for the input of the next SQL or pdsql command. (P): Specify the input data file that contains the data, and then retry the operation. ---------------- KFPX27922-E ---------------------------------------------------------------- Unable to execute XXXX with YYYY mode ---------------------------------------------------------------- Command or SQL = XXXX Mode name = YYYY Mode name ::= { analysis } A command or SQL statement specified in YYYY mode cannot be executed. (S): Waits for the input of the next SQL or pdsql command. (P): Check the condition and the command or the combination of SQL. ---------------- KFPX27923-E ---------------------------------------------------------------- Cannot XXXX command, YYYY ---------------------------------------------------------------- Command=XXXX Condition=YYYY The specified command cannot be executed for the condition indicated by YYYY. (S): Waits for the SQL pdsql command to be input. (P): Check the condition and the command. ---------------- KFPX27924-I ---------------------------------------------------------------- Transaction XXXX by WHENEVER specification ---------------------------------------------------------------- commit or rollback = XXXX The transaction was completed with the status indicated by XXXX according to the WHENEVER command specification. (S): Waits for the input of the next SQL or pdsql command. (P):Enter the next SQL or pdsql command. Appendix C. Data input using ? parameter (*)value input request If you enter a SQL specifying ?, this program outputs the following message to ask you to enter a value: DATA ( 1) ? : DECIMAL(29,10) ARRAY[4] : VALUE(NULL) | | | (1) (2) (3) (1)Represents what number of the ? parameter in the SQL corresponds to the input request. (2)Data type of the ? parameter The data type returned by the server is displayed as ? parameter information. Indicates the data type. For details, see "Table A-5. Data Code Value and Displayed Character String" in the description of the TABLEINF command. Note that parameter input or output for an abstract data type cannot be performed. For a NOT NULL constraint column, this field indicates the NOT NULL qualifier. If the data type is a repetition column, displays ARRAY[n] (n: repetition count) qualification representation. For the ? parameter contained in the value expressing IS NULL, input SQLCODE = 0x01. If the data type is not set, represents it in **. (3)Represents the settings when * is entered. If the data type is a character string type ([M | N][VAR]CHAR), large object data type (BLOB,CLOB), or BINARY type, displays up to 16 bytes and omits the subsequent display. If the data type is a large object data type (BLOB) or BINARY type, displays data in hexadecimal. (However, if the data type is a large object data type (BLOB) or BINARY type and the data length is 0, represents data in twice apostrophe marks ('').) If the data type is a repetition column, displays only the data of the first element. (*)Value input There are four value input formats for the ? parameter: "value input", "hexadecimal input","FILE file-name", and "*". - "Value input" means any of the following values: Integer literal Decimal literal Floating-point numeric literal Character string literal National character string literal Mixed character string literal NULL For details on the above values, see the manual HiRDB SQL Reference. - "Hexadecimal input" means a character string that begins with "0x" (or "0X") and is followed by several hexadecimal characters. - "FILE file-name" means input from the specified file. - "*" means input of the value displayed in the input request message. (*)Input rules 1.Whole - No request is made for input to the ? parameter. Therefore, within the file, you must specify an input value after the SQL that specifies the ? parameter. - To end input of the parameter values, input a semicolon at the end of the line to indicate a line-feed. - For the large object data type (BLOB), BINARY type or CLOB type, you can input using a character string literal, the "hexadecimal input" format or the "file input" format. - Empty sending causes an error. - For input to a repeating column, use ARRAY[] as shown below. CREATE TABLE T(C INTEGER ARRAY[3]); INSERT INTO T VALUES(?); ARRAY[100,200,300]; The formats you can specify within parentheses are "value input," "hexadecimal input" and "*". - If you want to stop the program from asking you to enter a value, and want to cancel the SQL specifying ? parameter, enter QUIT. 2."Value input" format - Represent the real part (integer part and fraction part) and exponent part of an integer literal, decimal literal, or floating-point numeric literal with up to 38 digits. - If data is entered beyond the storable range (e.g., input of a fractional part for the integer type) when the data type is an integer numeric type (INTEGER, SMALLINT) or a fixed-point number type (DECIMAL, INTERVAL YEAR TO SECOND, INTERVAL YEAR TO DAY, INTERVAL HOUR TO SECOND), an error occurs. 3."Hexadecimal input" format Specify a character string that begins with "0x" (x may be an uppercase character) and is followed by several hexadecimal characters. - This format cannot be used for the floating-point type (FLOAT, REAL). - If the number of input digits is odd, 0 is added to the beginning of data for processing. Example) Input: 0x100 Processing value: 0x0100 - If input exceeds the defined length of each type, an error occurs. Example) Target data type: CHAR(4) Input: 0x413132333435 An error occurs because input represents 6 bytes. - If the data type is an integer numeric type (INTEGER, SMALLINT), input data (hexadecimal representation) is converted to decimal data and set. Example) Target data type: INTEGER Input: 0x00001000 Setting: 4096 - If the data type is a fixed-point type (DECIMAL, INTERVAL YEAR TO SECOND, INTERVAL YEAR TO DAY, INTERVAL HOUR TO SECOND), input data is set as consecutive byte values. If the input format is a packed decimal format, write input data tailored to the defined length. Example) Target data type: DECIMAL(10,4) ...The defined length is 6 bytes. Input: 0x01234567891C Setting: 123456.7891 - If the data type is other than the integer numeric type and fixed-point type, input data is set as consecutive byte values. Example) Target data type: VARCHAR(16) Input: 0x41313233 Setting: 'A123' 4.File input format Format: FILE file-name Operand: file-name File name Specify the file name of the file to which input data (binary) is stored. Description: Input data from the specified file. - Consecutive bytes in the file (binary including control characters) will be the input data. - Specify an absolute path for file-name. - If file-name contains a space (X'20') or tab (X'09'), double quotation marks must be added for file-name. Example: FILE "C:\TEMP\DA DC.TXT"; - If the specified file does not exist, an error will occur. - This format is valid only for the character string type ([M | N][VAR]CHAR), TIME type, DATE type, TIMESTAMP type, maximum data type (BLOB), BINARY type, and CLOB type. 5."*" For details on "*" input, see "Appendix D. "*" input rules". Appendix D. "*" input rules 1. When you enter a SQL specifying ? parameter The previously entered value is used as the value displayed in the input request message only if all the following conditions are satisfied: - The same SQL as the previous SQL is executed. - The command that changes the transfer area size between the previous SQL (SET ARRAY LIMITSET BINARY LIMIT,SET BLOB LIMIT,SET CHAR LIMIT, SET NCHAR LIMIT) are not executed. In the following cases, however, the previously entered value (appropriate data) is invalid even if the same SQL as the previous SQL is executed (the value becomes undefined): - Implicit conversion between numeric values is used. - An error (error beginning with KFPX) occurred in SQL Executer. - An invalid data type error occurs. - The data entered as the retrieval condition value is longer than the defined length. In other cases, any of the following values is used depending on the data type definition: Data type definition Value ---------------------------+---------------- (When the NOT NULL constraint is missing) NULL With NOT NULL constraint INTEGER 0 SMALLINT 0 DECIMAL 0 FLOAT 0 SMALLFLT 0 CHARACTER(n) n-byte space VARCHAR(n) 1-byte space NCHAR(n) n-character space NVARCHAR(n) 1-character space MCHAR(n) n-byte space MVARCHAR(n) 1-byte space DATE 0001-01-01 TIME 00:00:00 INTERVAL YEAR TO SECOND 0 year 0 month 0 day 0 hour 0 minute 0 second INTERVAL YEAR TO DAY 0 year 0 month 0 day INTERVAL HOUR TO SECOND 0 hour 0 minute 0 second BLOB(n) Data whose length is 0 TIMESTAMP 0001-01-01 00:00:00 BINARY(n) Data whose length is 0 CLOB(n) Data whose length is 0 2. When you enter a GETFILE command In any cases, the following values is used depending on the data type definition: Data type definition Value ---------------------------+---------------------------- (When the NOT NULL constraint is missing) NULL With NOT NULL constraint INTEGER 0 SMALLINT 0 DECIMAL 0 FLOAT 0 SMALLFLT 0 CHARACTER(n) n-byte space VARCHAR(n) 1-byte space NCHAR(n) n-character space NVARCHAR(n) 1-character space MCHAR(n) n-byte space MVARCHAR(n) 1-byte space DATE 0001-01-01 TIME 00:00:00 INTERVAL YEAR TO SECOND 0 year 0 month 0 day 0 hour 0 minute 0 second INTERVAL YEAR TO DAY 0 year 0 month 0 day INTERVAL HOUR TO SECOND 0 hour 0 minute 0 second BLOB(n) Data whose length is 0 TIMESTAMP 0001-01-01 00:00:00 BINARY(n) Data whose length is 0 CLOB(n) Data whose length is 0 Appendix E. XDM/RD E2 Connection For details about the XDM/RD E2 data types and SQL description formats that can be used when you connect to XDM/RD E2, see Basic Items in the manual, HiRDB XDM/RD E2 Connection Features. 1. Notes on Data Types 1.1 BOOLEAN type - You cannot retrieval columns with these data types. - You cannot use the ? parameters. 1.2 CHAR type or MCHAR type - If you enter data that includes 2-byte characters into the ? parameter, XDM/RD E2 will execute character code conversion and extend the data length, resulting sometimes in an SQL error. In such cases, specify NONE for the SET PADDING CHAR command. 1.3 INTERVAL YEAR TO SECOND type or INTERVAL HOUR TO SECOND type or TIME type or SMALLFLT type When these data types are used, data input/output will be performed after Executer changes the data types indicated in Table E-1. Table E-1 : Changing data types for XDM/RD E2 connection Data type Data type after change ---------------------------+----------------------------------- INTERVAL YEAR TO SECOND(n) DECIMAL(14+n,n) INTERVAL HOUR TO SECOND(n) DECIMAL(6+n,n) TIME(n) CHAR(m) n=0:m=8 n>0:m=9+n SMALLFLT FLOAT 2. Notes on the pdsql Commands For the list of pdsql commands, see "Table 8-1 pdsql commands that can be executed by this program". 2.1 Unusable commands You cannot use the ": (Executes a server command)" command. 2.2 Dictionary information display commands To use dictionary information display commands, you need to define the "HiRDB compatible dictionary review". For details about the "HiRDB compatible dictionary review", see User's Manual for XDM E2 System XDM/RD E2, Operations. Assume that you use a schema name that contains nine or more characters. The following commands that when the result of command execution displays the character string containing the schema name, it does not display the portion that exceeds the column width. CONSTRAINTS , RDAREAINF , SEQUENCES , TABLES , TRIGGERS , TYPES 3. Executable SQL and End Specification for SQL Statements 3.1 Executable SQL Table E-2 lists SQL executable for the XDM/RD E2 connection. For details about the SQL syntax, see XDM E2 System XDM/RD E2 SQL References. Table E-2 : SQL Executable in This Program Executable SQL Description ----------------------------------------------------------------------------- Definition-related SQL Schema definition CREATE SCHEMA Defines a schema. DROP SCHEMA Drops the schema. Table definition ALTER TABLE Alter the table definition. CREATE TABLE Defines a table. DROP TABLE Drops the table. View definition CREATE VIEW Defines a view table. DROP VIEW Drops the view table. Index definition CREATE INDEX Defines an index. DROP INDEX Drops the index. Procedure definition ALTER PROCEDURE Alter the procedure. CREATE PROCEDURE (#1) Defines procedure. DROP PROCEDURE Drops the procedure. Alias definition CREATE ALIAS Defines an alias. DROP ALIAS Drops the alias. Function re-creation ALTER FUNCTION Alter a function. Function definition CREATE FUNCTION (#2) Defines a function. DROP FUNCTION Drops the function. Type definition CREATE TYPE (#3) Defines a type. User-defined type DROP TYPE Drops the abstract deletion data type, individual type, and named-row type. Trigger definition ALTER TRIGGER Alter a trigger SQL object. CREATE TRIGGER (#4) Defines a trigger. DROP TRIGGER Drops the trigger. Sequence generator ALTER SEQUENCE Alter the sequence definition generator definition. CREATE SEQUENCE Defines a sequence generator. DROP SEQUENCE Drops the sequence generator. RD-node support CREATE NONLOCAL Defines support for the definition TABLE RD node and table. DROP NONLOCAL Drops the definitions TABLE supporting the RD-node and table. Role definition CREATE ROLE Defines a role. DROP ROLE Drops the role. User attribute change ALTER USER Alter user attributes. Privilege definition Subsystem privilege GRANT DBA Grants the DBA privilege. REVOKE DBA Revokes the DBA privilege. GRANT CONNECT Grants the CONNECT privilege. REVOKE CONNECT Revokes the CONNECT privilege. Schema definition GRANT SCHEMA Grants the schema privilege definition privilege. REVOKE SCHEMA Revokes the schema definition privilege. Access privilege GRANT access privilege Grants the access privilege. REVOKE access privilege Revokes the access privilege. RDAREA usage GRANT RDAREA Grants the RDAREA usage privilege privilege. REVOKE RDAREA Revokes the RDAREA usage privilege. User-defined type GRANT user-defined Grants the user-defined privilege type privilege type privilege. REVOKE user-defined Revokes the type privilege user-defined type privilege. Sequence GRANT sequence Grants the sequence generator privilege generator privilege generator privilege. REVOKE sequence Revokes the sequence generator privilege generator privilege. Role usage GRANT roll-usage Grants the role usage privilege privilege privilege. REVOKE roll-usage Revokes the role usage privilege privilege. Comments addition COMMENT Adds comments to tables and columns. ----------------------------------------------------------------------------- Operation-related SQL Row deletion DELETE Deletes rows. Row insertion INSERT Inserts rows. Deleting all rows PURGE TABLE Deletes all rows. Retrieval SELECT (#6) Retrieve the table for data. Row updating UPDATE Updates data in a table. ----------------------------------------------------------------------------- Control-related SQL Transaction termination COMMIT Terminates the transaction. Table lock LOCK Locks the table. Transaction cancel ROLLBACK Cancels the transaction. ----------------------------------------------------------------------------- SQL control statement Calling procedure CALL (#5) Calls procedure. ----------------------------------------------------------------------------- #1: When specifying CREATE PROCEDURE, add END_PROC to the end of a line. Example: CREATE PROCEDURE P1() BEGIN INSERT INTO T1 (C1) VALUES(10) ; UPDATE T1 SET C1 = 0 WHERE C1 < 10 ; END END_PROC; #2: When specifying CREATE FUNCTION, add END_FUNC to the end of a line. Example: CREATE FUNCTION FUNC1( NUM1 INTEGER,NUM2 INTEGER ) RETURNS INTEGER BEGIN DECLARE SUM1 INTEGER; SET SUM1 = NUM1 + NUM2; RETURN SUM1; END END_FUNC; #3: When specifying CREATE TYPE, add END_TYPE to the end of a line. Example: CREATE TYPE TEL( NAME VARCHAR(15),TEL_NO INTEGER ) END_TYPE; #4: When specifying CREATE TRIGGER, add END_TRIG to the end of a line. Example: CREATE TRIGGER TRIG1 AFTER INSERT ON T0 FOR EACH ROW INSERT INTO T1 VALUES(10, 'ABC') END_TRIG; #5: If the procedure called by the CALL statement has parameters, specify as many ?'s as the number of parameters in the procedure argument. After the CALL statement is executed, requests for responses are made as many times as the number specified. Specify the corresponding values. (Example) Procedure: CREATE PROCEDURE BOUNUS_CNTS(IN VAL INTEGER,OUT POINT INTEGER) BEGIN SET POINT = VAL + 100; END END_PROC; Example of Call Statement execution: call BOUNUS_CNTS(?,?); DATA ( 1) ? : INTEGER : VALUE(NULL) ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+ 5000; POINT ------------ 5100 #6: You can specify only dynamic SELECT statement. You cannot set the cursor specification. 3.2 End specification of SQL statement If there is semicolon (;) at the end of one line, it processes assuming to be SQL statement so much. If there is no semicolon, the line is treated assuming that it continues to the following line. no semicolon. (Example) CREATE TABLE T1(C1 INT, (Continue) C2 CHAR(10), (Continue) C3 CHAR(10)); (End of SQL statement) - The length of one line should be within 65530 characters. Appendix F. Differences between the SJIS Version and Unicode Version 1. Prerequisites You can use the SJIS version of the program only when the codes of character data passed to and from HiRDB Client are in SJIS. You can use the Unicode version of the program only when the codes of character data passed to and from HiRDB Client are in Unicode (UCS2). The code of character data passed to and from the HiRDB Client is determined by the character codes of the HiRDB server and the value of environment variable PDCLTCNVMODE. For more details, see the HiRDB manual, UAP Developer's Guide or HiRDB User's Guide, UCS2 Support in HiRDB Client. 2. Usable Character Sets You can use the character sets supported by the operating system (OS) with the coding method for either Shift JIS or UCS2. The SJIS version uses Shift JIS for the coding method, making the Windows Codepage 932 character set available. You can also use external characters by registering them in the OS. The Unicode version uses UCS2 for the coding method, making a wider range of characters available than that of the SJIS version. However, the Windows command prompt supports only Windows Codepage 932 as the means of displaying Japanese, and therefore, in the line mode version, you cannot display characters that are not included in the Windows Codepage 932 character set. In the GUI version, you can display all Unicode characters supported by the OS. *: Windows Codepage 932 consists of JIS X 0201:1997 (Latin characters and Katakana), JIS X 0208:1997, NEC special characters (section 13), NEC-selected IBM extended characters (sections 89-92), and IBM extended characters (sections 115-119). 3. Input Text Files In this document, following files are referred to as input text files. - files specified in the Run from File menu of the GUI version of the program. - files specified in the pdsql command "<" of the line mode version. - files that re-direct standard inputs in the line mode version. - files specified in the GETFILE command of the line mode version (the GUI version does not have the GETFILE command). - files specified by "FILE Filename" for the character string type data in the ? parameter in the line mode version. In the SJIS version, you need to use the Shift JIS format for input text files. In the Unicode version, you need to use the UCS2 format for input text files. You need to use the little endian mode for the byte order. The BOM (Byte Order Mark) that can be added to the top of a file is 0xFFFE. The BOM is not necessarily required. Use of the big endian BOM (0xFEFF) will result in an error. 4. Output Text Files In this document, the following files are referred to as output text files. - files specified in the pdsql command ">" of the line mode version (the GUI version does not have the ">" command). - output files in the FIX and DAT formats for the PUTFILE command of the GUI and line mode versions. In the SJIS version, output text files take the Shift JIS format. In the Unicode version, output text files take the UCS2 format. You need to use the little endian mode for the byte order. The BOM (Byte Order Mark = 0xFFFE) is added to the top of a file. 5. Notes - You cannot use the Unicode version of the program in Windows Me. - In the line mode version of the program with the Unicode version, when you re-direct the display contents for the command prompt to a file, the file will take the Shift JIS format, not the UCS2 format. Appendix G. Effect of The SQL Reserved Word Deletion Function Among the functions provided by the pdsql command and SQL Executer, there are some functions that issue SQL statements that use reserved words that the HiRDB server's SQL reserved word deletion function can delete. In the table below, the commands/functions that you can no longer use due to the syntax error that occurs when you delete a reserved word. Table G-1 : Command/function that is no longer available Reserved word Command/function that is no longer available --------------+---------------------------------------------------------- CASE TABLEINF , TRIGGERS ELSE TABLEINF , TRIGGERS END TABLEINF , TRIGGERS FREE (SET SPLIT SIZE splits and obtains the large object data) NOWAIT COLUMNS , CONSTRAINTS , DESCRIPTORS , FILES , INDEXCLM , INDEXES , LOBS , PRPARAMS , RDAREAINF , RDAREAS , ROUTINES , SEQINF , SEQUENCES , SERVERS , SOURCE , TABLEINF , TABLES , TRIGGERS , TYPES , USERS SUBSTR COLUMNS , CONSTRAINTS , DESCRIPTORS , INDEXCLM , LOBS , PRPARAMS , ROUTINES , SEQUENCES , SERVERS , TABLEINF , TABLES , TRIGGERS , TYPES THEN TABLEINF , TRIGGERS VALUE COLUMNS , DESCRIPTORS , INDEXCLM , INDEXES , PRPARAMS , RDAREAS , SEQINF , SEQUENCES , TABLEINF , USERS WHEN TABLEINF , TRIGGERS