ArticleDirectory
- L stored procedure
- Use L to customize SQL Functions
Introduction
In SAP Hana, you can use SQL script to create a stored procedure.Programming LanguageTo implement specific applicationsProgramComplex computing stored procedures. L The stored procedure is basically the same as that of SQL Script Creation. data types or table types can be used as input and output parameters. That is to say, l can be used directly by other SQL script stored procedures or database clients, just like other stored procedures.
L is based on C/C ++ and can look at the subset of C ++; it is a static type; L is to be compiled, and l functions are not executed on the VM, it is executed on Standard C/C ++ functions.
Instance introduction l stored procedure
Create ProcedureSystem.Proc(...) Language llang reads SQL dataAs BeginImport "content: COM. sap. My. lib" mylib; export void main (...) {... mylib: F1 (...);...}End
First, content: COM. sap. My. Lib is imported, and mylib is the namespace of L. The prefix content indicates that the Library is in the repository of SAP Hana. In the main function, we call the F1 function in the library. Entire LCodeIt looks very similar to C ++.
Use L to customize SQL Functions
Create FunctionSqr (xDouble)Returns"Y"DoubleLanguage llangAs BeginExport void main (Double"X" X,Double"Y"&Y) {Y=X*X ;}End;
You can use this statement to call this function.
SelectSqr (doublevaluecol)FromTable1
For the time being, we will introduce this point first. If you are interested, you can communicate offline.