& SUMMARY Û SUMMARY Û conventions ß Basic card commands ß authenticate begin transaction change password check commit create application create dictionary create key create table create user create view declare cursor delete user drop table drop view erase fetch fetch_next grant insert next open present revoke rollback status updatec unlock ß Host commands compiled ß delete from select update ß Host management commands ß assist close Trace check space connect disconnect display exec open trace pause quit set connection trace off trace on &S CONNECT Û CONNECT (Reset the card). Establishes a CQL-session in an CQL environment. þ FORMAT : CONNECT TO [ USER ] ; := AS := com1|com2|com3|com4|lpt1|lpt2|lpt3|lpt4 := identifier þ EXAMPLES : CONNECT TO com2 AS cql; CONNECT TO com1 AS cql USER peter 'secret'; & DISCONNECT Û DISCONNECT (Powers off the card). Terminates the CQL-session between the user and the CQL environment. þ FORMAT : DISCONNECT ; := | ALL | CURRENT := identifier þ EXAMPLES : DISCONNECT CURRENT; DISCONNECT cql; DISCONNECT ALL; & SET CONNECTION Û SET CONNECTION Selects an CQL-connection from the available CQL-environment. þ FORMAT : SET CONNECTION ; := identifier þ EXAMPLES : SET CONNECTION cql; SET CONNECTION DB; & PRESENT Û PRESENT (Basic card command). Opens a CQL-session in an CQL environment. F2 key hides the password. þ FORMAT : PRESENT ; := identifier := 8 bytes maximum string þ EXAMPLE : PRESENT peter 'secret'; & CHANGE Û CHANGE PASSWORD (Basic card command). Modifies the current password. þ FORMAT : CHANGE PASSWORD ; := 8 bytes maximum string := 8 bytes maximum string þ EXAMPLE : CHANGE PASSWORD 'secret' 'terces'; & UNLOCK Û UNLOCK (Basic card command). Initialyze the ratification compteur with its first value. þ FORMAT : UNLOCK ; := identifier þ EXAMPLE : UNLOCK peter; & CREATE TABLE Û CREATE TABLE (Basic card command). Defines a table,its columns and other properties. þ FORMAT : CREATE TABLE ;
:= identifier := ( [,]...) := identifier þ EXAMPLE : CREATE TABLE name (firstn,lastn); & CREATE VIEW Û CREATE VIEW (Basic card command). Defines a view. þ FORMAT : CREATE VIEW AS see SELECT command þ EXAMPLES : CREATE VIEW peter AS SELECT * FROM name WHERE lname = 'peter'; CREATE VIEW john AS SELECT fname FROM name WHERE lname = 'john'; & CREATE APPLICATION Û CREATE APPLICATION (Basic card command). Defines a user with the Application Manager profil. þ FORMAT : CREATE APPLICATION ; := identifier := '0' through '9' := 8 bytes maximum string þ EXAMPLES : CREATE APPLICATION appli1 3 'pswd1'; CREATE APPLICATION appli2 0 'pswd2'; ---> not ratified application provider & CREATE USER Û CREATE USER (Basic card command). Defines a user with the Simple User profil. þ FORMAT : CREATE USER ; := identifier := '0' through '9' := 8 bytes maximum string þ EXAMPLES : CREATE USER user1 3 'pswdu1'; CREATE USER user2 0 'pswdu2'; ---> not ratified user & DELETE USER Û DELETE USER (Basic card command). Deletes a user. þ FORMAT : DELETE USER ; := identifier þ EXAMPLE : DELETE USER user1; & CREATE DICTIONARY Û CREATE DICTIONARY (Basic card command). Creates 3 dictionaries. þ FORMAT : CREATE DICTIONARY ; := 4 bytes maximum identifier þ EXAMPLE : CREATE DICTIONARY dic; Creation of dic_t, dic_p, dic_u. (tables,privileges and users dictionaries). & GRANT Û GRANT (Basic card command). Specifies a privilege given to a user for manipulating an object. þ FORMAT : GRANT [,]... ON TO ; := insert | delete | select | update | all := identifier := identifier þ EXAMPLE : GRANT INSERT,SELECT ON name TO peter; & REVOKE Û REVOKE (Basic card command). Specifies a privilege revoked on a user for manipulating an object. þ FORMAT : REVOKE [,].. ON TO ; := insert | delete | select | update | all := identifier := identifier þ EXAMPLE : REVOKE INSERT,SELECT ON name TO peter; & DECLARE Û DECLARE CURSOR (Basic card command). Defines the cursor. þ FORMAT : DECLARE CURSOR FOR see SELECT command þ EXAMPLES : DECLARE CURSOR FOR SELECT * FROM name; DECLARE CURSOR FOR SELECT firstn FROM name WHERE lastn ='johnson'; & OPEN Û OPEN (Basic card command). Opens the cursor. þ FORMAT : OPEN; þ EXAMPLE : OPEN; & FETCH Û FETCH (Basic card command). Retrieves values from the current row. The fetch command is followed automatically by as many read record commands as required. þ FORMAT : FETCH; þ EXAMPLE : FETCH; & FETCH_NEXT Û FETCH_NEXT (Basic card command). Retrieves values from the current rows and move the cursor to the next occurence. The fetch_next command is followed automatically by as many read record commands as required. þ FORMAT : FETCH_NEXT; þ EXAMPLE : FETCH_NEXT; & NEXT Û NEXT (Basic card command). Move the cursor to the next occurence. þ FORMAT : NEXT; þ EXAMPLE : NEXT; & ERASE Û ERASE (Basic card command). Deletes the row of a table where the cursor is positioned. þ FORMAT : ERASE; þ EXAMPLE : ERASE; & DELETE FROM Û DELETE FROM Positions the cursor on rows and delete these rows. þ FORMAT : DELETE FROM
;
:= identifier := [ AND ] ... := string := > | < | >= | <= | <> | = þ EXAMPLE : DELETE FROM name WHERE firstn = 'peter'; & SELECT Û SELECT Retrieve data with search. This command sends as many basic card commands as required to select data according to the where clause. þ FORMAT :
[]; := * | [,] ... := [ AND ] ... := string := > | < | >= | <= | <> | = þ EXAMPLE : SELECT * FROM name WHERE firstn = 'peter'; & INSERT Û INSERT (Basic card command). Creates new rows in a table. þ FORMAT : INSERT INTO
VALUES ( );
:= identifier := string [, string ...] þ EXAMPLE : INSERT INTO name VALUES ('peter','johnson'); & UPDATEC Û UPDATEC (Basic card command). Updates a row of a table or a view depending on the cursor position. þ FORMAT : UPDATEC SET ; := = string [, = string] ... := identifier þ EXAMPLE : UPDATEC SET firstn = 'pierre'; & UPDATE Û UPDATE Update rows of a table or a view. This command sends as many basic card commands as required to update the rows concerned in a table or a view. þ FORMAT : UPDATE SET []; := identifier := = string [, = string] ... := identifier := [ AND ] ... := string := > | < | >= | <= | <> | = þ EXAMPLE : UPDATE name SET firstn = 'pierre' WHERE firstn = 'peter'; & BEGIN TRANSACTION Û BEGIN TRANSACTION (Basic card command). Begins a CQL-transaction. þ FORMAT : BEGIN TRANSACTION; þ EXAMPLE : BEGIN TRANSACTION; & COMMIT Û COMMIT (Basic card command). Terminates the current CQL-transaction with commit. þ FORMAT : COMMIT; þ EXAMPLE : COMMIT; & ROLLBACK Û ROLLBACK (Basic card command). Terminates the current CQL-transaction with rollback. þ FORMAT : ROLLBACK; þ EXAMPLE : ROLLBACK; & DROP TABLE Û DROP TABLE (Basic card command). Deletes all the rows of the table, the table description and all the privileges on that table. The views defined on that table will be deleted. þ FORMAT : DROP TABLE
;
:= identifier þ EXAMPLE : DROP TABLE name; & DROP VIEW Û DROP VIEW (Basic card command). Deletes all the rows of the view, the view description and all the privileges on that view. þ FORMAT : DROP VIEW ; := identifier þ EXAMPLE : DROP VIEW john; & STATUS Û STATUS (Basic card command). Returns the status of the card. þ FORMAT : STATUS; þ EXAMPLE : STATUS; & CREATE KEY Û CREATE KEY (Basic card command). Creates or erases a key. þ FORMAT : CREATE KEY ; := identifier := identifier := #xxxxxxxxxxxxxxxx (hexadecimal notation) þ EXAMPLE : CREATE KEY key1 app1 #CF1DFA268B0E43BA; & AUTHENTICATE Û AUTHENTICATE (Basic card command). Creates a session key between the card and the host system. þ FORMAT : AUTHENTICATE ; := identifier := identifier := #xxxxxxxxxxxxxxxx (hexadecimal notation) The key value is given (for tutorial purpose) to calculate the session key. := #xxxxxxxxxxxxxxxx (hexadecimal notation) þ EXAMPLE : AUTHENTICATE app1 key1 #FF14FA163B1893CD #EEA1234F728BC45A; & CHECK Û CHECK (Basic card command). Presents a ciphered password. þ FORMAT : CHECK ; := identifier := 8 bytes maximum string The CQL interpreter enciphers the password with the session key. þ EXAMPLE : CHECK peter 'secret'; & CHECK SPACE Û CHECK SPACE (flip/flop command) Sends a status command after each command to evaluate the EEPROM space. This command is incompatible with the assist one. þ FORMAT : CHECK SPACE; þ EXAMPLE : CHECK SPACE; & OPEN TRACE Û OPEN TRACE Opens a trace file (with default extension tra). þ FORMAT : OPEN TRACE ; þ EXAMPLE : OPEN TRACE phase1; & CLOSE TRACE Û CLOSE TRACE Closes the trace file. þ FORMAT : CLOSE TRACE; þ EXAMPLE : CLOSE TRACE; & TRACE ON Û TRACE ON Activates trace file recording. þ FORMAT : TRACE ON; þ EXAMPLE : TRACE ON; & TRACE OFF Û TRACE OFF Desactivates trace file recording. þ FORMAT : TRACE OFF; þ EXAMPLE : TRACE OFF; & DISPLAY Û DISPLAY (flip/flop command) Displays the card Input/Output bytes in the last line of the screen. þ FORMAT : DISPLAY; þ EXAMPLE : DISPLAY; & EXEC Û EXEC Executes a batch file. þ FORMAT : EXEC ; þ EXAMPLE : EXEC session.bat; & ASSIST Û ASSIST (flip/flop command) Switchs to assist mode. þ FORMAT : ASSIST; þ EXAMPLE : ASSIST; & PAUSE Û PAUSE Waits until a key is pressed. þ FORMAT : PAUSE; þ EXAMPLE : PAUSE; & QUIT Û QUIT or F10 key Terminates all CQL-sessions. þ FORMAT : QUIT; þ EXAMPLE : QUIT; & CONVENTIONS Û CONVENTIONS Most of the commands specifications call on elements of syntax. þ IDENTIFIER : The card will accept identifiers coded on the following basis : - 6 characters long maximum - the content of an identifier is a combination of alphabetical and digit characters, all converted in upper case by CQLINT - the aphabetical characters must be from 'A' through 'Z' - the first character must be an alphabetical character þ STRING : Unless specified, the strings have no size limit. The string content must be delimited with the apostrophe character <'>. &