Assistance on Division Function

Hello, I am new to PL/SQL. Is there a proper structure or procedure to take for example: (Total column 1) minus (Total Column 2) all divided by (Total Column 1)? Is the coding written the same way as SQL? Do I need to be worried about data structure? Thanks for your help in advance.
Andy

Thanks for the quick reply William H.
Question, here is the current code I am to update. The "Present" formula is supposed to calculate specified time period and supplier, and I am to change the formula (Total Lot 01 and 08 types) minus (Total Inspection lots 01 and 08 of UD Code A080 etc..) all divided by (Total Inspection 01 and 08) to (Inspection type 01) minus (Total Inspection lot type 01, 08, UD Code 080 etc..) all divided by (Inspection type 01.) My question is I do not see any calculations within this procedure. I see the totals being displayed. Am i missing something? I dont understand how I can simply change the formula when I do not see a formula to start out with.
Procedure PopulateQualitySummaryTable
     Is
          -- Method variables
v_tableName Varchar2 (100) := 'QUALITYSUMMARY';
v_tableCount Number (1);
v_sql Varchar2 (4000);
     Begin
          -- Does this table exist
SELECT count (*)
INTO v_tableCount
FROM user_tables
WHERE table_name = v_tableName;
-- Drop the table if it exists
IF v_tableCount = 1 THEN
EXECUTE IMMEDIATE 'DROP TABLE ' || v_tableName;
End If;
-- Create sql statement to create table
v_sql := 'CREATE TABLE ' || v_tableName || ' AS
SELECT NVL (a.Defects, 0) Exceptions, b.Total Total,
b.period, b.plant, b.vendor
FROM (SELECT count (*) Defects, period, plant, vendor
          FROM inspectiondata
WHERE (insplottype = ''01'' Or insplottype = ''08'') And
(udcode = ''A050'' Or udcode = ''A080'' Or udcode = ''R020'' Or udcode = ''R040'')
GROUP BY period, plant, vendor)
     a,
     (SELECT count (*) Total, period, plant, vendor
          FROM inspectiondata
     GROUP BY period, plant, vendor)
     b
WHERE a.period (+) = b.period And
a.plant (+) = b.plant And
a.vendor (+) = b.vendor';
-- Create table
EXECUTE IMMEDIATE v_sql;
End PopulateQualitySummaryTable;

