SlideShare a Scribd company logo
1 of 10
SCALAR USER DEFINED
FUNCTION IN SAP HANA
Kabilarasan RPresented by
Scalar User Defined Function
 The simplest database object for which you can make use of SQL
Script are Scalar User- Defined Functions (Scalar UDFs)
 Scalar UDFs allow you to the define functions which take a number
of input parameters and return scalar values.
 Only expressions are allowed in the body of the UDF, so no table
operations, CE functions or array operations.
Scalar User-Defined Functions Support
the Following:
 They can have any number of scalar input parameters (primitive SQL types). Input parameters of
table type are not supported.
 They can return multiple scalar values.
 They can contain expressions within their body. Table and array operations are not supported.
 They can be used in the field list or the WHERE clause of SELECT statements — like built-in
functions.
 They are callable via direct assignment in other user-defined functions or stored procedures (x :=
my_scalar_func () ).
 They must be free of side-effects and do not support any type of SQL statement in their body.
Basic Syntax to Define a Scalar User-
Defined Function
CREATE FUNCTION <function name> (<list of input parameters with
type>)
RETURNS <scalar result parameter name and type>
AS BEGIN
<function body>
END;
Note:
 You can create scalar user-defined functions for use like built-in functions.
 Prefix parameter names with “:”to access their values.
create column table "KABIL_PRACTICE"."OVERTIME"
(
"E_ID" integer,
"E_NAME" Nvarchar(35),
"OVERTIME(in_Hrs)" Integer
);
Code:
To Create a table:
To Insert the values into a
table:
Insert into "KABIL_PRACTICE"."OVERTIME" values
(1,'Kabil',20);
Insert into "KABIL_PRACTICE"."OVERTIME" values
(2,'Nazeer',15);
Insert into "KABIL_PRACTICE"."OVERTIME" values
(3,'Kalai',10);
To Create function:
Create Function "KABIL_PRACTICE"."CONVERT_HRS"
(i_Hours integer)
returns result Decimal(34,2)
as begin
result := :i_Hours * 60;
End;
To Call the function using Dummy:
Select
"KABIL_PRACTICE"."CONVERT_HRS"
(1) from dummy;
Code: Result:
To Use the function with the Table:
select
*,"KABIL_PRACTICE"."CONVERT_H
RS"("OVERTIME(in_Hrs)") as
"OVERTIME_in_Minutues" from
"KABIL_PRACTICE"."OVERTIME";
Code: Result:
NOTE:
 The only way to change the body of an existing user-defined function using SQL
statements is to delete the function and re-create it.
 You can also use imperative logic in scalar user-defined functions, to the extent this
does not conflict with the statements above.
 Imperative language constructs allow the developer to control data and control flow,
for example loops, scalar variables and if-then-else statements.
For More Details Visit: http://kabilsapworld.blogspot.com/
THANK YOU!

More Related Content

What's hot

An Overview of SAP S4/HANA
An Overview of SAP S4/HANAAn Overview of SAP S4/HANA
An Overview of SAP S4/HANADebajit Banerjee
 
S4H_399 2 SL _Onboarding Presentation (2).pptx
S4H_399 2  SL _Onboarding Presentation (2).pptxS4H_399 2  SL _Onboarding Presentation (2).pptx
S4H_399 2 SL _Onboarding Presentation (2).pptxchandramohan431817
 
Zebra sap-smartforms-solution
Zebra sap-smartforms-solutionZebra sap-smartforms-solution
Zebra sap-smartforms-solutionmartin_josep
 
Sap fico interview_questions_answers_explanations
Sap fico interview_questions_answers_explanationsSap fico interview_questions_answers_explanations
Sap fico interview_questions_answers_explanationsRanjit Kumar
 
Power BI Overview, Deployment and Governance
Power BI Overview, Deployment and GovernancePower BI Overview, Deployment and Governance
Power BI Overview, Deployment and GovernanceJames Serra
 
Process optimization and automation for SAP S/4HANA with SAP’s Business Techn...
Process optimization and automation for SAP S/4HANA with SAP’s Business Techn...Process optimization and automation for SAP S/4HANA with SAP’s Business Techn...
Process optimization and automation for SAP S/4HANA with SAP’s Business Techn...SAP Technology
 
Dmm300 – mixed scenarios for sap hana data warehousing and BW: overview and e...
Dmm300 – mixed scenarios for sap hana data warehousing and BW: overview and e...Dmm300 – mixed scenarios for sap hana data warehousing and BW: overview and e...
Dmm300 – mixed scenarios for sap hana data warehousing and BW: overview and e...Luc Vanrobays
 
Sap S/4 HANA New Implementation
Sap S/4 HANA New ImplementationSap S/4 HANA New Implementation
Sap S/4 HANA New ImplementationSoumya De
 
How to use abap cds for data provisioning in bw
How to use abap cds for data provisioning in bwHow to use abap cds for data provisioning in bw
How to use abap cds for data provisioning in bwLuc Vanrobays
 
