PSQL-Block
pSqlArgument
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlArgument_start((START))
pSqlArgument_start --> pSqlArgument_0_0[pSqlVariableName]
pSqlArgument_0_0 --> pSqlArgument_0_1[pSqlDataType]
pSqlArgument_0_1 --> pSqlArgument_end((END))
pSqlArgumentList
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlArgumentList_start((START))
pSqlArgumentList_start --> pSqlArgumentList_0_0[pSqlArgument]
pSqlArgumentList_0_0 --> pSqlArgumentList_0_1[","]:::quoted
pSqlArgumentList_0_1 --> pSqlArgumentList_0_2[pSqlArgument]
pSqlArgumentList_0_2 --> pSqlArgumentList_end((END))
pSqlVariableList
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlVariableList_start((START))
pSqlVariableList_start --> pSqlVariableList_0_0[pSqlVariableName]
pSqlVariableList_0_0 --> pSqlVariableList_0_1[","]:::quoted
pSqlVariableList_0_1 --> pSqlVariableList_0_2[pSqlVariableName]
pSqlVariableList_0_2 --> pSqlVariableList_end((END))
pSqlBlock
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlBlock_start((START))
pSqlBlock_start --> pSqlBlock_0_0[DECLARE]:::quoted
pSqlBlock_0_0 --> pSqlBlock_0_1[pSqlDeclareSection]
pSqlBlock_0_1 --> pSqlBlock_0_2[pSqlBody]
pSqlBlock_0_2 --> pSqlBlock_end((END))
Anwendung
Ein PSQL-Block ist eine Struktur zur Definition von Prozeduren. Sie kann sowohl prozedurale Logik als auch SQL-Statements wie „select“ enthalten.
pSqlBlockNoBatchSeparator
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlBlockNoBatchSeparator_start((START))
pSqlBlockNoBatchSeparator_start --> pSqlBlockNoBatchSeparator_0_0[DECLARE]:::quoted
pSqlBlockNoBatchSeparator_0_0 --> pSqlBlockNoBatchSeparator_0_1[pSqlDeclareSection]
pSqlBlockNoBatchSeparator_0_1 --> pSqlBlockNoBatchSeparator_0_2[pSqlBodyNoBatchSeparator]
pSqlBlockNoBatchSeparator_0_2 --> pSqlBlockNoBatchSeparator_end((END))
pSqlBlockOptionalDeclare
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlBlockOptionalDeclare_start((START))
pSqlBlockOptionalDeclare_start --> pSqlBlockOptionalDeclare_0_0[DECLARE]:::quoted
pSqlBlockOptionalDeclare_0_0 --> pSqlBlockOptionalDeclare_0_1[pSqlDeclareSection]
pSqlBlockOptionalDeclare_0_1 --> pSqlBlockOptionalDeclare_0_2[pSqlBody]
pSqlBlockOptionalDeclare_0_2 --> pSqlBlockOptionalDeclare_end((END))
pSqlDeclareSection
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> pSqlDeclareSection
pSqlDeclareSection -->| | pSqlDeclaration
pSqlDeclaration --> End((END))
Anwendung
Ein PSQL-Deklarationsabschnitt definiert eine oder mehrere lokale Variablen, die im Block und in verschachtelten Blöcken verfügbar sind.
pSqlDeclaration
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> pSqlDeclaration
pSqlDeclaration -->| | pSqlItemDeclaration
pSqlItemDeclaration --> End((END))
pSqlItemDeclaration
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart TD
pSqlItemDeclaration_start((START))
pSqlItemDeclaration_start --> pSqlItemDeclaration_0_0[pSqlVariableName]
pSqlItemDeclaration_0_0 --> pSqlItemDeclaration_0_1[CONSTANT]:::quoted
pSqlItemDeclaration_0_1 --> pSqlItemDeclaration_0_2[pSqlDataType]
pSqlItemDeclaration_0_2 --> pSqlItemDeclaration_0_3[ASSIGNMENT_OPERATOR]:::quoted
pSqlItemDeclaration_0_3 --> pSqlItemDeclaration_0_4[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlItemDeclaration_0_4 --> pSqlItemDeclaration_0_5[BATCHSEPARATOR]:::quoted
pSqlItemDeclaration_0_5 --> pSqlItemDeclaration_0_6[pSqlCallProcedureStatement]
pSqlItemDeclaration_0_6 --> pSqlItemDeclaration_0_7[BATCHSEPARATOR]:::quoted
pSqlItemDeclaration_0_7 --> pSqlItemDeclaration_end((END))
Anwendung
Eine Elementdeklaration definiert eine benannte Variable basierend auf dem Datentyp. Der Anfangswert kann als Konstante hinzugefügt werden.
pSqlBodyNoBatchSeparator
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlBodyNoBatchSeparator_start((START))
pSqlBodyNoBatchSeparator_start --> pSqlBodyNoBatchSeparator_0_0[BEGIN]:::quoted
pSqlBodyNoBatchSeparator_0_0 --> pSqlBodyNoBatchSeparator_0_1[pSqlStatement]
pSqlBodyNoBatchSeparator_0_1 --> pSqlBodyNoBatchSeparator_0_2[pSqlExceptionBlock]
pSqlBodyNoBatchSeparator_0_2 --> pSqlBodyNoBatchSeparator_0_3[END]:::quoted
pSqlBodyNoBatchSeparator_0_3 --> pSqlBodyNoBatchSeparator_end((END))
pSqlBody
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlBody_start((START))
pSqlBody_start --> pSqlBody_0_0[pSqlBodyNoBatchSeparator]
pSqlBody_0_0 --> pSqlBody_0_1[BATCHSEPARATOR]:::quoted
pSqlBody_0_1 --> pSqlBody_end((END))
Anwendung
Ein PSQL-Körper enthält sowohl die Logik einer Prozedur als auch SQL-Statements. Variablen müssen zuvor deklariert worden sein.
pSqlExceptionBlock
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlExceptionBlock_start((START))
pSqlExceptionBlock_start --> pSqlExceptionBlock_0_0[EXCEPTION]:::quoted
pSqlExceptionBlock_0_0 --> pSqlExceptionBlock_0_1[pSqlExceptionWhenName]
pSqlExceptionBlock_0_1 --> pSqlExceptionBlock_0_2[pSqlExceptionWhenOthers]
pSqlExceptionBlock_0_2 --> pSqlExceptionBlock_end((END))
pSqlExceptionWhenName
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlExceptionWhenName_start((START))
pSqlExceptionWhenName_start --> pSqlExceptionWhenName_0_0[WHEN]:::quoted
pSqlExceptionWhenName_0_0 --> pSqlExceptionWhenName_0_1[pSqlVariableName]
pSqlExceptionWhenName_0_1 --> pSqlExceptionWhenName_0_2[THEN]:::quoted
pSqlExceptionWhenName_0_2 --> pSqlExceptionWhenName_0_3[pSqlStatement]
pSqlExceptionWhenName_0_3 --> pSqlExceptionWhenName_end((END))
pSqlExceptionWhenOthers
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlExceptionWhenOthers_start((START))
pSqlExceptionWhenOthers_start --> pSqlExceptionWhenOthers_0_0[WHEN]:::quoted
pSqlExceptionWhenOthers_0_0 --> pSqlExceptionWhenOthers_0_1[OTHERS]:::quoted
pSqlExceptionWhenOthers_0_1 --> pSqlExceptionWhenOthers_0_2[THEN]:::quoted
pSqlExceptionWhenOthers_0_2 --> pSqlExceptionWhenOthers_0_3[pSqlStatement]
pSqlExceptionWhenOthers_0_3 --> pSqlExceptionWhenOthers_end((END))
pSqlStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlStatement_start((START))
pSqlStatement_start --> pSqlStatement_0_0[pSqlAssignmentStatement]
pSqlStatement_0_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_1_0[pSqlContinueStatement]
pSqlStatement_1_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_2_0[pSqlExecuteImmediateStatement]
pSqlStatement_2_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_3_0[pSqlExecuteNativeStatement]
pSqlStatement_3_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_4_0[pSqlExitStatement]
pSqlStatement_4_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_5_0[pSqlGotoStatement]
pSqlStatement_5_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_6_0[pSqlLabelStatement]
pSqlStatement_6_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_7_0[pSqlIfStatement]
pSqlStatement_7_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_8_0[pSqlLoopStatement]
pSqlStatement_8_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_9_0[pSqlNullStatement]
pSqlStatement_9_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_10_0[pSqlBlock]
pSqlStatement_10_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_11_0[pSqlRaiseStatement]
pSqlStatement_11_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_12_0[pSqlReturnStatement]
pSqlStatement_12_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_13_0[pSqlProcedureStatement]
pSqlStatement_13_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_14_0[pSqlCallProcedureStatement]
pSqlStatement_14_0 --> pSqlStatement_end((END))
pSqlStatement_start --> pSqlStatement_15_0[sqlStatement]
pSqlStatement_15_0 --> pSqlStatement_15_1[";"]
pSqlStatement_15_1 --> pSqlStatement_end((END))
Anwendung
Es stehen eine Reihe grundlegender PSQL-Statements zur Verfügung.
pSqlBlockOrStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> pSqlBlockOrStatement
pSqlBlockOrStatement -->| | pSqlBlock
pSqlBlock --> End((END))
pSqlBlockOrStatement -->| | pSqlStatement
pSqlStatement --> End((END))
Anwendung
Ein PSQL-Block oder ein PSQL-Statement definiert eine Prozedur oder ein SQL-Statement, das ausgeführt wird.
pSqlBlockOrStatements
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> pSqlBlockOrStatements
pSqlBlockOrStatements -->| | pSqlBlockOrStatement
pSqlBlockOrStatement --> End((END))
pSqlNullStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlNullStatement_start((START))
pSqlNullStatement_start --> pSqlNullStatement_0_0[NULL]:::quoted
pSqlNullStatement_0_0 --> pSqlNullStatement_0_1[";"]
pSqlNullStatement_0_1 --> pSqlNullStatement_end((END))
Anwendung
Die „null“-Statement ist eine NOP-Statement (No Operator). Die Verwendung der „null“-Anweisung ist erforderlich, wenn ein PSQL-Statement benötigt wird, aber keine Aktion ausgeführt werden muss, wie beispielsweise bei einer „if“-Anweisung. Das „null“-Statement macht zudem deutlich, dass ein Entwickler die erforderlichen Maßnahmen geprüft und festgestellt hat, dass für ein bestimmtes Szenario keine Maßnahme zutrifft. Dies führt zu einer verbesserten Code-Dokumentation.
pSqlReturnStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlReturnStatement_start((START))
pSqlReturnStatement_start --> pSqlReturnStatement_0_0[RETURN]:::quoted
pSqlReturnStatement_0_0 --> pSqlReturnStatement_0_1[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlReturnStatement_0_1 --> pSqlReturnStatement_0_2[";"]
pSqlReturnStatement_0_2 --> pSqlReturnStatement_end((END))
Anwendung
Gibt einen Wert aus einer Funktion an den aufrufenden Code zurück.
pSqlAssignmentStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart TD
pSqlAssignmentStatement_start((START))
pSqlAssignmentStatement_start --> pSqlAssignmentStatement_0_0[pSqlVariableName]
pSqlAssignmentStatement_0_0 --> pSqlAssignmentStatement_0_1[triggerRecordVariableExpression]
pSqlAssignmentStatement_0_1 --> pSqlAssignmentStatement_0_2[ASSIGNMENT_OPERATOR]:::quoted
pSqlAssignmentStatement_0_2 --> pSqlAssignmentStatement_0_3[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlAssignmentStatement_0_3 --> pSqlAssignmentStatement_0_4[BATCHSEPARATOR]:::quoted
pSqlAssignmentStatement_0_4 --> pSqlAssignmentStatement_0_5[pSqlCallProcedureStatement]
pSqlAssignmentStatement_0_5 --> pSqlAssignmentStatement_end((END))
Anwendung
Die Zuweisungsstatement weist einer Variablen einen neuen Wert zu. Um die Ergebnisse einer SQL-Query einem Wert zuzuweisen, verwenden Sie eine „select ... into ...“-Statement.
pSqlContinueStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlContinueStatement_start((START))
pSqlContinueStatement_start --> pSqlContinueStatement_0_0[CONTINUE]:::quoted
pSqlContinueStatement_0_0 --> pSqlContinueStatement_0_1[WHEN]:::quoted
pSqlContinueStatement_0_1 --> pSqlContinueStatement_0_2[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlContinueStatement_0_2 --> pSqlContinueStatement_0_3[BATCHSEPARATOR]:::quoted
pSqlContinueStatement_0_3 --> pSqlContinueStatement_end((END))
Anwendung
Dieses PSQL-continue-Statement setzt die Ausführung der innersten Schleife am Anfang der Schleife fort. Wenn ein boolescher Ausdruck angegeben wird, wird die innerste Schleife zu Beginn nur dann gestartet, wenn der boolesche Ausdruck den Wert „wahr“ ergibt.
pSqlExecuteImmediateStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlExecuteImmediateStatement_start((START))
pSqlExecuteImmediateStatement_start --> pSqlExecuteImmediateStatement_0_0[pSqlExecuteImmediateStatementNS]
pSqlExecuteImmediateStatement_0_0 --> pSqlExecuteImmediateStatement_0_1[BATCHSEPARATOR]:::quoted
pSqlExecuteImmediateStatement_0_1 --> pSqlExecuteImmediateStatement_end((END))
Anwendung
Die PSQL-Anweisung „execute immediate“ ermöglicht die Verwendung von SQL-Statements, die zur Runtime kompiliert werden. Beispielsweise können dynamische DDL-Statements nicht immer zur Kompilierungszeit ausgeführt werden; das Statement „execute immediate“ ermöglicht dies.
pSqlExecuteImmediateStatementNS
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlExecuteImmediateStatementNS_start((START))
pSqlExecuteImmediateStatementNS_start --> pSqlExecuteImmediateStatementNS_0_0[EXECUTE]:::quoted
pSqlExecuteImmediateStatementNS_0_0 --> pSqlExecuteImmediateStatementNS_0_1[IMMEDIATE]:::quoted
pSqlExecuteImmediateStatementNS_0_1 --> pSqlExecuteImmediateStatementNS_0_2[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlExecuteImmediateStatementNS_0_2 --> pSqlExecuteImmediateStatementNS_0_3[INTO]:::quoted
pSqlExecuteImmediateStatementNS_0_3 --> pSqlExecuteImmediateStatementNS_0_4[pSqlVariableList]
pSqlExecuteImmediateStatementNS_0_4 --> pSqlExecuteImmediateStatementNS_0_5[pSqlExecuteImmediateUsingClause]
pSqlExecuteImmediateStatementNS_0_5 --> pSqlExecuteImmediateStatementNS_end((END))
pSqlExecuteImmediateUsingClause
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlExecuteImmediateUsingClause_start((START))
pSqlExecuteImmediateUsingClause_start --> pSqlExecuteImmediateUsingClause_0_0[USING]:::quoted
pSqlExecuteImmediateUsingClause_0_0 --> pSqlExecuteImmediateUsingClause_0_1[pSqlExecuteImmediateUsingItem]
pSqlExecuteImmediateUsingClause_0_1 --> pSqlExecuteImmediateUsingClause_0_2[","]:::quoted
pSqlExecuteImmediateUsingClause_0_2 --> pSqlExecuteImmediateUsingClause_0_3[pSqlExecuteImmediateUsingItem]
pSqlExecuteImmediateUsingClause_0_3 --> pSqlExecuteImmediateUsingClause_end((END))
pSqlExecuteImmediateUsingItem
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlExecuteImmediateUsingItem_start((START))
pSqlExecuteImmediateUsingItem_start --> pSqlExecuteImmediateUsingItem_0_0[IN]:::quoted
pSqlExecuteImmediateUsingItem_0_0 --> pSqlExecuteImmediateUsingItem_0_1[OUT]:::quoted
pSqlExecuteImmediateUsingItem_0_1 --> pSqlExecuteImmediateUsingItem_0_2[pSqlVariableName]
pSqlExecuteImmediateUsingItem_0_2 --> pSqlExecuteImmediateUsingItem_end((END))
pSqlExecuteNativeStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlExecuteNativeStatement_start((START))
pSqlExecuteNativeStatement_start --> pSqlExecuteNativeStatement_0_0[pSqlExecuteNativeStatementNS]
pSqlExecuteNativeStatement_0_0 --> pSqlExecuteNativeStatement_0_1[BATCHSEPARATOR]:::quoted
pSqlExecuteNativeStatement_0_1 --> pSqlExecuteNativeStatement_end((END))
Anwendung
Führen Sie eine Statement direkt auf einem bestimmten Datencontainer aus. Die Statement muss mit dem nativen SQL- oder API-Code für den angegebenen Datencontainer übereinstimmen. Die Ausgabe der Statement-Anweisung wird in PSQL-Variablen gespeichert.
pSqlExecuteNativeStatementNS
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart TD
pSqlExecuteNativeStatementNS_start((START))
pSqlExecuteNativeStatementNS_start --> pSqlExecuteNativeStatementNS_0_0[EXECUTE]:::quoted
pSqlExecuteNativeStatementNS_0_0 --> pSqlExecuteNativeStatementNS_0_1[NATIVE]:::quoted
pSqlExecuteNativeStatementNS_0_1 --> pSqlExecuteNativeStatementNS_0_2[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlExecuteNativeStatementNS_0_2 --> pSqlExecuteNativeStatementNS_0_3[INTO]:::quoted
pSqlExecuteNativeStatementNS_0_3 --> pSqlExecuteNativeStatementNS_0_4[pSqlVariableList]
pSqlExecuteNativeStatementNS_0_4 --> pSqlExecuteNativeStatementNS_0_5[DATACONTAINER]:::quoted
pSqlExecuteNativeStatementNS_0_5 --> pSqlExecuteNativeStatementNS_0_6[stringConstant]
pSqlExecuteNativeStatementNS_0_6 --> pSqlExecuteNativeStatementNS_end((END))
pSqlExitStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlExitStatement_start((START))
pSqlExitStatement_start --> pSqlExitStatement_0_0[EXIT]:::quoted
pSqlExitStatement_0_0 --> pSqlExitStatement_0_1[WHEN]:::quoted
pSqlExitStatement_0_1 --> pSqlExitStatement_0_2[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlExitStatement_0_2 --> pSqlExitStatement_0_3[BATCHSEPARATOR]:::quoted
pSqlExitStatement_0_3 --> pSqlExitStatement_end((END))
Anwendung
Diese PSQL-Exit-Statement beendet die Ausführung der innersten Schleife. Wenn ein boolescher Ausdruck angegeben wird, wird die innerste Schleife nur verlassen, wenn der boolesche Ausdruck den Wert „true“ ergibt.
pSqlGotoStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlGotoStatement_start((START))
pSqlGotoStatement_start --> pSqlGotoStatement_0_0[GOTO]:::quoted
pSqlGotoStatement_0_0 --> pSqlGotoStatement_0_1[pSqlVariableName]
pSqlGotoStatement_0_1 --> pSqlGotoStatement_0_2[BATCHSEPARATOR]:::quoted
pSqlGotoStatement_0_2 --> pSqlGotoStatement_end((END))
Anwendung
Die Ausführung wird an der Stelle der angegebenen Beschriftung fortgesetzt.
pSqlLabelStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlLabelStatement_start((START))
pSqlLabelStatement_start --> pSqlLabelStatement_0_0[LT]:::quoted
pSqlLabelStatement_0_0 --> pSqlLabelStatement_0_1[LT]:::quoted
pSqlLabelStatement_0_1 --> pSqlLabelStatement_0_2[pSqlVariableName]
pSqlLabelStatement_0_2 --> pSqlLabelStatement_0_3[GT]:::quoted
pSqlLabelStatement_0_3 --> pSqlLabelStatement_0_4[GT]:::quoted
pSqlLabelStatement_0_4 --> pSqlLabelStatement_end((END))
Anwendung
Geben Sie die Position einer Beschriftung an.
pSqlIfStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart TD
pSqlIfStatement_start((START))
pSqlIfStatement_start --> pSqlIfStatement_0_0[IF]:::quoted
pSqlIfStatement_0_0 --> pSqlIfStatement_0_1[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlIfStatement_0_1 --> pSqlIfStatement_0_2[THEN]:::quoted
pSqlIfStatement_0_2 --> pSqlIfStatement_0_3[pSqlBlockOrStatements]
pSqlIfStatement_0_3 --> pSqlIfStatement_0_4[pSqlElsIfExpression]
pSqlIfStatement_0_4 --> pSqlIfStatement_0_5[ELSE]:::quoted
pSqlIfStatement_0_5 --> pSqlIfStatement_0_6[pSqlBlockOrStatements]
pSqlIfStatement_0_6 --> pSqlIfStatement_0_7[END]:::quoted
pSqlIfStatement_0_7 --> pSqlIfStatement_0_8[IF]:::quoted
pSqlIfStatement_0_8 --> pSqlIfStatement_0_9[BATCHSEPARATOR]:::quoted
pSqlIfStatement_0_9 --> pSqlIfStatement_end((END))
Anwendung
Das if-Statement führt bedingte Logik aus. Wenn der boolesche Ausdruck nach „if“ wahr ist, wird der PSQL-Block nach „then“ ausgeführt. Weitere Verzweigungen können mithilfe eines „elsif“ festgelegt werden. Andernfalls – und nur wenn angegeben – wird die Logik nach dem „else“ ausgeführt.
pSqlElsIfExpression
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlElsIfExpression_start((START))
pSqlElsIfExpression_start --> pSqlElsIfExpression_0_0[ELSIF]:::quoted
pSqlElsIfExpression_0_0 --> pSqlElsIfExpression_0_1[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlElsIfExpression_0_1 --> pSqlElsIfExpression_0_2[THEN]:::quoted
pSqlElsIfExpression_0_2 --> pSqlElsIfExpression_0_3[pSqlBlockOrStatements]
pSqlElsIfExpression_0_3 --> pSqlElsIfExpression_end((END))
pSqlLoopStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> pSqlLoopStatement
pSqlLoopStatement -->| | pSqlForNumberLoopStatement
pSqlForNumberLoopStatement --> End((END))
pSqlLoopStatement -->| | pSqlForRecordLoopStatement
pSqlForRecordLoopStatement --> End((END))
pSqlLoopStatement -->| | pSqlWhileLoopStatement
pSqlWhileLoopStatement --> End((END))
pSqlLoopStatement -->| | pSqlRepeatUntilLoopStatement
pSqlRepeatUntilLoopStatement --> End((END))
Anwendung
Es stehen verschiedene PSQL-Statements für Schleifen zur Verfügung.
pSqlForNumberLoopStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart TD
pSqlForNumberLoopStatement_start((START))
pSqlForNumberLoopStatement_start --> pSqlForNumberLoopStatement_0_0[FOR]:::quoted
pSqlForNumberLoopStatement_0_0 --> pSqlForNumberLoopStatement_0_1[pSqlVariableName]
pSqlForNumberLoopStatement_0_1 --> pSqlForNumberLoopStatement_0_2[IN]:::quoted
pSqlForNumberLoopStatement_0_2 --> pSqlForNumberLoopStatement_0_3[REVERSE]:::quoted
pSqlForNumberLoopStatement_0_3 --> pSqlForNumberLoopStatement_0_4[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlForNumberLoopStatement_0_4 --> pSqlForNumberLoopStatement_0_5[pSqlVariableName]
pSqlForNumberLoopStatement_0_5 --> pSqlForNumberLoopStatement_0_6["."]:::quoted
pSqlForNumberLoopStatement_0_6 --> pSqlForNumberLoopStatement_0_7["."]:::quoted
pSqlForNumberLoopStatement_0_7 --> pSqlForNumberLoopStatement_0_8[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlForNumberLoopStatement_0_8 --> pSqlForNumberLoopStatement_0_9[pSqlVariableName]
pSqlForNumberLoopStatement_0_9 --> pSqlForNumberLoopStatement_0_10[STEP]:::quoted
pSqlForNumberLoopStatement_0_10 --> pSqlForNumberLoopStatement_0_11[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlForNumberLoopStatement_0_11 --> pSqlForNumberLoopStatement_0_12[pSqlVariableName]
pSqlForNumberLoopStatement_0_12 --> pSqlForNumberLoopStatement_0_13[LOOP]:::quoted
pSqlForNumberLoopStatement_0_13 --> pSqlForNumberLoopStatement_0_14[pSqlBlockOrStatements]
pSqlForNumberLoopStatement_0_14 --> pSqlForNumberLoopStatement_0_15[END]:::quoted
pSqlForNumberLoopStatement_0_15 --> pSqlForNumberLoopStatement_0_16[LOOP]:::quoted
pSqlForNumberLoopStatement_0_16 --> pSqlForNumberLoopStatement_0_17[BATCHSEPARATOR]:::quoted
pSqlForNumberLoopStatement_0_17 --> pSqlForNumberLoopStatement_end((END))
Anwendung
Diese PSQL-Schleifenanweisung für Ganzzahlen durchläuft einen Bereich von Ganzzahlwerten und führt für jeden durchlaufenen Wert PSQL-Statements aus. Die Iterationen verlaufen vom ersten bis zum letzten Wert in Schritten der angegebenen Schrittweite. Die Standardschrittweite beträgt 1. Die Iterationen verlaufen rückwärts in Schritten von 1, wenn „reverse“ angegeben ist.
pSqlForRecordLoopStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart TD
pSqlForRecordLoopStatement_start((START))
pSqlForRecordLoopStatement_start --> pSqlForRecordLoopStatement_0_0[FOR]:::quoted
pSqlForRecordLoopStatement_0_0 --> pSqlForRecordLoopStatement_0_1[pSqlVariableName]
pSqlForRecordLoopStatement_0_1 --> pSqlForRecordLoopStatement_0_2[IN]:::quoted
pSqlForRecordLoopStatement_0_2 --> pSqlForRecordLoopStatement_0_3["("]:::quoted
pSqlForRecordLoopStatement_0_3 --> pSqlForRecordLoopStatement_0_4[selectStatement]
pSqlForRecordLoopStatement_0_4 --> pSqlForRecordLoopStatement_0_5[pSqlExecuteImmediateStatementNS]
pSqlForRecordLoopStatement_0_5 --> pSqlForRecordLoopStatement_0_6[pSqlExecuteNativeStatementNS]
pSqlForRecordLoopStatement_0_6 --> pSqlForRecordLoopStatement_0_7[")"]:::quoted
pSqlForRecordLoopStatement_0_7 --> pSqlForRecordLoopStatement_0_8[LOOP]:::quoted
pSqlForRecordLoopStatement_0_8 --> pSqlForRecordLoopStatement_0_9[pSqlBlockOrStatements]
pSqlForRecordLoopStatement_0_9 --> pSqlForRecordLoopStatement_0_10[END]:::quoted
pSqlForRecordLoopStatement_0_10 --> pSqlForRecordLoopStatement_0_11[LOOP]:::quoted
pSqlForRecordLoopStatement_0_11 --> pSqlForRecordLoopStatement_0_12[BATCHSEPARATOR]:::quoted
pSqlForRecordLoopStatement_0_12 --> pSqlForRecordLoopStatement_end((END))
Anwendung
Diese PSQL-Schleifenanweisung für Ergebnismengen durchläuft eine Ergebnismenge, die von einer Invantive UniversalSQL-Query zurückgegeben wird. Die PSQL-Statements werden für jeden Datensatz ausgeführt. Die spezifischen Werte des Datensatzes können mithilfe der Variablen abgerufen werden.
pSqlRepeatUntilLoopStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlRepeatUntilLoopStatement_start((START))
pSqlRepeatUntilLoopStatement_start --> pSqlRepeatUntilLoopStatement_0_0[LOOP]:::quoted
pSqlRepeatUntilLoopStatement_0_0 --> pSqlRepeatUntilLoopStatement_0_1[pSqlBlockOrStatements]
pSqlRepeatUntilLoopStatement_0_1 --> pSqlRepeatUntilLoopStatement_0_2[END]:::quoted
pSqlRepeatUntilLoopStatement_0_2 --> pSqlRepeatUntilLoopStatement_0_3[LOOP]:::quoted
pSqlRepeatUntilLoopStatement_0_3 --> pSqlRepeatUntilLoopStatement_0_4[BATCHSEPARATOR]:::quoted
pSqlRepeatUntilLoopStatement_0_4 --> pSqlRepeatUntilLoopStatement_end((END))
Anwendung
Diese PSQL-Schleifenanweisung (oder „repeat until“) führt PSQL-Statements so lange aus, bis die angegebene Schleife durch eine „exit“-Anweisung beendet wird.
pSqlWhileLoopStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlWhileLoopStatement_start((START))
pSqlWhileLoopStatement_start --> pSqlWhileLoopStatement_0_0[WHILE]:::quoted
pSqlWhileLoopStatement_0_0 --> pSqlWhileLoopStatement_0_1[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
pSqlWhileLoopStatement_0_1 --> pSqlWhileLoopStatement_0_2[LOOP]:::quoted
pSqlWhileLoopStatement_0_2 --> pSqlWhileLoopStatement_0_3[pSqlBlockOrStatements]
pSqlWhileLoopStatement_0_3 --> pSqlWhileLoopStatement_0_4[END]:::quoted
pSqlWhileLoopStatement_0_4 --> pSqlWhileLoopStatement_0_5[LOOP]:::quoted
pSqlWhileLoopStatement_0_5 --> pSqlWhileLoopStatement_0_6[BATCHSEPARATOR]:::quoted
pSqlWhileLoopStatement_0_6 --> pSqlWhileLoopStatement_end((END))
Anwendung
Diese PSQL-While-Schleife führt PSQL-Statements so lange aus, wie die angegebene boolesche Bedingung am Ende der Schleife den Wert „wahr“ ergibt.
pSqlRaiseStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart TD
pSqlRaiseStatement_start((START))
pSqlRaiseStatement_start --> pSqlRaiseStatement_0_0[RAISE]:::quoted
pSqlRaiseStatement_0_0 --> pSqlRaiseStatement_0_1[INVALID_NUMBER]:::quoted
pSqlRaiseStatement_0_1 --> pSqlRaiseStatement_0_2[NO_DATA_FOUND]:::quoted
pSqlRaiseStatement_0_2 --> pSqlRaiseStatement_0_3[PROGRAM_ERROR]:::quoted
pSqlRaiseStatement_0_3 --> pSqlRaiseStatement_0_4[TOO_MANY_ROWS]:::quoted
pSqlRaiseStatement_0_4 --> pSqlRaiseStatement_0_5[VALUE_ERROR]:::quoted
pSqlRaiseStatement_0_5 --> pSqlRaiseStatement_0_6[ZERO_DIVIDE]:::quoted
pSqlRaiseStatement_0_6 --> pSqlRaiseStatement_0_7[RAISE_APPLICATION_ERROR]:::quoted
pSqlRaiseStatement_0_7 --> pSqlRaiseStatement_0_8["("]:::quoted
pSqlRaiseStatement_0_8 --> pSqlRaiseStatement_0_9[numberedOrNamedExpressionList]
pSqlRaiseStatement_0_9 --> pSqlRaiseStatement_0_10[")"]:::quoted
pSqlRaiseStatement_0_10 --> pSqlRaiseStatement_0_11[BATCHSEPARATOR]:::quoted
pSqlRaiseStatement_0_11 --> pSqlRaiseStatement_end((END))
Anwendung
Das Statement „raise“ löst eine der vordefinierten Ausnahmen aus:
INVALID_NUMBER: Wird typischerweise verwendet, wenn ein Text in eine Zahl konvertiert wird, diese jedoch keine gültige Zahl enthält.NO_DATA_FOUND: Wird in der Regel verwendet, wenn ein „select into“-Statement null Zeilen zurückgibt.PROGRAM_ERROR: Wird in der Regel verwendet, um einen (internen) Systemfehler zu signalisieren.TOO_MANY_ROWS: Wird in der Regel verwendet, wenn ein „select into“-Statement zwei oder mehr Zeilen zurückgibt.VALUE_ERROR: Wird in der Regel verwendet, wenn bei der Auswertung eines Ausdrucks ein Fehler auftritt.ZERO_DIVIDE: Wird typischerweise verwendet, wenn die rechte Seite einer Division Null ist.
Das Statement raise_application_error löst eine Ausnahme aus, die aus einer nicht eindeutigen textuellen oder numerischen Kennung sowie einem Meldungstext besteht. Optional können Sie eine Art-Anfrage und den Natürlichen Schlüssel als Parameter hinzufügen.
pSqlProcedureStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlProcedureStatement_start((START))
pSqlProcedureStatement_start --> pSqlProcedureStatement_0_0[<a href="Invantive UniversalSQL/Grammar/Identifier" class="internal-link">identifier</a>]
pSqlProcedureStatement_0_0 --> pSqlProcedureStatement_0_1["("]:::quoted
pSqlProcedureStatement_0_1 --> pSqlProcedureStatement_0_2[numberedOrNamedExpressionList]
pSqlProcedureStatement_0_2 --> pSqlProcedureStatement_0_3[")"]:::quoted
pSqlProcedureStatement_0_3 --> pSqlProcedureStatement_0_4[";"]:::quoted
pSqlProcedureStatement_0_4 --> pSqlProcedureStatement_end((END))
pSqlCallProcedureStatement
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
pSqlCallProcedureStatement_start((START))
pSqlCallProcedureStatement_start --> pSqlCallProcedureStatement_0_0[pSqlCallProcedureStatementNS]
pSqlCallProcedureStatement_0_0 --> pSqlCallProcedureStatement_0_1[BATCHSEPARATOR]:::quoted
pSqlCallProcedureStatement_0_1 --> pSqlCallProcedureStatement_end((END))
pSqlCallProcedureStatementNS
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart TD
pSqlCallProcedureStatementNS_start((START))
pSqlCallProcedureStatementNS_start --> pSqlCallProcedureStatementNS_0_0[<a href="Invantive UniversalSQL/Grammar/Identifier" class="internal-link">identifier</a>]
pSqlCallProcedureStatementNS_0_0 --> pSqlCallProcedureStatementNS_0_1["."]:::quoted
pSqlCallProcedureStatementNS_0_1 --> pSqlCallProcedureStatementNS_0_2[<a href="Invantive UniversalSQL/Grammar/Identifier" class="internal-link">identifier</a>]
pSqlCallProcedureStatementNS_0_2 --> pSqlCallProcedureStatementNS_0_3[distributedAliasDirective]
pSqlCallProcedureStatementNS_0_3 --> pSqlCallProcedureStatementNS_0_4["("]:::quoted
pSqlCallProcedureStatementNS_0_4 --> pSqlCallProcedureStatementNS_0_5[numberedOrNamedExpressionList]
pSqlCallProcedureStatementNS_0_5 --> pSqlCallProcedureStatementNS_0_6[")"]:::quoted
pSqlCallProcedureStatementNS_0_6 --> pSqlCallProcedureStatementNS_end((END))
pSqlVariableName
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> pSqlVariableName
pSqlVariableName -->| | identifier[<a href="Invantive UniversalSQL/Grammar/Identifier" class="internal-link">identifier</a>]
identifier --> End((END))