What is the difference between the 2 procedures pls. ?

What is the difference between the 2 procedures in syntax and bussiness pls.

CREATE OR REPLACE PROCEDURE Balance_quantity_update
    (V_STORE_ID IN NUMBER,  V_ITEM_SERIAL IN NUMBER) IS
  BEGIN
  UPDATE WH_T_ITEMS A
      SET BALANCE_QTY = ITEM_QTY
      WHERE STORE_ID = V_STORE_ID
      AND ITEM_SERIAL = V_ITEM_SERIAL
      AND ITEM_QTY = (SELECT MAX(ITEM_QTY)
                      FROM WH_T_ITEMS B
                      WHERE A.STORE_ID = B.STORE_ID
                     AND A.ITEM_SERIAL = B.ITEM_SERIAL);
   END;
   /
CREATE OR REPLACE PROCEDURE Balance_quantity_update
    (V_STORE_ID IN NUMBER,  V_ITEM_SERIAL IN NUMBER) IS
  BEGIN
  UPDATE WH_T_ITEMS A
      SET BALANCE_QTY =MAX(ITEM_QTY)
      WHERE STORE_ID = V_STORE_ID
      AND ITEM_SERIAL = V_ITEM_SERIAL   ;
   END;
   /
Kind regards

Abdetu...

I don't know exactly what you're asking. The query

UPDATE WH_T_ITEMS A
   SET BALANCE_QTY =MAX(ITEM_QTY)
 WHERE STORE_ID = V_STORE_ID
   AND ITEM_SERIAL = V_ITEM_SERIAL   ;

is not valid SQL from Oracle. As MAX aggregate functions cannot be used in a query like that because Oracle has no idea what you aggregate by. There is nothing preventing Oracle to change the syntax of the SQL language to allow an aggregate be used this way, but there is usually no reason to extend the SQL language like that.

You can assign the result of a query that included a total of BALANCE_QTY column, i.e.

UPDATE WH_T_ITEMS A
   SET BALANCE_QTY = (SELECT MAX(ITEM_QTY) FROM <> WHERE <>)
 WHERE STORE_ID = V_STORE_ID
   AND ITEM_SERIAL = V_ITEM_SERIAL   ;

I think I mentioned in some of your previous discussions, a data model where you have a table of ELEMENTS that has an ITEM_QTY and the BALANCE_QTY looks suspicious. You assign the value of the ITEM_QTY column to the BALANCE_QTY on the same line does only increase anxiety.

Justin

Tags: Database