Funds management configuration sap ag
Funds management configuration sap agFunds management configuration sap ag
Funds management configuration sap agLluckyy
 
Upload images in to sap hana
Upload images in to sap hanaUpload images in to sap hana
Upload images in to sap hanaGeetha Madhuri
 
SAP S_4HANA Migration Cockpit - Migrate your Data to SAP S_4HANA.pdf
SAP S_4HANA Migration Cockpit - Migrate your Data to SAP S_4HANA.pdfSAP S_4HANA Migration Cockpit - Migrate your Data to SAP S_4HANA.pdf
SAP S_4HANA Migration Cockpit - Migrate your Data to SAP S_4HANA.pdfsubbulokam
 
SAP Business One for Project Management
SAP Business One for Project Management SAP Business One for Project Management
SAP Business One for Project Management Kevin Kuttappa
 

What's hot (20)

SAP CPI - DS
SAP CPI - DSSAP CPI - DS
SAP CPI - DS
 
An Overview of SAP S4/HANA
An Overview of SAP S4/HANAAn Overview of SAP S4/HANA
An Overview of SAP S4/HANA
 
S4H_399 2 SL _Onboarding Presentation (2).pptx
S4H_399 2  SL _Onboarding Presentation (2).pptxS4H_399 2  SL _Onboarding Presentation (2).pptx
S4H_399 2 SL _Onboarding Presentation (2).pptx
 
Zebra sap-smartforms-solution
Zebra sap-smartforms-solutionZebra sap-smartforms-solution
Zebra sap-smartforms-solution
 
Sap fico interview_questions_answers_explanations
Sap fico interview_questions_answers_explanationsSap fico interview_questions_answers_explanations
Sap fico interview_questions_answers_explanations
 
Power BI Overview, Deployment and Governance
Power BI Overview, Deployment and GovernancePower BI Overview, Deployment and Governance
Power BI Overview, Deployment and Governance
 
SAP A1 Vs SAP B1
SAP A1 Vs SAP B1SAP A1 Vs SAP B1
SAP A1 Vs SAP B1
 
Process optimization and automation for SAP S/4HANA with SAP’s Business Techn...
Process optimization and automation for SAP S/4HANA with SAP’s Business Techn...Process optimization and automation for SAP S/4HANA with SAP’s Business Techn...
Process optimization and automation for SAP S/4HANA with SAP’s Business Techn...
 
Dmm300 – mixed scenarios for sap hana data warehousing and BW: overview and e...
Dmm300 – mixed scenarios for sap hana data warehousing and BW: overview and e...Dmm300 – mixed scenarios for sap hana data warehousing and BW: overview and e...
Dmm300 – mixed scenarios for sap hana data warehousing and BW: overview and e...
 
Sap S/4 HANA New Implementation
Sap S/4 HANA New ImplementationSap S/4 HANA New Implementation
Sap S/4 HANA New Implementation
 
How to use abap cds for data provisioning in bw
How to use abap cds for data provisioning in bwHow to use abap cds for data provisioning in bw
How to use abap cds for data provisioning in bw
 
Sapui5 & Fiori
Sapui5 & FioriSapui5 & Fiori
Sapui5 & Fiori
 
Funds management configuration sap ag
Funds management configuration sap agFunds management configuration sap ag
Funds management configuration sap ag
 
1668146695188.pdf
1668146695188.pdf1668146695188.pdf
1668146695188.pdf
 
Sap bw bi
Sap bw biSap bw bi
Sap bw bi
 
Upload images in to sap hana
Upload images in to sap hanaUpload images in to sap hana
Upload images in to sap hana
 
Informatica session
Informatica sessionInformatica session
Informatica session
 
Oracle Fusion Application
Oracle Fusion ApplicationOracle Fusion Application
Oracle Fusion Application
 
SAP S_4HANA Migration Cockpit - Migrate your Data to SAP S_4HANA.pdf
SAP S_4HANA Migration Cockpit - Migrate your Data to SAP S_4HANA.pdfSAP S_4HANA Migration Cockpit - Migrate your Data to SAP S_4HANA.pdf
SAP S_4HANA Migration Cockpit - Migrate your Data to SAP S_4HANA.pdf
 
SAP Business One for Project Management
SAP Business One for Project Management SAP Business One for Project Management
SAP Business One for Project Management
 

Similar to Scalar user defined function in sap hana

Similar to Scalar user defined function in sap hana (20)

Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Function
FunctionFunction
Function
 
Mysql creating stored function
Mysql  creating stored function Mysql  creating stored function
Mysql creating stored function
 
Understand when to use user defined functions in sql server tech-republic
Understand when to use user defined functions in sql server   tech-republicUnderstand when to use user defined functions in sql server   tech-republic
Understand when to use user defined functions in sql server tech-republic
 
ADVANCED MODELLING.pptx
ADVANCED MODELLING.pptxADVANCED MODELLING.pptx
ADVANCED MODELLING.pptx
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
Sql functions
Sql functionsSql functions
Sql functions
 
