Update statement that includes case, decode and from clause

hello
I've the following code. I ran this code in 9i and got the errror SQL command not properly ended. Can I use FROM clause in an update statement?
CREATE OR REPLACE procedure NRI
IS
BEGIN
UPDATE IEB2 SET SDI =
(CASE PSDI WHEN '11' THEN '16'
WHEN '13' THEN '38'
WHEN '14' THEN '18'
WHEN '23' THEN '21'
WHEN '24' THEN '21'
WHEN '31' THEN '27'
WHEN '32' THEN '37'
WHEN '33' THEN '38'
WHEN '34' THEN '37'
WHEN '43' THEN '46'
WHEN '53' THEN '45'
WHEN '55' THEN '48'
WHEN '60' THEN '54'
WHEN '61' THEN '57'
WHEN '62' THEN '54'
WHEN '63' THEN '56'
WHEN '64' THEN '52'
WHEN '70' THEN '21'
WHEN '77' THEN '25'
WHEN '78' THEN '41'
WHEN '80' THEN '79'
WHEN '85' THEN '75'
WHEN '87' THEN '73'
WHEN '15' THEN '15'
WHEN '51' THEN '51'
WHEN '88' THEN '88'
WHEN '00' THEN '00'
WHEN '99' THEN '99'
WHEN '12' THEN DECODE(C.R_ID, 'N', '16','18')
ELSE 'NONE' END)
FROM D1.C C
WHERE EXISTS
(SELECT 1
FROM D1.SD A, D2.SDP B, D1.C C
WHERE A.SDN = B.DN
AND B.SDI = '000000'
AND B.PFI = 'W'
AND B.CID = C.CID
AND A.SDN = '0001500721');
END;

Your parenthesis look a tad messed up ... think this fixes them.
CREATE OR REPLACE procedure NRI
IS
BEGIN
UPDATE IEB2 SET SDI =
SELECT
CASE PSDI
  WHEN '11' THEN '16'
  WHEN '13' THEN '38'
  WHEN '14' THEN '18'
  WHEN '23' THEN '21'
  WHEN '24' THEN '21'
  WHEN '31' THEN '27'
  WHEN '32' THEN '37'
  WHEN '33' THEN '38'
  WHEN '34' THEN '37'
  WHEN '43' THEN '46'
  WHEN '53' THEN '45'
  WHEN '55' THEN '48'
  WHEN '60' THEN '54'
  WHEN '61' THEN '57'
  WHEN '62' THEN '54'
  WHEN '63' THEN '56'
  WHEN '64' THEN '52'
  WHEN '70' THEN '21'
  WHEN '77' THEN '25'
  WHEN '78' THEN '41'
  WHEN '80' THEN '79'
  WHEN '85' THEN '75'
  WHEN '87' THEN '73'
  WHEN '15' THEN '15'
  WHEN '51' THEN '51'
  WHEN '88' THEN '88'
  WHEN '00' THEN '00'
  WHEN '99' THEN '99'
  WHEN '12' THEN DECODE(C.R_ID, 'N', '16','18')
  ELSE 'NONE'
END
FROM D1.C C
WHERE EXISTS 
    SELECT 1
    FROM D1.SD A, D2.SDP B, D1.C C
    WHERE A.SDN = B.DN
    AND B.SDI = '000000'
    AND B.PFI = 'W'
    AND B.CID = C.CID
    AND A.SDN = '0001500721'
END;

