Tutorial by Examples: dur

DELIMITER $$ DROP PROCEDURE IF EXISTS sp_nested_loop$$ CREATE PROCEDURE sp_nested_loop(IN i INT, IN j INT, OUT x INT, OUT y INT, INOUT z INT) BEGIN DECLARE a INTEGER DEFAULT 0; DECLARE b INTEGER DEFAULT 0; DECLARE c INTEGER DEFAULT 0; WHILE a < i DO WHILE b <...
Overflow also happens during the operation. In the following example, x is an int, 1 is an int by default. Therefore addition is an int addition. And the result will be an int. And it will overflow. int x = int.MaxValue; //MaxValue is 2147483647 long y = x + 1; //...
proc myproc {} { puts "hi" } myproc # => hi An empty argument list (the second argument after the procedure name, "myproc") means that the procedure will not accept arguments.
proc myproc {alpha beta} { ... set foo $alpha set beta $bar ;# note: possibly useless invocation } myproc 12 34 ;# alpha will be 12, beta will be 34 If the argument list consists of words, those will be the names of local variables in the procedure, and their initi...
### Definition proc myproc {alpha {beta {}} {gamma green}} { puts [list $alpha $beta $gamma] } ### Use myproc A # => A {} green myproc A B # => A B green myproc A B C # => A B C This procedure accepts one, two, or three arguments: those parameters whose names are the fi...
proc myproc args { ... } proc myproc {args} { ... } ;# equivalent If the special parameter name args is the last item in the argument list, it receives a list of all arguments at that point in the command line. If there are none, the list is empty. There can be arguments, including optional one...
proc myproc {varName alpha beta} { upvar 1 $varName var set var [expr {$var * $alpha + $beta}] } set foo 1 myproc foo 10 5 puts $foo # => 15 In this particular case, the procedure is given the name of a variable in the current scope. Inside a Tcl procedure, such variables aren't...
For a function or subroutine to be useful it has to be referenced. A subroutine is referenced in a call statement call sub(...) and a function within an expression. Unlike in many other languages, an expression does not form a complete statement, so a function reference is often seen in an ass...
C++14 Those following duration user literals are declared in the namespace std::literals::chrono_literals, where both literals and chrono_literals are inline namespaces. Access to these operators can be gained with using namespace std::literals, using namespace std::chrono_literals, and using names...
To find active ScriptableObjects during runtime, you can use Resources.FindObjectsOfTypeAll(). T[] instances = Resources.FindObjectsOfTypeAll<T>(); Where T is the type of the ScriptableObject instance you're searching. Active means it has been loaded in memory in some form before. This me...
To call a stored procedure on the server: $query = "{call [dbo].[myStoredProcedure](?,?,?)}"; //Parameters '?' includes OUT parameters $params = array( array($name, SQLSRV_PARAM_IN), array($age, SQLSRV_PARAM_IN), array($count, SQLSRV_PARAM_OUT, SQLSRV_PHPTYPE_INT) //$cou...
Stored procedures can return values using the OUTPUT keyword in its parameter list. Creating a stored procedure with a single out parameter CREATE PROCEDURE SprocWithOutParams ( @InParam VARCHAR(30), @OutParam VARCHAR(30) OUTPUT ) AS BEGIN SELECT @OutParam = @InParam + ' must co...
Before making a pull request, it is useful to make sure that compile is successful and tests are passing for each commit in the branch. We can do that automatically using -x parameter. For example: git rebase -i -x make will perform the interactive rebase and stop after each commit to execute mak...
Resolving scoped services during application startup can be difficult, because there is no request and hence no scoped service. Resolving a scoped service during application startup via app.ApplicationServices.GetService<AppDbContext>() can cause issues, because it will be created in the sc...
If, during the conversion of: an integer type to a floating point type, a floating point type to an integer type, or a floating point type to a shorter floating point type, the source value is outside the range of values that can be represented in the destination type, the result is undefine...
By default stored procedures and functions or not generated by mysqldump, you will need to add the parameter --routines (or -R): mysqldump -u username -p -R db_name > dump.sql When using --routines the creation and change time stamps are not maintained, instead you should dump and reload the ...
Create example table Employee: CREATE TABLE Employee ( Id INT, EmpName VARCHAR(25), EmpGender VARCHAR(6), EmpDeptId INT ) Creates stored procedure that checks whether the values passed in stored procedure are not null or non empty and perform insert operation in Employee ta...
The NSTimeInterval value of this property indicates the seconds from which the date picker in countdown-timer mode counts down. If the mode of the date picker is not CountDownTimer, this value is ignored. Maximum value is 86,399 seconds (23:59) let datePicker = UIDatePicker(frame: CGRect(x: 0, y: 0...
Dynamic SQL enables us to generate and run SQL statements at run time. Dynamic SQL is needed when our SQL statements contains identifier that may change at different compile times. Simple Example of dynamic SQL: CREATE PROC sp_dynamicSQL @table_name NVARCHAR(20), @col_name NVARCHAR(2...
In a procedure with native compilation, T-SQL code is compiled to dll and executed as native C code. To create a Native Compiled stored Procedure you need to: Use standard CREATE PROCEDURE syntax Set NATIVE_COMPILATION option in stored procedure definition Use SCHEMABINDING option in stored pro...

Page 2 of 3