Similar Questions

  • I want to upgrade to a newer Windows operating system Windows Vista Home Pro 64-bit. What is the recommended procedure?

    * Original title: upgrade

    I want to upgrade to a newer Windows operating system Windows Vista Home Pro 64-bit. What is the recommended procedure? I see that Windows 7 or 8, a free update to Windows 10 is offered. Should I buy 7 or 8 then you spend 10 or just buy 10?

    Thank you

    Jim

    Hello

    Depends on hardware configuration required on later operating systems, and also find out if the manufacturer of the laptop computer is supported and provides drivers for operating systems later as to whether it is possible or feasible to upgrade or not.

    There is no free upgrade Vista to 7, 8.1, or 10.

    Follow these steps before you buy Windows 7.

    Microsoft sells more than 7; Try Amazon.com.

    Go to your computer / computer laptop manufacturer Web site and see if Windows 7 drivers are available for your make and model computer / laptop.

    If this is not available, Windows 7 will not properly work for you.

    Run the "Windows 7 Upgrade Advisor.

    http://www.Microsoft.com/en-US/Download/details.aspx?ID=20

    Check if your specifications are compatible for Windows 7:

    "Windows 7 system requirements"

    http://Windows.Microsoft.com/en-us/Windows7/products/system-requirements

    "Windows 7 Compatibility Center" for software and hardware:

    http://www.Microsoft.com/Windows/compatibility/Windows-7/en-us/default.aspx

    Windows 7 upgrade paths:

    http://TechNet.Microsoft.com/en-us/library/dd772579 (v = ws.10) .aspx

    «Installation and reinstallation of Windows 7»

    http://Windows.Microsoft.com/en-us/Windows7/installing-and-reinstalling-Windows-7

    @@@@@@@@@@@@@@@@@@@@@@@@

    Follow these steps before buy you and upgrade (new installation) of Windows 8.1.

    Microsoft sells more than 8/8.1.

    Try Amazon.com, etc.

    Check if the manufacturer of your computer/laptop has Windows 8.1 drivers available for your model.

    If this is not available, Windows 8.1 not install and work properly for you.

    There is a lot of information in this first link from Microsoft:

    Download and run the Windows Upgrade Assistant 8.1 of to see if your machine is compatible Windows 8.1 and read the update for Windows 8.1: FAQ here

    "Update to Windows 8.1: FAQ".

    http://Windows.Microsoft.com/en-us/Windows-8/upgrade-to-Windows-8

    "8.1 for Windows system requirements.

    http://Windows.Microsoft.com/en-us/Windows-8/system-requirements

    @@@@@@@@@@@@@@@@@@@@@@@

    How to buy Windows 10:

    http://www.microsoftstore.com/store/msusa/en_US/cat/Windows/CategoryID.70036700

    But first make sure that you have the correct configuration and your computer manufacturer provides the right drivers for 10.

    https://www.Microsoft.com/en-us/Windows/Windows-10-specifications#sysreqs

    " System requirements Windows 10"

    https://www.Thurrott.com/Windows/Windows-10/3884/Windows-10-system-requirements

    Microsoft deploys Windows 10 available as free upgrade to Windows 7 features, Windows and Windows Phone 8.1 8.1 qualified. It will be available from July 29, 2015

    "FAQ Windows 10.

    http://www.Microsoft.com/en-us/Windows/Windows-10-FAQ

    See you soon.

  • What is the normal procedure for windows live support call and offer to fix errors on my computer?

    What is the normal procedure for "windows live support" to call and offer to fix errors on my computer?

    What is the normal procedure for "windows live support" to call and offer to fix errors on my computer?

    N° !!!
    Scam!
    Ignore and hang up. For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • Update my application. What is the proper procedure for updating an app/folio?

    I designed a folio in Indesign CS6 and created a folio application in adobe dps and downloaded successfully on the app store. Now, I want to update my application. What is the proper procedure for updating an app/folio?

    If it's a simple editing application, you will have to recreate the whole thing and

    submit an Apple update for approval.

  • What is the correct procedure to take a host of a hav?

    Sometimes need to take a host far a hav, what is the correct procedure for it?

    Thank you!

    George

    Disconnect the host in your cluster, and then remove host.  Or evacuate all customers outside the host, put in maintenance mode, and then remove the cluster

  • What is the correct procedure to abandon diskgroup asm is rac?

    Hello

    I would like to table a diskgroup in asm to the CCR? What is the correct procedure?
    1 should I disassemble the diskgroup firstly in 2 node?
    2 alter diskgroup xxx drop command to run in the 2 nodes or just 1 node?
    3. after droping command, is there any other procedures to be done?

    No matter what doc to follow?

    Thank you

    Andrew

    Hi André,.

    860523 wrote:
    Thank you very much. Oracle 10.2, if I unmount the diskgroup, I want something offline, or what is the procedure before changing disgroup xxx disassemble?

    You MUST remove (using DBCA) or move (using RMAN) all databases stored on the diskgroup (if exists) before giving up DISKGROUP.
    (1) check if there are any database using the DISKGROUP.
    The query above must return no rows.

    SQL>  SELECT D.NAME,C.INSTANCE_NAME,C.DB_NAME,C.STATUS
         FROM GV$ASM_DISKGROUP D , GV$ASM_CLIENT C
         WHERE D.GROUP_NUMBER=C.GROUP_NUMBER
         AND D.NAME = '';  
    
    no rows selected
    

    If the above query returns rows you remove and stop must all first trial or move the database to an another DISKGROUP.

    (2) remove the Diskgroup all instances of ASM, except one.

    ALTER DISKGROUP  DISMOUNT;
    

    (3) decline diskgroup of the ASM instance, that the diskgroup is still mounted

    DROP DISKGROUP ; -- If no files on DISKGROUP
    DROP DISKGROUP  INCLUDING CONTENTS; - If exits files on DISKGROUP
    

    Just it.

    Kind regards
    Levi Pereira

  • What is a difference between the Satellite & Satego?

    Hello

    Please, can someone tell me the difference between satego and satellite?

    The difference between the Satellite and the Satego is the same as the difference between the Satellite and the satellite ;)

    The difference is a portable computer name, but of course not all series are equipped with the same parts and peripherals!
    So it's not easy to say what are the exact differences between the single computer laptop series. Simply check the descriptions

  • Difference between function and procedure

    Hi all

    My doubt is that the procedure can be used to return multiple values with OUT parameter and function can also be used to do the same if necessary to return multiple values with OUT parameter.

    So with this point of view, which is maybe the difference between these types of the two objects. and obviously if necessary to choose one of these two, we'll go to procedure, why not function?

    What is perhaps the reason for this?

    Thanks in advance.

    Kind regards
    Vipin Kumar Rai

    Nitesh. wrote:
    The main difference I between stored procedure and function of stored procedures compiled only once and can be called again and again without be compiled every time, this improves performance and saves time, of other functions to compile every time as is called...

    Would you care to show what you mean. To the best of my knowledge this last statement is not correct.

    The main difference for procedures and functions it program design.

    A procedure should be used for something that is running a process, where nothing is required to be returned.
    A function should be used when a value is required to be returned.

    Yes, the procedures can have OUT parameters (as can functions) but that is generally considered bad practice. If you have values be returned, you must use a function with an appropriate return type (structured type if necessary) so that all the requirements of data is returned via the return value. IMO the only acceptable practice to use variables is when you use a variable IN OUT for something in a procedure for this element which is manipulated by the procedure, so for example you'd 'ManipulateData (myData); as a procedure rather than "myData: = ManipulateData (myData);" in function, where the latter would be using resources of additional memory (copies of data) in most cases.

  • Differences between process and procedures

    Hi all
    can someone tell me what are the differences between the processes and procedures? Is there a difference between a process with only automatic spots and a procedure?

    If your process dynamically invokes a procedure and your process and procedure called dynamically are in the same project, it will work when it is deployed to the Studio and business.

    However, if your process tries to dynamically call a procedure from another project, you're going to collide in a bug (the null pointer you get). Support may disagree, but on the company dynamically invoke a procedure of a process in a single project via an interface procedure must initiate a procedure in another project successfully if both are deployed on the same engine of the company.

    Suggest that you report it to the Support. If you need a simple project that duplicates the problem, here is a zip file which has two projects. A project is a process that dynamically calls a procedure through an interface. The invoked procedure is in the other project in the zip file.

    http://www.4shared.com/file/182416607/9e9763a4/InvokeProcedureInDifferentProj.html

    This is a project that works and that invokes a procedure successfully when the process and the invoked procedure are both in the same project.

    http://www.4shared.com/file/182420920/5b52f6b4/ProcedureBeingInvokedinSamePro.html

    Dan

  • What is a difference between 'Logical processors' and 'logical processors for each host?

    Hi all!

    In the official document VMware "vsphere-51-configuration-maxima" or "vsphere-55-configuration - maximums.pdf" in the section "ESXi host maximum rates------Maximums calculation" exists in the elements:

    "Maximum CPU------logical CPU for each host ' (vSphere 5.1: 160;)   vSphere 5.5: 320)

    and

    "Machine virtual maximums------virtual CPU by host ' (vSphere 5.1: 2048;)    vSphere 5.5: 4096)

    Question: what is the difference between the two?

    And a more complex thing to maximum rates:

    Virtual machines per host: 512

    Number of hosts per cluster: 32

    Therefore, the cluster may be Virtual Machines (maximum): 521 * 32 = 16384

    But in the document, we have only 4000 VMs in maximum.

    Why?

    Thank you

    Ramirez,

    I understand your question as difference between 1. logic virtual CPU vs / by the hosts and 2. cluster/host Max County VM.

    Consider the case below;

    2 servers ESXi - 20 mV

    ESXi taken 1-4, 2 cores / socket

    ESXi 2-8 Sockets, 2 cores / socket

    Now here number of CPU logic-(4 x 2) + (8 x 2) = 24

    20 virtual machines - 2 jacks, 2 core / socket

    Virtual CPU count - 20 x (2 * 2) = 80

    Hope your first confusion is clear now.

    And a more complex thing to maximum rates:

    Virtual machines per host: 512

    Number of hosts per cluster: 32

    Therefore, the cluster may be Virtual Machines (maximum): 521 * 32 = 16384

    But in the document, we have only 4000 VMs in maximum.

    Why?

    This means that even if you have 32 Guest and each host can accommodate 512 VMs each the maximum number of virtual machines per cluster may not exceed 4000. And it does not mean that you can have a maximum of VMS (512 * 32).

    ~ dGeorgey

  • Satellite A200 - 17 PSAE0E: what is a difference between 1.5 & 1.8 BIOS

    I just bought satellite A200 - 17 (PSAE0E) and BIOS in my machine is v1.50.
    On this page, I noticed later BIOS is 1.80 so I wonder what changes are there between these two BIOS?
    At the moment I am on Linux (ubuntu 7.10) as my OS and having two or three ACPI related problems so I can use the information on these changes.

    Hello

    Sorry to say, but as far as I know BIOS changes are not published on the page of Toshiba.
    I find some details about the driver Toshiba we page but nothing on the European driver Toshiba page.

    I guess that it s a part of politics.

  • What is the correct procedure to upgrade Windows Vista 32 BIT to Windows 7 home one '?

    I'm running Windows Vista Home premium 32-BIT.

    I bought the upgrade disc to install Windows 7 Edition home premium.

    Where can I find a procedure step by step to install the upgrade?

    Hello

    This is a very good guide for what you want to do:

    Make sure you go from Vista 32 bit to Windows 7 32 bit to be able to do an upgrade.

    «How To Upgrade from Vista to Windows 7 Edition Home Premium»

    http://www.howtogeek.com/HOWTO/6892/how-to-perform-an-upgrade-from-Vista-to-Windows-7/

    Make sure that you first run the Windows 7 Upgrade Advisor:

    Run the "Windows 7 Upgrade Advisor.

    http://www.Microsoft.com/en-US/Download/details.aspx?ID=20

    Check if your specifications are compatible for Windows 7:

    "Windows 7 system requirements"

    http://Windows.Microsoft.com/en-us/Windows7/products/system-requirements

    "Windows 7 Compatibility Center" for software and hardware:

    http://www.Microsoft.com/Windows/compatibility/Windows-7/en-us/default.aspx

    See you soon.

    Edit:

    Go to your computer / computer laptop manufacturer Web site and see if Windows 7 drivers are available for your make and model computer / laptop.

    If this is not available, Windows 7 will not properly work for you.

  • What is the correct procedure of DMBS_XPLAN for the query execution plan

    Hello.

    We are on Oracle 11.2.0.3 on Linux. I am dev. DBA and we have about 80 developers Java development team. They want to question the execution plan of queries to resolve the sqls. Generally, they use the GUI tools like the toad to see execution plan. I always use the procedure for the following query execution plan:

    
    

    Select * from
    Table (dbms_xplan.display_cursor (null, null, 'allstats + cost'));

    I should suggest that they use this too rather than rely on tools like the toad - because they can show estimated plan and not the actual plan. And to provide a sql, it is best to use the real plan to work with. Do not take account of 'allstats + cost' part in the command above, but my point is: should I ask them of still rely on sqlplus and not the GUI tools and use the command display_cursor package DBMS_XPLAN?

    I will be grateful for suggestions.

    OrauserN

    You must use the DBMS_XPLAN package and functionality.

    The tool used to run the package doesn't matter. A raw request to DISPLAY_CURSOR will run the same server code in any tool including Toad.

    If you rely on other GUI features (for example a "explain plan" button or similar) then you know what this feature of actuall application running under-the-covers.

    My suggestion would be to assess and consider using Oracle free sql developer version 4 because it is not only FREE but also uses the DBMS_XPLAN correctly.

    http://www.Oracle.com/technetwork/developer-tools/SQL-Developer/downloads/index.html?ssSourceSiteId=ocomen

  • What is the correct procedure to update Lightroom 5.7 to 6 Lightroom? My Cloud Creative application always reports Lightoom as being "up to date".

    If I choose "Check for updates" in the Help menu in Lightroom 5.7 I get the message that an upgrade is available. If I click on the button 'Download' from there I get sent to a web page with this message... «To upgrade to the latest version of Lightroom for use with your creative cloud membership, exit Lightroom, launch the creative cloud application and click on the 'Install' button next to Lightroom 5 "well there is no button 'Install' next to Lightroom 5 because creative cloud app reports that Lightroom is ' day'"»

    You must sign out of creative cloud in creative application cloud and then reconnect.

  • What is the best procedure for me to transfer my data from chrome to my new account of Fire Fox?

    Changing chrome Fire fox, please advise.

    Firefox can import data from Google Chrome, but not all (no names and passwords for example only).
    See:

Maybe you are looking for

  • New memory for Satellite M105

    I have a Toshiba M105 - S3084 which has a 2G memory (2 x 1 G modules). I bought a pair of memory 2G in replacement of current memory modules. Problem (I know it sounds strange), is that I can only find a place to put 1 of the memory sticks! I opened

  • Error on blue screen 0 X 0000008 codes #, 0XC0000005, 0XE14DCEB3, 0XB07C2B74

    I got a blue screen with the following error codes: 0 X 0000008 #, 0XC0000005, 0XE14DCEB3, 0XB07C2B74 and 0x00000000. Where do you find these codes on Microsoft?  What they mean and how to fix?

  • G6-2206tx: if I installed a windows operating system 8

    My hard crashed I put a new drive hard if I download the iso file of the official microsoft site and install this os means that windows 8 will be reconise my key export or not

  • Special Permission in Vista problem

    I am setting up a new computer, but would like to see on the files of the former.  This includes my outlook messages that must go to the local settings folder.  It was simple and easy to do in all other windows programs, but under Vista, I need "spec

  • Tabbed in a Page pane

    I want to create a user starts a loading screen and after clicking the new file or load a file have a page with slide tabs from the right. Is this possible?