The Pyrrho Database Management System

Malcolm Crowe, University of the West of Scotland

 

Pyrrho SQL syntax

Statements

Assignment = SET Target = Value { , Target = Value }
| SET ( Target { , Target } ) = Value .

For a simple assignment of form Target=Value the keyword SET can be omitted. (It is required in SQL2003.)

Target = id { . id } .

Targets which directly contain parameter lists are not supported in the SQL2003 standard.

Call = CALL Procedure_id ( [ Value { , Value } ] )
| MethodCall .

Within a routine, the CALL keyword can be omitted. (It is required in SQL2003.)

CaseStatement = CASE Value { WHEN Value THEN Statements } [ ELSE Statements ] END CASE
| CASE WHEN SearchCondition THEN Statements [ ELSE Statements ] END CASE .

Close = CLOSE id .

CompoundStatement = Label BEGIN [XMLDec] Statements END .

XMLDec = DECLARE Namespace ; .

Declaration = DECLARE id { , id } Type
| DECLARE id CURSOR FOR QueryExpression [ FOR UPDATE [ OF Cols ]]
| DECLARE HandlerType HANDLER FOR ConditionList Statement .

HandlerType = CONTINUE | EXIT | UNDO .

ConditionList = Condition { , Condition } .

Condition = ConditionCode | SQLEXCEPTION | SQLWARNING | (NOT FOUND) .

Signal = SIGNAL ConditionCode [SET CondInfo '=' Value { ',' CondInfo '=' Value }]
| RESIGNAL [ConditionCode] [SET CondInfo =' Value { ',' CondInfo '=' Value }]

ConditionCode = Condition_id | SQLSTATE string .

CondInfo = CLASS_ORIGIN|SUBCLASS_ORIGIN|CONSTRAINT_CATALOG| CONSTRAINT_SCHEMA| CONSTRAINT_NAME|CATALOG_NAME| SCHEMA_NAME| TABLE_NAME|COLUMN_NAME|CURSOR_NAME|MESSAGE_TEXT .

GetDiagnostics = GET DIAGNOSTICS Target = ItemName { ',' Target '=' ItemName }.

ItemName = NUMBER | MORE | COMMAND_FUNCTION | COMMAND_FUNCTION_CODE | DYNAMIC_FUNCTION | DYNAMIC_FUNCTION_CODE | ROW_COUNT | TRANSACTIONS_COMMITTED | TRANSACTIONS_ROLLED_BACK | TRANSACTION_ACTIVE | CATALOG_NAME | CLASS_ORIGIN | COLUMN_NAME | CONDITION_NUMBER | CONNECTION_NAME | CONSTRAINT_CATALOG | CONSTRAINT_NAME | CONSTRAINT_SCHEMA | CURSOR_NAME | MESSAGE_LENGTH | MESSAGE_OCTET_LENGTH | MESSAGE_TEXT | PARAMETER_MODE | PARAMETER_NAME | PARAMETER_ORDINAL_POSITION | RETURNED_SQLSTATE | ROUTINE_CATALOG | ROUTINE_NAME | ROUTINE_SCHEMA | SCHEMA_NAME | SERVER_NAME | SPECIFIC_NAME | SUBCLASS_ORIGIN | TABLE_NAME | TRIGGER_CATALOG | TRIGGER_NAME | TRIGGER_SCHEMA | TYPE | VALUE | WITH .

Fetch = FETCH Cursor_id INTO VariableRef { , VariableRef } .

ForStatement = Label FOR QueryExpression DO Statements END FOR .

IfStatement = IF BooleanExpr THEN Statements { ELSEIF BooleanExpr THEN Statements } [ ELSE Statements ] END IF .

Label = [ label : ] .

LoopStatement = Label LOOP Statements END LOOP .

Open = OPEN id .

Repeat = Label REPEAT Statements UNTIL BooleanExpr END REPEAT .

SelectSingle = QueryExpresion INTO VariableRef { , VariableRef } .

Statements = Statement { ; Statement } .

While = Label WHILE SearchCondition DO Statements END WHILE .

UserFunctionCall = Id ( [ Value {, Value}] ) .

MethodCall = Value . Method_id [ ( [ Value { , Value } ] )]
| ( Value AS Type ) . Method_id [ ( [ Value { , Value } ] )]
| Type:: Method_id [ ( [ Value { , Value } ] ) ] .