Which of the following are characteristics of database procedures?
According to the SAP HANA SQLScript Reference1, database procedures are subroutines that can be called from SQL statements or other database procedures. Database procedures can have the following characteristics:
Database procedures can have both input and output parameters; however, a parameter CANNOT be both input and output. Input parameters are used to pass values to the procedure, while output parameters are used to return values from the procedure. A parameter can be either scalar or table type, depending on the data type and cardinality. A parameter cannot be both input and output, because this would create ambiguity and inconsistency in the parameter passing mechanism. For example, you cannot declare a parameter as IN OUT, or assign a value to an input parameter, or read a value from an output parameter.For more information on database procedure parameters, see [Parameters of Database Procedures]2.
Database procedures can have several output parameters, and a mix of both scalar and table types is possible. Output parameters are used to return values from the procedure to the caller. A procedure can have zero or more output parameters, depending on the purpose and logic of the procedure. Output parameters can be either scalar or table type, depending on the data type and cardinality. A procedure can have a mix of both scalar and table output parameters, as long as they are compatible with the caller's expectations and syntax. For example, you can use a SELECT statement with INTO clause to assign values to scalar output parameters, or use a SELECT statement with RESULT clause to return a table output parameter.For more information on database procedure output parameters, see [Output Parameters of Database Procedures]3.
If, in the database procedure header, you use the READS SQL DATA option, then INSERT statements are prohibited; however, dynamic SQL is allowed. The READS SQL DATA option is used to indicate that the procedure only reads data from the database, and does not modify or write any data. This option is useful for performance optimization and security enforcement, as it allows the database to apply certain optimizations and checks to the procedure. However, this option also imposes some restrictions on the procedure, such as prohibiting any INSERT, UPDATE, DELETE, or MERGE statements, or any other statements that modify the database state. Dynamic SQL, which is SQL code that is constructed and executed at run time, is still allowed, as long as it does not violate the READS SQL DATA option.For more information on the READS SQL DATA option, see [Procedure Header Options]4.
If, in the database procedure header, you use the SQL SECURITY INVOKER option, then only the owner of the procedure can start it. The SQL SECURITY INVOKER option is used to indicate that the procedure is executed with the privileges of the user who invokes the procedure, rather than the privileges of the user who created the procedure. This option is useful for security enforcement and access control, as it allows the database to apply the appropriate authorization checks and restrictions to the procedure. However, this option does not affect who can start the procedure, as this is determined by the GRANT EXECUTE statement, which grants the execute privilege on the procedure to a specific user or role. The SQL SECURITY INVOKER option only affects how the procedure is executed, not who can execute it.For more information on the SQL SECURITY INVOKER option, see [Procedure Header Options]4.
Limited Time Offer
25%
Off
Martin
4 months agoSkye
4 months agoLucille
4 months agoMaia
4 months agoPatria
4 months agoArlean
5 months agoMary
4 months agoShonda
4 months agoTyra
4 months agoMary
4 months agoVivienne
4 months agoRosalind
5 months agoMaynard
5 months agoMaynard
5 months agoDean
6 months ago