Les13
Les13Les13
Les13
 
[Www.pkbulk.blogspot.com]dbms07
[Www.pkbulk.blogspot.com]dbms07[Www.pkbulk.blogspot.com]dbms07
[Www.pkbulk.blogspot.com]dbms07
 
Functions in sap hana
Functions in sap hanaFunctions in sap hana
Functions in sap hana
 
SQL
SQLSQL
SQL
 
Advanced plsql mock_assessment
Advanced plsql mock_assessmentAdvanced plsql mock_assessment
Advanced plsql mock_assessment
 
Sqlapi0.1
Sqlapi0.1Sqlapi0.1
Sqlapi0.1
 
Cursors, triggers, procedures
Cursors, triggers, proceduresCursors, triggers, procedures
Cursors, triggers, procedures
 
Introduction to Oracle Database.pptx
Introduction to Oracle Database.pptxIntroduction to Oracle Database.pptx
Introduction to Oracle Database.pptx
 
Chapter09
Chapter09Chapter09
Chapter09
 
Sql views, stored procedure, functions
Sql views, stored procedure, functionsSql views, stored procedure, functions
Sql views, stored procedure, functions
 
Sq lite
Sq liteSq lite
Sq lite
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 

Recently uploaded

Spark3's new memory model/management
Spark3's new memory model/managementSpark3's new memory model/management
Spark3's new memory model/managementakshesh doshi
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
Data Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxData Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxFurkanTasci3
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Service
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Service
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Servicejennyeacort
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Data Warehouse , Data Cube Computation
Data Warehouse   , Data Cube ComputationData Warehouse   , Data Cube Computation
Data Warehouse , Data Cube Computationsit20ad004
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 

Recently uploaded (20)

Spark3's new memory model/management
Spark3's new memory model/managementSpark3's new memory model/management
Spark3's new memory model/management
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
Data Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxData Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptx
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Service
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Service
Call Girls In Noida City Center Metro 24/7✡️9711147426✡️ Escorts Service
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Data Warehouse , Data Cube Computation
Data Warehouse   , Data Cube ComputationData Warehouse   , Data Cube Computation
Data Warehouse , Data Cube Computation
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 

Scalar user defined function in sap hana

  • 1. SCALAR USER DEFINED FUNCTION IN SAP HANA Kabilarasan RPresented by
  • 2. Scalar User Defined Function  The simplest database object for which you can make use of SQL Script are Scalar User- Defined Functions (Scalar UDFs)  Scalar UDFs allow you to the define functions which take a number of input parameters and return scalar values.  Only expressions are allowed in the body of the UDF, so no table operations, CE functions or array operations.
  • 3. Scalar User-Defined Functions Support the Following:  They can have any number of scalar input parameters (primitive SQL types). Input parameters of table type are not supported.  They can return multiple scalar values.  They can contain expressions within their body. Table and array operations are not supported.  They can be used in the field list or the WHERE clause of SELECT statements — like built-in functions.  They are callable via direct assignment in other user-defined functions or stored procedures (x := my_scalar_func () ).  They must be free of side-effects and do not support any type of SQL statement in their body.
  • 4. Basic Syntax to Define a Scalar User- Defined Function CREATE FUNCTION <function name> (<list of input parameters with type>) RETURNS <scalar result parameter name and type> AS BEGIN <function body> END; Note:  You can create scalar user-defined functions for use like built-in functions.  Prefix parameter names with “:”to access their values.
  • 5. create column table "KABIL_PRACTICE"."OVERTIME" ( "E_ID" integer, "E_NAME" Nvarchar(35), "OVERTIME(in_Hrs)" Integer ); Code: To Create a table: To Insert the values into a table: Insert into "KABIL_PRACTICE"."OVERTIME" values (1,'Kabil',20); Insert into "KABIL_PRACTICE"."OVERTIME" values (2,'Nazeer',15); Insert into "KABIL_PRACTICE"."OVERTIME" values (3,'Kalai',10);
  • 6. To Create function: Create Function "KABIL_PRACTICE"."CONVERT_HRS" (i_Hours integer) returns result Decimal(34,2) as begin result := :i_Hours * 60; End;
  • 7. To Call the function using Dummy: Select "KABIL_PRACTICE"."CONVERT_HRS" (1) from dummy; Code: Result:
  • 8. To Use the function with the Table: select *,"KABIL_PRACTICE"."CONVERT_H RS"("OVERTIME(in_Hrs)") as "OVERTIME_in_Minutues" from "KABIL_PRACTICE"."OVERTIME"; Code: Result:
  • 9. NOTE:  The only way to change the body of an existing user-defined function using SQL statements is to delete the function and re-create it.  You can also use imperative logic in scalar user-defined functions, to the extent this does not conflict with the statements above.  Imperative language constructs allow the developer to control data and control flow, for example loops, scalar variables and if-then-else statements.
  • 10. For More Details Visit: http://kabilsapworld.blogspot.com/ THANK YOU!