Skip to Content mrc logo mrc logo
  • What is m-Power?
    Overview Demos Build Process Case Studies Specs Pricing Trial
    m-Power Resources
    Overview How-To Videos Webinars & Podcasts White Papers Fact Sheets
  • What does m-Power build?
    Overview Database Front-Ends Reporting CRM Systems Business Intelligence Dashboards Inventory Management Mobile Apps ERP Enhancements Modernization Spreadsheets to the Web MS Access to the Web B2B/Web Portals Scheduling Embedded Analytics Web Forms Workflow Data Exploration Budgeting & Forecasting APIs & Web Services Db2 Web Query Alternative
    Solutions by Industry
    Overview Manufacturing Government Foodservice Software Vendors Logistics & Supply Chain Software Consultants Healthcare
  • Development Services Training Mentoring
  • Overview Partners Press Releases Careers Events Contact Blog
  • Support Home FAQ Documentation Customer Portal Enhancements Updates Roadmap Techblog
Try m-Power

m-Power Manual

Browse:

  • Home
  • External Objects & UDFs
  • Introduction to User Defined Functions (UDF)
Back to Manual

UDF Introduction

 

All applications created with m-Power employ SQL to access the database. SQL, by itself, is a very powerful language. A database User Defined Function (UDF) allows users to extend the power of SQL. UDF's are a powerful yet simple way to perform routine data transformations, calculations, and complex SQL logic. Database vendors (IBM, Oracle, Microsoft, Sun, etc.) have specific requirements for creating UDFs; most allow the UDF to be written in SQL or another programming language such as C or RPG.

m-Power makes it easy to employ this new feature. A UDF can be defined at a global level to m-Power. An m-Power logical field can be defined at a table level to return a value from a UDF call. m-Power users then can select this logical UDF field as if it were any other database field and use it to display, sort, and select data in any m-Power application.

The uses for such a powerful feature are endless. A short list of examples:

Dates: Convert a numeric date field into a true date field for use in selecting or sequencing records. Or extract the year and month to perform on-the-fly period subtotaling in reports.

Order Totals: Access other DB tables and calculate an order total value by summing the order line price times the line quantity over many Order Detail records, making it available as a selectable field from the order header table.

On Hand Quantity: Calculate a product's current on hand valuation by combining several fields, if your database requires some logic to calculate such a value.

The use of UDF's in m-Power is well-documented in the following articles. Please see these documents for further details:

Register your UDF:

https://www.mrc-productivity.com/legacy/data-dictionary/user-defined-functions/how-to-create-and-register-a-udf/

Create Logical Fields with UDF's:

https://www.mrc-productivity.com/legacy/data-dictionary/create-a-logical-field-via-the-data-dictionary/

mrc Date Conversion UDF's:

https://www.mrc-productivity.com/legacy/data-dictionary/mrc-date-conversion-udfs/

Sample UDF Source Code:

https://www.mrc-productivity.com/legacy/data-dictionary/sample-udf-code/

Created: October 20, 2008 | Modified: December 27, 2011

Search


Browse By Category

Build Process (13)
Starting with m-Power (8)
Retrievals (10)
Reports (15)
Summaries (4)
Maintainers (17)
Graphs (8)
m-Power Data Explorer (4)
General (24)
Calculations (5)
Utilities (9)
m-Power Administration (23)
Security (11)
Freemarker (6)
m-Painter (29)
Form Validation (5)
External Objects & UDFs (12)
Deprecated Documentation (23)
Bootstrap Templates (7)

Popular Tags

SQL Compiling mrc-Productivity Series Production Video Database Performance Build Process Parameters Maintainer Dropdowns Retrieval Admin Form Validation Calculations Java Application Properties Bar Graphs Security Excel Graphing Record Selections Dates Reports Administration Graphs Tomcat Prompt Screens Bootstrap Templates Email Getting Started Summaries Graph Properties Popular RPG Retrievals Data Dictionary Freemarker Report m-Painter External Objects DB2 App Properties Maintainers Advanced

See all tags »

michaels, ross & cole, ltd. (mrc)

Privacy Policy Cookie Policy Cookie Settings Notice at Collection Do Not Sell or Share My Personal Information

mrc (US)

2001 Midwest Road
Suite 310
Oak Brook, IL 60523
630-916-0662

mrc (UK)

Mortlake Business Centre
20 Mortlake High Street
London, SW14 8JN
+44-20-335-59566


© mrc. All rights reserved.