Division in PL/SQL

Posted on 2007-08-10
Last Modified: 2013-12-07
I am unable to perform a simple division in PL/SQL.
I am new to PL/SQL and try the following operation and but my Stored Procedure seems to break at this point.

cRec.RC_FACTOR1 never contains zero.

vF1 := (cRec.RC_FACTOR2 - cRec.RC_FACTOR1) / cRec.RC_FACTOR1;

Question by:gkerster
    1 Comment
    LVL 6

    Accepted Solution

    are all of cF1 cRec.RC_FACTOR2 and cRec.RC_FACTOR1 of a floating point like number?
    if they aren't
    cast each one that isn't as
    cast(vF1 as number)
    and try putting the whole expression in a cast((expression) as number)

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
    This video shows how to recover a database from a user managed backup

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now