Similar Messages

  • I updated my iphone 3g to ios4.2.1 ... the update was succesful but nw itunes says that sim card inserted in this phone is not acceptable and also states that on;y compatible sim from supported carrier is acceptable !!! kindly suggest ...

    i updated my iphone 3g to ios4.2.1 ... the update was succesful but nw itunes says that sim card inserted in this phone is not acceptable and also states that on;y compatible sim from supported carrier is acceptable !!! kindly suggest ...

    horsie10 wrote:
    i bought my iphone in USA and im using it in india .... kindly hellp me how can i resolve this problem !!!
    It has NEVER been possible to purchase an unlocked iPhone 3G in the US. Your phone was hacked. Updating it has re-locked it to AT&T. AT&T will NOT unlock iPhones for any reason.
    The phone is now useless to you. There is no legitimate way to fix this. Buy a new phone. Preferably in India.

  • If I buy iWork, will that include Pages, Numbers and Keynote for all my Devices?

    If I buy iWork, will that include Pages, Numbers and Keynote for all my Devices?
    It seems like purchasing Pages, Numbers and Keynote Seperately for my Mac Computers and then again for my iOS 5 Devices ads up to about $100, though iWork costs more as a whole, what would be the key advantages in purchasing iWork not from the app store?
    If i do purchase iWork not from the app store, will it still be available on all my Devices?
    -iPhone
    -iPad
    -Macbook

    ElliotDG wrote:
    my question was whether buying iWork from the apple store would defuse this restriction and make it available on all my devices
    No.

  • Cannot load my library onto my ipod since getting icloud?  Itunes states that I need to download from icloud?  Can I not use my ipod as I did pre-icloud?

    cannot load my library onto my ipod since getting icloud?  Itunes states that I need to download from icloud?  Can I not use my ipod as I did pre-icloud?

    Chris CA wrote:
    You cannot backup photos to iCloud.
    You can enable Photo Stream (in Settings > iCloud) but only for 30 days and only a max of 1000 photos.
    Then what does this mean? It was copied from the kb article that I posted above.
    Reducing the size of your Camera Roll backup
    If you take lots of photos and videos with your iOS device, you may notice your Camera Roll takes up most of your iCloud Storage backup. To check the size of the Camera Roll backup on your device:
    On your Home Screen, tap Settings.
    Tap iCloud.
    Tap Storage & Backup.
    Tap Manage Storage.
    In the Backups section, tap your device.
    In the Backup Options section, the backup size is displayed under Camera Roll.
    To reduce the size of your Camera Roll backup, save your photos and videos locally to your computer with iTunes, and then manually back up your iOS device. If you want to keep your photos and videos on your iOS device, you can turn off Camera Roll in Backup (see the "Deleting backups and turning off Backup for your Device" section above) orpurchase additional storage.

  • I am unable to access iCloud because my iPhone states that my Apple ID and\or password is incorrect.  Based on Apple's own policy my current ID and P/W should be fine to access iCloud.  Any suggestions?

    I am unable to access iCloud because my iPhone states that my Apple ID and\or password is incorrect.  Based on Apple's own policy my current ID and P/W should be fine to access iCloud.  Any suggestions?

    You will have to contact Apple Care and ask for account security for help. Apple ID: Contacting Apple for help with Apple ID account security

  • Hello, im a photographer and wants to know if there is  a pack that include photoshop, lightroom and primiere?

    hello, im a photographer and wants to know if there is  a pack that include photoshop, lightroom and primiere?

    hi,
    Sory for all the questions, but need to understand.
    you said a year, ather that it will be more? or does it mean that i have to
    be obligated for one year?
    thanks,
    gila
    054-4774218
    http://www.aginteriorphotography.com/
    Gila Azulay - Phtographer @ facebook
    <https://www.facebook.com/pages/Gila-Azulay-Photographer-0544774218/219852621412097?focus_c omposer=true>
    bizmakebiz
    <http://www.bizmakebiz.co.il/Members/43844114-9075-46ff-af81-85cc94d2b716/>

  • My ical states that it is importing and I cannot close the program

    any ideas? I cannot add to the calendar either because it states that it is importing and it is stuck on the first week of May

    https://discussions.apple.com/message/19364703#19364703

  • Record Group and From-Clause Datasource

    I need to do several complex queries (read-only) for my form. Original I used From-Clause datasource but, as the requirement changed, there are some limitations. I would rather no do anything dynamically if as all possible because there are over 20 such queries which makes the code difficult to maintain. I wanted to be able to reference block items in the query.
    I'm thinking about using Record Group query instead. What are the differences in capability between Record Groups and From-Clause Datasource?
    Thanks.
    Clayton.

    Thanks.
    That's exactly the problem I have. I don't want to use LOVs so I've been thinking about how to visualize the record group data using data blocks. Perhaps I'll just go with dynamically building the From-Clause.
    I've looked into stored procedure based blocks a bit; it was confusing for me. Are the stored procedures stored in the database or are they defined in the form?

  • Which two statements are true about WHERE and HAVING clause ?

    Which two statements are true about WHERE and HAVING clause ?
    1. WHERE clause can be used to restict rows only
    2.HAVING clause can be used to restrict groups only
    3.HAVING clause can be used to restrict groups and rows
    Plz help me in dis ques...which two will be correct...i think its 1 and 2...but not sure.

    863180 wrote:
    Plz help me in dis ques...which two will be correct...i think its 1 and 2...but not sure.If you are not sure then you do not fully understand HAVING.
    SY.

  • SQL statement that includes LEFT & RIGHT JOIN in the same statement??? Help

    Hi,
    How an I write an SQL statement with a GROUP BY that will both (a) include the NULL value from the left hand table, but also (b) include ALL columns from the right hand table. It's like I need a LEFT JOIN and a RIGHT JOIN in the query at the same time.
    Here's an example of the 2 tables I have and the result I'm after. As you can see I want the NULL's from Expenses Table summed, as well as include all categories from the right hand table (i.e. even if there are no expenses against them)
    Table = Expenses
    Amount Category
    $10 1
    $20 2
    $30 1
    $40 NULL {i.e. not yet categorised}
    Table = Categories
    ID Title
    1 Food
    2 Entertainment
    3 Travel
    4 Personal
    REQUIRED RESULT
    Category Total
    Food 40
    Entertainment 20
    Travel 0
    Personal 0
    NULL 40
    Thanks

    SQL> create table expenses (amount,category)
      2  as
      3  select 10, 1 from dual union all
      4  select 20, 2 from dual union all
      5  select 30, 1 from dual union all
      6  select 40, null from dual
      7  /
    Table created.
    SQL> create table categories (id,title)
      2  as
      3  select 1, 'Food' from dual union all
      4  select 2, 'Entertainment' from dual union all
      5  select 3, 'Travel' from dual union all
      6  select 4, 'Personal' from dual
      7  /
    Table created.
    SQL> select c.title category
      2       , nvl(sum(e.amount),0) total
      3    from expenses e
      4         full outer join categories c on (e.category = c.id)
      5   group by c.id
      6       , c.title
      7   order by c.id
      8  /
    CATEGORY                                       TOTAL
    Food                                              40
    Entertainment                                     20
    Travel                                             0
    Personal                                           0
                                                      40
    5 rows selected.Regards,
    Rob.

  • How can I get a Quicktime update when the update states that an MSI for the previous version is missing

    How do you get a new version of Quicktime when it states that the msi for the old version is no longer available?

    Download the Windows Installer CleanUp utility from the following page (use one of the links under the "DOWNLOAD LOCATION" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    To install the utility, doubleclick the msicuu2.exe file you downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up").
    In the list of programs that appears in CleanUp, select any QuickTime entries and click "Remove", as per the following screenshot:
    Quit out of CleanUp, restart the PC. Now try another QuickTime install. Does it go through properly this time?

  • Converting images that include text boxes and callouts in FM

    Hello,
    I'm on a new project (TCS 3.5, RH 9, FM 10) that requires me to include text boxes and lines (callouts) on top / in front of many of the images in FM. The reason they are not allowing me to add the text/callouts to the images themselves is because they want to keep the text boxes editable for translation.
    The problem: After importing into RH, these images have white borders on all sides that they didn't have previously and I can't figure out what's causing it.
    When I remove the text/callouts from over the images in question, then reimport, the problem resolves and the white borders disappear. When I view the original image files, there are no borders present. After I import, I view the image file in the RH folder and it does include the border. (So the border is on the image itself.)
    Presently, the Object Properties for the images are as follows:
    Offset From:
    Top: 0.0"
    Left: 0.0"
    Border Width: 0.015 (which is lowest FM allows me to set... I get an error message when I try to enter 0.0)
    Anchored Frame settings:
    Anchoring Position: Below Current Line
    Alignment: Left
    Cropped/Floating: both unchecked
    I've tried many different variations and tests; probably too many to list here. In short, the "border" appears when there is text/callouts on the image and it disappears when I delete the text/callouts. I was hoping that someone may have had a similar issue. Please let me know if you need more info to troubleshoot and thanks for reading.
    Best,
    Tom

    I had the same problem with callouts, but my solution was to add them directly to the image, so that doesn't help you.
    Another things you can try to is ensure that the edges of the image do not touch the edges of the anchored frame. Make sure there is a bit of white space. I don't know why, but when any of my images touch the anchored frame, the conversion looks awful.
    Also, my images appeared best in Robohelp when I set the properties for the image in Robohelp as follows:
    File > Project Settings
    Import tab
    Edit conversion settings for FrameMaker documents
    On the left side, select Image
    Set Width and Height to 0pt (this ensures that the image is not resized)

  • Is it possible to create a horizontal slider that includes both text and pictures?

    I need to create a horizontal slider that includes both an image and selectable text, but I can't seem to figure out how to go about this in Muse. So far all I have been able to do is to use the Image description as the static text, but this text will not slide horizontally, it will just change, and the picture will slide underneath it.
    I want both the picture of the phone, AND the text next to it to slide horizontally when the user clicks the next/previous buttons. The placement of the text needs to change depending on which message will be in the next slide, so it will be impossible to use the image description for this purpose.

    Thanks for posting.
    You can achieve this by using slid show. Add image to the slide and there is a text box at the bottom of the slideshow box, which you can drag and place on the image within the frame. Please refer the screenshot below.
    Kind Regards
    Aishvarya Rastogi

  • CASE in the FROM clause ?

    Hello, I need to query a table which (unfortunately) its name is depended on the date. (Year, Month, and every 15 days (Fortnight FN)
    My tables is STAT_VEHICLES_YY_MM and if it refers to the fortnight report it becomes STAT_VEHICLES_YY_MM15
    For example this fortnight (15 of July report) will be STAT_VEHICLES_09_0815 and the 1st of this month report was on STAT_VEHICLES_09_08 table.
    My query so far is:
    ACCEPT YY prompt 'Please enter current year in YY format:'
    ACCEPT MM prompt 'Please enter current month in the MM format:'
    SELECT COUNT(*) "STAT VEH. NEW LIC."
    FROM STAT_VEHICLES_&YY._&MM
    WHERE NR=3;
    I tried using something like
    ACCEPT FN prompt 'Is this a fortnight report? (Y/N): '
    SELECT…
    FROM
    CASE
    WHEN &FN = Y THEN STAT_VEHICLES_&YY._&MM.15
    WHEN &FN = y THEN STAT_VEHICLES_&YY._&MM.15
    WHEN &FN = N THEN STAT_VEHICLES_&YY._&MM
    WHEN &FN = n THEN STAT_VEHICLES_&YY._&MM
    END
    WHERE…
    But I don’t think that CASE will work in the FROM clause
    My next though is OUTER JOIN and here is where I need your help people.
    Thank you

    Obviously this is extreemly poor design, and it should have been implemented by partitioning 1 table.
    In that case Oracle would have automatically choosen the right partition!!!
    What you can do is
    column table_name new_value tablename
    ACCEPT YY prompt 'Please enter current year in YY format:'
    ACCEPT MM prompt 'Please enter current month in the MM format:'
    select stat_vehicles_&YY._&MM table_name
    from dual;
    select count(*)
    from &_table_name
    where nr=3;
    You would need to use &_table_name everywhere.
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • CBO and FROM clause

    hi,
    is the concept of ordering of tables in FROM clause still valid for CBO.
    I mean the concept of oracle selecting the driving table based on the positions of table in FROM clause still valid??
    If yes, then how should the tables be placed? the one with least rows in the end of from clause??
    Also is it better to leave to CBO or put a /*+ORDER */ hint??because additional time will be wasted by CBO in collecting stats??
    Any authentic document which speaks about optimization techniques??( i mean SQL tuning rules)
    s
    Message was edited by:
    user571638

    When I started, my focus was also on SQL tuning rules but I found out that this was not the most efficient way to tune performance. You can save a lot of time on performance tuning when you let the CBO work for you:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14211/toc.htm

Maybe you are looking for

  • 3G iPod Not Recognized in Vista

    I have a 3G iPod, and I'm trying to connect it to sync, but Vista is not recognizing it. It keeps asking me to insert the disc so it can search the disc for a driver. I've never had this problem before. The iPod says "do not disconnect", but itunes d

  • How to create general purpose database using dbca

    Hi, I have installed oracle 10g on AIX . and now i have to create a database/instance for the firsttime whch must to be general using dbca. I want to create database silently. could any one please tell me the command to create a database silently

  • Finished Goods Rework - incorrect inventory after GR

    Dear All, What is the normal steps to setup in SAP for Rework of Finished Goods. As this moment, we have a wrong inventory for those Rework FG. The case is : 1. Goods return from Customer at Zero value, as we have to help customer to repair and ship

  • Geting Planned Order Object ID

    Hi, I'm trying to determine the configuration of a planned order from a remote system using function module BAPI_CFGINST_CHARCS_READ. One of the input parameters is the Object ID which I don't know how determine it. So far I've used BAPI_PLANNEDORDER

  • IPhoto does not open back-up library and requests library manager which does not work either

    Hello, I have a problem and NO idea how to fix it. I try to write it in bullet points to make it easier to read: - My MacbookPro (from 2009) with current software (mavericks, all updates) went offline due to lack of battery while I was working in iPh