Convert money into words using PL SQL function, | Oracle Class - Wissem. Note : Please note that this is a limited function. This function does not work for you if you try to test with numbers higher than 5. This number is the limit of the oracle “julian” date. If you try to test it with a higher number you will probably get an ORA- 0. Please read what I put carefully, I do not want someone test it with a higher number and complaining that this function does not work for him / or for her. The code of the function : CREATE OR REPLACE FUNCTION MONEY_TO_WORDS(P_MONEY IN NUMBER)RETURN VARCHAR2 ASW_RETURN VARCHAR2(2. BEGINIF P_MONEY < 0 THENW_RETURN : = ‘Negative number is not allowed!’; ELSIF P_MONEY = 0 THENW_RETURN : = ‘Zero Euro and zero cents’; ELSEIF (TRUNC(P_MONEY) = 0) THENW_RETURN : = ‘Zero Euros’; ELSIF (TRUNC(P_MONEY) = 1) THENW_RETURN : = ‘One Euro’; ELSEW_RETURN : = TO_CHAR(TO_DATE(TRUNC(P_MONEY), ‘J’), ‘Jsp’) || ‘ Euros ‘; END IF; IF ((P_MONEY – TRUNC(P_MONEY)) = 0) THENW_RETURN : = W_RETURN || ‘ Exactly’; ELSIF ((P_MONEY – TRUNC(P_MONEY)) * 1. THENW_RETURN : = W_RETURN || ‘ and one cent’; ELSEW_RETURN : = W_RETURN || ‘ and ‘ ||TO_CHAR(TO_DATE((P_MONEY – TRUNC(P_MONEY)) * 1. J’),‘jsp’) || ‘ cents’; END IF; END IF; RETURN W_RETURN; EXCEPTIONWHEN OTHERS THENDBMS_OUTPUT. PUT_LINE(‘Error : ‘ || SQLERRM); RETURN ‘CAN NOT CONVERT YOUR INPUT TO WORDS!’; END; /Test : Tested on Oracle 1. Enterprise Edition Release 1. C: \Documents and Settings\welkhlifi> sqlplus /nolog. SQL*Plus: Release 1. Production on Lun Abr 1. Copyright (c) 1. 98. Oracle. All rights reserved. SQL> connect sys as sysdba. Introduzca la contrase±a: Conectado. SQL> SQL> set time on timing on echo on serveroutput ON2. SQL> DECLARE2. RESULT VARCHAR2(1. Call the function. Eight Hundred Eighty- Three Euros and eighty- nine cents. Procedimiento PL/SQL terminado correctamente. Transcurrido: 0. 0: 0. SQL> Transcurrido: 0. SQL> DECLARE2. ![]() RESULT VARCHAR2(1. Call the function. Nine Hundred One Thousand Twenty- One Euros and one cent. Procedimiento PL/SQL terminado correctamente. Transcurrido: 0. 0: 0. SQL> Limitation : 2. SQL> DECLARE2. RESULT VARCHAR2(1. Call the function. Error : ORA- 0. 18. Juliano debe estar entre 1 y 5. CAN NOT CONVERT YOUR INPUT TO WORDS! Procedimiento PL/SQL terminado correctamente. For a good overview about first experiences with Oracle Database Standard Edition 12.1.0.2 (SE2) please see Franck Pachot's excellent blog post here. 3 System Requirements Windows Firewall Configuration Oracle Database Extensions for.NET Requirements Oracle Developer Tools for Visual Studio. Oracle database 10g express edition free download - OpenLink Lite Edition ODBC Driver for Oracle 10g, dbForge Studio for Oracle Express Edition, OpenLink Express. Could I start on Oracle Standard edition and easily upgrade to Oracle Enterprise? Or do I need to rebuild the entire server? how does the upgrade path work? Oracle support referred me to Metalink Note 139642.1 to downgrade Enterprise Edition (EE) to the Standard Edition (SE). They said we can not just downgrade the. Using Oracle Enterprise Manager Cloud Control 12c's Oracle Data Guard setup and management capabilities to control downtime and simplify disaster recovery. Major Steps in the Upgrade Process for Oracle Database. Detailed instructions for upgrading an existing Oracle database to the new Oracle Database 11 g release are. Business Software Download Barcode Generator Label Maker Bulk SMS Software Database Converter Keylogger monitoring Data Protection Setup Maker Web Chat for websites. Transcurrido: 0. 0: 0. Oracle JDBC FAQ Updated April 15, 2014. This document contains answers to the most frequently asked questions about Oracle's JDBC drivers. Note that these address. Note : Please note that this is a limited function. This function does not work for you if you try to test with numbers higher than 5373484. This number is the limit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
October 2016
Categories |