Similar Messages

  • I do not see the DAQ Assistant Express on Functions Input palette.

    Software config: Windows XP machine, Traditional NI-DAQ 7.4.4 for PCI 6602. I do not see the DAQ Assistant express on Functions>>Input palette. I get error message when I place the Instrument I/O assistant on the block diagram:-" Measurement and Automation Explorer or Instrument I/O Assistant not installed correctly. Please install from LabVIEW CD". I've tried uninstalling, re-installing driver and rebooting my computer several times.

    Hello PJ-SJM,
    The DAQ Assistant Express VI installs with the NI-DAQmx Driver and not Traditional NI-DAQ.  The good news is that the PCI-6602 is supported in both Traditional NI-DAQ and NI-DAQmx.  Check this KnowlegeBase article to find out what version of NI-DAQmx you need and then search the Drivers and Updates page for to find the version you need.  Once you download and install the driver you should see the DAQ Assistant Express VI on your functions pallet.
    The Instrument I/O Assistant is not for use with DAQ cards, it is for using other communication protocol like serial or GPIB.  However, if you need this you can install the Device Driver CD and it should work after that.  Note:  The device driver CD that came with LabVIEW should also contain the correct version of NI-DAQmx.
    I hope this helps, and have a great Friday!
    Brooks

  • Migration Assistant - from non functioning imac to new imac?

    My daughter's G5 imac has a bad graphics card (per apple store genius). Logic board is apparently OK but computer can't be used. She has decided to buy new a imac. Her concern is all of the data on her old imac's hard drive which she wants to transfer to the new imac. Normally, migration assitant would do this. However, as stated above, her old imac is not functioning in a normal way. My question: can she use migration assistant even though she can't do anything with her old imac except look at the garbled screen?
    She also has an external hard drive that is supposedly up to date with backed up info.
    What are her options?

    I read and printed "How to use and troubleshoot Firewire target disk mode". Thanks for that link.
    The procedure in that article was for someone who wanted to transfer files between two computers. In my daughter's case the procedure is a little unclear. That is because, if I remember correctly, when you start up a new computer for the first time I'm not sure you see the desktop before the setup assistant starts. I guess one could connect the two computers and start up the new computer and a few seconds later start up the old computer and hold down the T key. That should put the hard drive of the target computer on the desktop of the host (new) computer. But when during the setup process would the setup assistant access the hard drive that would be appearing on the new computer's desktop?
    When the setup process was finished, if the old computer's hard drive was not accessed you could then manually select what you wanted to copy. But for some info this can be a tedious process.
    It has been a few years but I remember the process as being pretty much automatic starting with the setup assistant and having everything (personnel info, email, bookmarks, etc as well as files) transfered from my old to my new computer. I don't recall putting my old computer into Target Disk Mode to have everything transfered to my new computer. When you are going through the initial setup of a new computer, do you actually have to put the old computer into Target Disk Mode for the setup process to access your old info?

  • Request Assistance With Combining Functions

    Ned Murphy (or anyone else),
    I referenced some guidance you offered a while back concerning combining functions.  Your response was:
    Mar 19, 2012 6:45 AM in reply to witherton
    You do not want to be using the same name for a function and a variable. As far as combining the two functions, it would make sense to just have the doorColor function do all the work, though you do not need to use the if/else setup...
    var min = 1;
    var max = 3;
    function doorColor (event:MouseEvent)
    var getNewDoor:Number = Math.round(Math.random() * (max - min) + min);
    gotoAndStop("door"+String(getNewDoor));
    I'm building a program with a similar need to combine functions. I've got text input fields (answerBox and answerBox2).  I'm forcing the user to go to the first input text field with stage.focus = answerBox2.
    I used most of the code you recommended to witherton in my coding.  My desire is to combine the input from the two text fields to jump to a "Correct or "Incorrect" page once Enter is clicked.
    I included my coding to show you where I'm at.  Not sure if I inserted your snippet in the right place...for Line 68, I keep getting a 1083: Syntax error: else is unexpected.
    46  stop();
    47
    48  answerBox2.text = "";
    49  stage.focus = answerBox2;
    50  answerBox.text = "";
    51  stage.focus = answerBox;
    52
    53  stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
    54
    55  function keyPressed(evt:KeyboardEvent):void {
    56          if (evt.keyCode == Keyboard.ENTER) {
    57               if (answerBox2.text == "+80" || answerBox2.text == "+ 80" || answerBox2.text == "OVER 80" || answerBox2.text == "OVER80"|| answerBox2.text == "over 80" || answerBox2.text == "over80") {
    58                   //gotoAndStop(20); I previously used this for a single function
    59               } else {
    60                      if (answerBox2.text != "") {
    61                             //gotoAndStop(19); I previously used this for a single function
    62          if (answerBox.text == "R390" || answerBox.text == "R 390" || answerBox.text == "RIGHT390" || answerBox.text == "RIGHT 390"|| answerBox.text == "right 390" || answerBox.text == "right390") {
    63                     var answerBox2 = error1;
    64                     var answerBox = error2;
    65                     function TwoErrors(event:MouseEvent) {
    66                        var getTwoErrors:Keyboard.ENTER = Math(Math() * (error1 + error2));
    67                        gotoAndStop(20);
    68                    } else {
    69                       if (answerBox2.text + answerBox.text != "") {
    70                             gotoAndStop(19);
    71                          }
    72                      }
    73                  }
    74              }
    75          }
    76      }
    77 }
    I tried adding and deleting curly brackets at different lines, but the error is still there. Can you assist?
    Thanks!
    I'm really showing my inner noob, eh?

    What are you trying to accomplish with the lines:
    63                     var answerBox2 = error1;
    64                     var answerBox = error2;
    If those are the textfields names, then you don't want to be creating variables that are named the same as the textfields.
    Also, you appear to have a function nested within another function.  Don't do that.

  • Tare function DAQ assist and restart function for the vi program

    Hi!
    I have a program that aquiers a signal from the DAQ assist. I have searched here on the forum and on the web, but I can't find a way to implement a tare function. The signal is from a loadcell and therby it would be good if Icould tare the signal to value zero. In the DAQ assist I can calibrate it manually, but i would like to wire this function to a button. 
    Also I have another problem that shouldn't be hard to solve, but I'm struggling with it. I want a resert function in my labview code so that i can restart the program from the begginging. I have used a case structure with normal and restart enum constant, and wierd them via a tunnel. But it dosn't seems to work. Instead of resetting the program it only stops it 
    I have attached my code below.
    Best Regards Maurlind
    Solved!
    Go to Solution.
    Attachments:
    Tare function and restart.vi ‏365 KB

    I solved my problem with the tare function, i used a case structure and shift register to store values in it. se picture below.
    I haven't found a way to restart my VI yet. I tried to implement something from the community , see this link: https://decibel.ni.com/content/docs/DOC-4747
    But that doesn't work for my VI and i don't know why. Could someone explain why doesn't work ?
    My goal is to restart my whole VI with a press of a button.
    Best Regards Maurlind
    Attachments:
    tare function.png ‏25 KB
    restart vi.vi ‏488 KB

  • Need Assistance for VBA function in oracle how to implement

    My very respected and Senior, regards,
    Sir, hope you will in best of health and wealth by the grace of God,
    Sir, i have a request problem as i m very junior against you and you have passed this time before many years ago as i m standing where. Sir i m a very junior developer of oracle and have a problem putting on your desk with the hope that you can help my as a boss.
    Sir me have to calculate yield of Bond using oracle form
    i have tried my best and tired
    there is a formulae in excel which give the Yield() when we provide the parameters
    and i need the excel formulae or the oracle calculation code of PLSQL for this.
    How can i get yield when i have price, coupon rate, frequency, issue and maturity of the coupon , coupon period , next coming coupon , and others detail.
    or tell me how to use EXCEL VBA for this problem ,
    thnx n regards,
    yours student, junior developer youngest brother
    Faraz
    How can I get the solution using Excel VBA function with oracle
    so that move values to excel calculate them and copy the result from excel to oracle forms

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

  • Boot options duplicated; Boot Camp Assistant newly non-functional

    Short version:
    1. Up to tonight, my hard drive was encrypted using PGP Whole Disk Encryption -- secure boot and all. Had Boot Camp working fine with it.
    2. Attempted to install OS X 10.6.5 despite PGP warnings to decrypt first. Ended up with an unbootable OS X partition. Decrypted drive in Windows, got back into OS X.
    3. Disk Utility returned a few errors on OS X partition. Quickly fixed those by booting from Snow Leopard CD and running it.
    4. What I'm now noticing is that when I hold down the option key, I'm given duplicate options. Instead of "OS X Partition Name Here" and "Windows 7 Name Here", I've got a duplicate for the former. So my options are "OS X", "OS X", or "Windows".
    5. And, when I try to run Boot Camp Assistant out of curiosity, I'm told that I either need one big non-partitioned drive, OR existing partitions created by Boot Camp. I already did that.
    Any thoughts on fixing #4 or #5? Resetting PRAM doesn't help. Windows does not show as an option in "Startup Disk" in system preferences. But the Windows partition boots just fine when holding option on restart.

    And since I can't edit my original post any longer, here's what fixed the redundant boot option thing:
    http://hints.macworld.com/article.php?story=20091111185717745
    Worked like a charm. Fixed the duplicate "OS X" option on boot, and both OSes boot normally. Can now click past the first few options in Boot Camp Assistant, so I'm assuming that's working normally now also.
    Still no Windows option in Startup Disk, but apparently that's related to my use of NTFS-3g? Thought that was fixed.
    sudo fdisk /dev/rdisk0 is now:
    Disk: /dev/rdisk0 geometry: 30401/255/63 [488397168 sectors]
    Signature: 0xAA55
    Starting Ending
    #: id cyl hd sec - cyl hd sec [ start - size]
    1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639] <Unknown ID>
    2: AF 1023 254 63 - 1023 254 63 [ 409640 - 423624704] HFS+
    *3: 07 1023 254 63 - 1023 254 63 [ 424298496 - 64098304] HPFS/QNX/AUX
    4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
    Only thing I'm worried about now is whether I might have damaged any files though any of this crap. Don't know if I can check for that, or if I should worry about it.

  • Blackberry Assistant, features and functions

    According to the Blackberry Classic user guide, when using the Blackberry Assistant and working with E-mails you can: Send an e-mail, reply to an e-mail, and search your e-mail messages. However I'm unable to search or find any E-mails using the assistant in that it responds that no E-mails were found. If I issue the command "read messages' the assistant will search and notify me of any text messages and request further direction such as read, reply etc.
    Now, I have the Hub configured to display all E-mails, messages etc. in separate folders only but given that text messages are being read I don't think this should make any difference.

    I do PowerPoint presentations very often... it is a pain to bring a pointer, and have the pointer work at every business meeting. it would be grand to have a pointer bulit-in with smart phone.

  • Moto assist very limited functionality

    Does anyone find the moto assist very limited? The preset "sleeping, driving,home and meeting" settings have very few options.
    I used to have a droid maxx HD and it had something called "smart actions" app that allowed you to set dozens of automated triggers.  For instance I used to be able to set a time that the phone would essentially go into airplane mode so it wasn't draining the battery yet stay on so I could use it as an alarm clock.   Moto assist has a "sleeping" setting but it only silences the phone and doesnt let you tweak many features.
    Moto assist should be able to do something as simple as this,  For either home or work locations, it should automatically turn off data and connect to wifi. 

    Short answer is No. Having had several Moto and Droid phones, answer is no. Maybe it will get better when Android v5 rolls out for Droid Turbo but I doubt it will happen.

  • Burrito Code assist doesn't function in CDATA

    Hello,
    In my installation of the Burrito (OS 10.6.4) the Code assist works only in MXML, but not in CDATA blocks.
    Needless to say that I've checked the Preferences:
    Thanks for the help,
    FTQuest

    Thanks for the quick reply, Jason.
    Here are two screen shots showing that in MXML the Code assist DOES work:
    and in <fx:Script> it does NOT:
    Just to reiterate: this is OS 10.6.4; the workspace is default, i.e. Documents/Adobe Flash Builder Burrito Preview/
    Curiously, the Code assist is working just fine in the release Builder, even with 'Hero' SDK.
    Thanks for looking into the issue.
    Igor Borodin

  • Division Script in Acrobat 5

    Just trying to get a simple division script to work
    var a = this.getField {"Loan Amt"};
    var b = this.getField {"Comp5"};
    event.value = a.value / b.value
    keep getting this message
    SyntaxError:missing; before statement at Line 1
    help is appreciated
    Thanks

    You're using curly braces where you should be using parentheses. Also, you should make sure the denominator value is not zero before you do the division:
    (function () {
        // Get field values as numbers
        var a = +getField("Loan Amt").value;
        var b = +getField("Comp5").value;
        // Perform the calculation
        event.value = b ? a / b : "";

  • Need help with not working timer Hp Display Assistant

    Hello i got monitor LA 2306v and when i want use "timer" option in Hp Display Assistant it doesn't work "sheduler" options fork perfect but "timer" one at all :/ Using Windows Vista home premium and got newest version of Hp Display Assistant.
    ill be rly grateful for help thanks

    The following was taken from here.
    HP Display Assistant is a Windows-based software utility designed for select HP displays that support
    the Display Data Channel/Command Interface (DDC/CI) communications channel defined by the Video
    Electronics Standards Association (VESA). HP Display Assistant does not function on non-HP displays
    (including non-HP displays that support DDC/CI), and does not function on HP displays that do not
    support DDC/CI. For a list of leading graphics cards that support HP Display Assistant:
    1.  Open HP Display Assistant.
    2.  Click the Options tab.
    3. Click the Help button.
    4. Click the Tech. Support button to open the HP Display Assistant online support Web page.
    5. Click the Compatibility link on the Web page.
    Is the computer's video card on the supported/compatible list?  If the video card does not support the feature, then the program won't work. 
    Let me know if the computer's graphics card is on the list. 
    Also, report what graphics card the system is using. 
    I await your reply. 
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Outlook 2007 & Exchange 2007 - Out of office assistant not working

    Hi,
    when using outlook 2007 and the users mailbox is on an Exchange 2007 server the out of office assistant doesn't work. When you start the out of office assistant the following message is displayed:
    'Your Out of Office settings cannot be displayed, because the server is currently unavailable. Try again later.'
    Using Outlook 2003 and connect to the same mailbox, the assistant works fine, however you don't have the additional features new to the Assistant.
    Also, when using outlook 2007 and connect to an Exchange 2003 mailbox the out of office assistant is also functioning fine.
    Using Outlook Web Access on Exchange 2007 to set the out of office assistant works also fine, so the error message is not correct.
    Any idea how to fix this ?
    Franc.

    Whilst I agree that auto-discover and other comment's could be upheld, I know that even when EWS and auto-discover are setup correctly that this problem will still occur.
    I manage an Exchange 2007 environment with 300 users and and Exchange 2010 environment with 700 user's all using Outlook 2007.  We are in the progress of deploying Outlook 2010 but I know with the new authentication process of the Outlook
    client with Exchange 2007 or older and Outlook 2007 or older, this problem will still occur.
    I know that their are just a few out of a 1,000 user base that experience this problem, so I don't see how global settings and configurations and settings are the culprit.
    Just like the problem caused by a badly designed update in November or December of last year that meant auto-discover does not auto-configure a new Outlook profile because it would not detect the user's e-mail address but somehow create some random e-mail
    address with the AD account name before the @ and the FQDN for the domain name, which involved a further release of another update several month's later to fix that.
    Plus the other problem with the daily and frequent prompt's throughout the day for OWA domain login credential's despite being authenticated and Outlook contacting Exchange fine signified by the bottom-right hand corner status stating so.  I press escape
    and Outlook carries performing as normal for it do the same a few hours later, however I find that after about half a dozen prompt's over several days, it will disconnect the Outlook client saying 'Need Password' in the bottom-right, which despite left and
    right-mouse clicking does not load a login prompt to re-enter credentials that I should not need to be doing in the first place considering that I am logged in with the correct domain account on my computer and using the destined mailbox for that AD account.
    Exiting Outlook gracefully and re-launching Outlook a few seconds later allowing time for the background application handles and sub-handles amongst probably other things from the previous Outlook session to close (although, I do find every so often this
    process is hampered every so often by having to end the Outlook.exe process directly through Task Manager before being able to re-attempt launching the Outlook client) and Outlook will just reconnect without the need or receiving a prompt to enter the login
    details but I will no doubt receive another login prompt that I can likely just press cancel to or the escape button or perhaps, have to follow the above process again.
    Just like releasing SP1 for Exchange 2010 to add more problems that worked without it but fixing those problems that existing in 2010.
    I find that deleting a database result's in a failure error that in fact does successfully remove the database but since SP1, I know have to run a shell command to remove the database in the registry to delete an entry from a 'state' and 'lockstate' folder
    before I am rid of the Exchange configuration, to then have to suspend all database copies on that server and re-start all of the Exchange services before I can actually delete the edb file.  Just absurd.
    It's all just a backwards and forwards exercise with Microsoft but would love permanent solutions to all of the above.  Please advise on the above because it is a major irritation.

  • Obsolete function module in ECC6 - what to use instead of that

    I have to upgrade from SAP 4.7 to ECC6 .
    Some obsolete function module are as follows:
    ADDRESS_MAINTAIN
    ADDRESS_UPDATE_OLD
    DD_PR_REDEFINE
    GRAPH_DIALOG
    HELPSCREEN_NA_CREATE
    Can anybody assist me which function module to use in place of this function module or which class methods to be used instead of these function modules ?
    Thanks...

    Hi Deepak,
    For ADDRESS_MAINTAIN you can go this way for now.
    DATA : func_name TYPE rs38l_fnam.
    func_name = 'ADDRESS_MAINTAIN'. "To escape the EPC Check
        DO.
          CALL FUNCTION func_name
            EXPORTING
              adrswa_in         = sadr
              processing_status = mode
              kennzeichen       = kz
              save_intern       = 'X'
              title             = am_title
            IMPORTING
              adrswa_out        = sadr
              returncode        = return
              update_flag       = am_save
            EXCEPTIONS
              not_found         = 4.
    we haven't found any replacement for this. so doing it this way.
    ADDRESS_UPDATE_OLD - No Replacement for this.
    DD_PR_REDEFINE - No Replacement for this.
    GRAPH_DIALOG - No Replacement for this.
    All the Above 3 FMs are still being used in ECC standard programs.
    Thanks,
    Sai
    Edited by: Sai Krishna Kowluri on Dec 5, 2008 7:34 AM
    Edited by: Sai Krishna Kowluri on Dec 5, 2008 7:37 AM

  • Export in backup assistant not working

    My Verizon Export function for contacts in backup assistant is not functioning. It prompts to pick backup export action, e.g.to computer, gmail, etc. and it is supposed to give compatible format, e.g., CSV. Ony the pick format yourself work, but there is no continue button, only a close button for the dialog window. It does not work for anything.

    [oracle@localhost ~]$ expdb scott/tiger@oracl full=y directory=test dumpfile=fulldump.dmp logfile=full.log
    bash: expdb: command not found
    [oracle@localhost ~]$
    Command should be expdp not expdb
    Regards
    Asif Kabir

Maybe you are looking for

  • Quantity not updated in EDI Vendor posting

    Hi experts, We've observed that Quantity (MENGE) is not getting updated on the FI document (Segment 'E1EDP01'). Idoc type 'INVOIC01' and message we using is 'INVOIC01'. Any idea or has anyone come across this issue? Thanks for your time.

  • My bd-re drive is reading only cd

    I have Toshiba Qosmio x870-14m with a blueray drive Mat**bleep**a BD-MLT UJ260. For some reason, the drive stop reading dvds.after i reboot the system, it`s recognize the dvd, but after ejecting and put back again, doesn`t work.  i`ve tryed all the s

  • Can I Logon to Standby Database Using EM Console Without Broker?

    Can I logon to standby database using EM Console without broker?

  • Problem in Navigation from one tab to another

    Hi All, In my forms, I have three tabs. In one tab, i have a set of records displayed(like table) in which all columns are bound to a table. I want to sort the records in the tab based on one column. So i wrote the following code in WHEN-TAB-PAGE-CHA

  • How to edit menu down arrows?

    In my horizontal menu navigation bar, the down arrows are too far from text. How to edit?