Decode limited expression?

Hello Guru's,
I have a table t with 13,000 records.
I am attempting to update records in a column, example:
update t
set col1=(decode(col1,'AA','Antiseptic',
,'BB,'Builder',
,'CC','Contractor'))
commit;
The problem is that I have to update around 300 types of AA, BB at once- needless to say DECODE has it's limits. So, not being a very good developer I decided to break the decode updates to every 40 or so types- this did not work.
It would update only on the first set of decoding I did- around 40 enteries, then the next update I made did not work.
Is there anyway I can update these all 300 types in one execution? Or is there another way to update the records with another expression other than decode that will allow 300 plus type updates?
I hope this is not confusing.

While my strong preference would be to use a dummy table approach as Eric and 519668 suggested, if y ou really want to go the DECODE route, and I still prefer the dummy table, then your update statements need to be like:
UPDATE t
SET col = DECODE(col, 'AA', 'Antiseptic',
                      'BB', 'Builder',
                      'CC', 'Contractor')
WHERE col in ('AA', 'BB','CC');
UPDATE t
SET col = DECODE(col, 'DD', 'Developer',
                      'EE', 'Engineer',
                      'FF', 'Foo')
WHERE col in ('DD', 'EE','FF');But really, put the values in a table and use that table to update as suggested.
HTH
John

Similar Messages

  • Using Decode in Expression Builder...

    Hi everybody,
    I want to use the DECODE function of SQL in an Expression Builder....
    Of course this function does not exist in any of the transformation categories(arithmetic,character,e.t.c.) in the expression builder.
    I have read in the OWB on-line help that in the Expression Builder there should be an 'Others' drop - down list in order to select any of the available SQL clauses - one of them is 'decode'...
    The problem is that this drop - down list in the Expression Builder is disabled.....
    How can I use this function anyway..????
    Instead of using ... in the Expression Builder...
    decode(<column_name>,'1','val_one','2','val_two') what can I use to do the same....???
    As regards the problem that the drop-down list is disabled , what may be the cause..???
    I use Microsoft XP machine , Oracle 10g (v.10.2) and OWB v.10.1.0.4
    The documentation says....
    "This allows you to deploy the DECODE functionality in all operating modes (setbased, rowbased, etc.) and transparently across Oracle database releases (8.1, 9.0 and 9.2)."
    The above means that the cause is the incompatibility..????
    Thanks , a lot
    Simon

    I am using OWB 9.2.0.8 and I can't reproduce the problem you are having with 10.1, but did you try just typing it into the expression?
    Or, better yet, use CASE. The syntax is easier to read. I think OWB translates DECODEs to CASE when the SQL is generated.
    (Case <column_name>
       When '1' Then 'val_one'
       When '2' Then 'val_two'
    End)

  • DECODE in expression

    Hello list,
    How do I go about DECODE function in expression?
    It's legal only in SQL statement, so validation is fine, but when OWB deploys a script I have error message because DECODE is used in PL/SQL as well. I have solved it temporarly manually changing the script, but this is an error-prone method. What are other solutions except creating user transformation?
    TIA,
    Alex

    I have tried it, but it won't work.
    For instance:
    case INGRP1.CD
    when 1 then 2
    else 3
    end
    Gives the folowing error:
    Line 1, Col 1:
    PLS-00103: Symbool "CASE" aangetroffen terwijl een van de volgende werd verwacht:
    ( - + mod not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string>
    This means that the word CASE cannot be used as first.
    Any suggestions? I cannot found any documentation about creating expressions (syntax, functions, examples).
    Very sad, because it takes a lot of time to accomplish such a simple thing.
    Regards,
    Maurice

  • OWB Error for using Decode in Expression

    Debug code deployment messages:
    LINE 4558 ,COLUMN 71:
    PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only
    LINE 4558 ,COLUMN 17:
    PL/SQL: Statement ignored
    End debug code deployment messages
    DBG1012: Debug deployment errors, can't run debug code.

    What i have experience is that if you use Decode inside the expression the OWB cannot validate it .
    But it will execute perfect.
    Use Case statement so that you can validate it and debug then
    Cheers
    Nawneet

  • I cant put .xesc in decoder (microsoft Expression Encoder) or windows movie player

    tell me how we can decode an .xesc after renaming it cause if I double click it it plays but when I drag into wmm it says it not compatable please send a solution back please

    I've had pretty good luck with Flip4Mac. Here's a blurb about what it will translate (thru Quicktime):
    Advanced Systems Format (ASF), Advanced Stream Redirector (ASX) and Audio Video Interleaved (AVI). The plug-in can also handle Windows Media Video (WMV) containers, which have the same roots as ASF. The Microsoft's audio container, Windows Media Audio (WMA) is also supported by this plug-in.
    One quick question....you downloaded it, but did you install it? Sorry if that's a dumb question for you, but, for some, it's a reasonable concern.
    All that being said, if you're asf isn't playing, possibly it doesn't conform to a standard compatible with F4M. Occasionally I will run across a file that says it's a wmv, but hiding underneath is an unsupported codec, which renders it unplayable on a Mac with F4M, or anything else.
    Sometimes VLC will play content that nothing else will.

  • How to use DECODE function in Exspression?

    Hi,
    Can we use DECODE in Expression?
    I'm trying to use DECODE function but there is an error during the validation. But when i validate the mapping, it is successfully compiled but it is failed during deployment.
    But if I use CASE instead of DECODE, it works fine.
    Can we use DECODE in OWB???
    Thanks
    Raj

    Hi,
    In OWB 10gR2, if your are using only one DECODE in an expression, it's working. The package will compile when deploying the mapping. OWB will replace the DECODE by a CASE.
    But when you are using nested decode in an expression ( for example : decode(col1, 1, 'M', decode(col2, 'Madame', 'Mme', null)) ) only the first one is replaced by a case at deployment.
    In ROW_BASED mode, text of the expression is used outside of an sql statement and deployment will fails with "PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only."
    If operating mode for the mapping is set to SET_BASED, it's working because the expression is used in an sql statement.
    I have logged a SR in metalink for this issue and a bug is opened (bug 5414112).
    But I agree with you, it's better to use case statement.
    Bernard

  • Decode vs. Case in OWB Transformation

    Hello all,
    I am trying to count or sum all of Reasons where the value is Test. Here is the code which I would like to covert into OWB transformations:
    sum(decode( REASON ,'Test',1,0) )
    Step 1:
    I tried to use Decode in expression
    (decode( REASON ,'Test',1,0) ) and it gives me following error:
    Line 1, Col 1:
    PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only
    Line 0, Col 1:
    PL/SQL: Statement ignored
    It seems OWB does not recognize Decode. How should I solve the problem? Should i try using Case to substitute the above decode code ? like:
    Case
    when Reason='Test'
    then 'Test'
    End
    Am I doing it right?
    and following this I can use aggregator to Sum(test) for counting/summing all tests. Is there anyway I can use this code: sum(decode( REASON ,'Test',1,0) ) in one transformation? Please let me know.
    Thanks,
    K

    OWB provides case statement in place of decode. OWB does not recognize decode statements(till what i know, and tried out)
    Why dont you first use a filter (on reason='test') and then use an aggregrator transformation, You can put input as the column reason from the filter and make a new column in the output group for summing it.
    Hope i have solved your doubts....
    -Nikita.

  • Help with 3D Layer Position Expression

    Hi All,
    I do hope some one can help me – I have been looking and trying to solve this expression problem I have run in to - I only have limited expression knowledge.
    I need to move a layer in 3D space, only the Z axis: from lets say -50 to 0 (based on the start of the layer) and then stop and then move 0 to 50 (again based on the end of the layer)
    I have multiple layers of different lengths that I want to add this to…then just adjust the layer to the time to be displayed on the screen.
    I have used some code from Harry Frank, his AUTO FADE code (which is a god sent) and have tried to make the above movement possible, with sections of the code, its close but no cigar – the code:
    //Auto Move Z
    x = 0;
    y = 0;
    z = 50;
    transition = 20;       // transition time in frames
    if (marker.numKeys<2){
    tSecs = transition / ( 1 / thisComp.frameDuration); // convert to seconds
    linear(time, inPoint, inPoint + tSecs, thisLayer.position + [x,y,z],0) - linear(time, outPoint - tSecs, outPoint, thisLayer.position +  [x,y,z],0)
    }else{
    linear(time, inPoint, marker.key(1).time, thisLayer.position + [x,y,z],0) - linear(time, marker.key(2).time, thisLayer.position + [x,y,z],0)
    It is moving but it’s moving on all axis and the OUT is moving backwards instead for forwards. Plus is has moved from the centre position.
    Any help would be most appreciated, thank you in advance for any help!
    Cheers Breon
    Message was edited by: breonsnow - spelling

    Ooops. There was an error in the last line. Hopefully you caught it. If not, here's the corrected version:
    z = 50;
    tf = 20;
    tSec = framesToTime(tf);
    if (time < (inPoint + outPoint)/2)
      linear(time,inPoint,inPoint+tSec,value-[0,0,z],value)
    else
      linear(time,outPoint-tSec,outPoint,value,value+[0,0,z])
    Dan

  • Adobe Barcoded Forms and LiveCycle Licensing

    If you add a Paper Forms Barcode object to a fill-and-print PDF form using either Designer or Acrobat and the value of the barcode will change while opened within the free Adobe Reader then the PDF form you are distributing needs to be licensed with an Adobe® LiveCycle® Barcoded Forms ES license. I need to create a dynam ic barcode that users can change using Adobe Reader and print the form with barcode intact. It's for use in a pre-K school. Usage will be limited to 200 students per year.(Creating 200 forms that teacher's will fill out). I believe this is my solution, but pricing may be way too high. What are my options and have I been correct so far? There is no server, only a WORKGROUP environment. Thanks.
    Tom: Ok, so from the Adobe side, yes, LiveCycle Forms is the only tool that can achieve this. It used to be called Barcoded Forms ES, now it is just Forms ES2. Unfortunately it is a server only product so you would need a server.
    Tom: List price is around 85k, so I think it might be a bit more than you guys need unfortunately.
    Tom: We don't really have a basic barcoded forms piece for smaller initiatives, unfortunately.
    Visitor: Yikes!
    Visitor: What are my options?
    Tom: Do you absolutely need barcodes? Or could you do online fill in and submit?
    Visitor: If I purchase Acrobat Standard(I created the form is Professional) for 5-10 people, that should do the trick as long as the Adobe READER user doesn't change the barcode information, correct?
    Tom: Honestly, I'm not sure. Acrobat isn't something I am an expert on.
    Tom: You could try Adobe Formscentral as well as using Acrobat.
    Tom: Otherwise you'd have to try the Acrobat forums or user community as I don't have a lot of info about it.
    Visitor: The forms are printed by the teacher/evaluator and hand-written to be scanned when completed(End of month, etc). A barcode decoder(Kofax Express) will read the barcode and rename the file according to the barcode data.
    Tom: Hm, I think the Acrobat forums is your best bet, then.

    Thanks for the great suggestion!
    Can a Pre-K school receive an educational
    institution discount on Acrobat pricing?

  • Report Performance - Summary Fields Setting

    I have a report data model with 3 groupings. Summary fields are needed for each group. There are 2 approaches for me to have the summary values :
    1. i can set the data source of each summary field to be the corresponding column of my based Q_1 selection statement, and then set the "Reset At" for different data groups.
    2. On the other hand, i can set the data source to be the summary field of the inner data group.
    Could anyone tell me which method can give me a better performance? I want the report to run faster.

    Puvan,
    I figured out the problem myself. It is not a version issue.
    I was using a sum function on a decode expression in the sql command. The % total was applied on that sum expression. Every time I was reopening the report the sum expression was getting created in a new group.
    When I gave an alias for the sum(decode(xyz)) expression it is working fine now.
    I would still consider that as an issue with Reports Developer.
    FYI...
    Ritendra.

  • Summary fields in the JSP report

    I created a JSP report using Oracle 9i Reports Developer using report wizard. It has a %Total field on one of the columns.
    It is running good for the first time. But when I am closing and reopening the report the Summary column is showing a null value in the source column. And it would not run the report.

    Puvan,
    I figured out the problem myself. It is not a version issue.
    I was using a sum function on a decode expression in the sql command. The % total was applied on that sum expression. Every time I was reopening the report the sum expression was getting created in a new group.
    When I gave an alias for the sum(decode(xyz)) expression it is working fine now.
    I would still consider that as an issue with Reports Developer.
    FYI...
    Ritendra.

  • I am unable to run this query

    Can i use logical operator in decode in expression like following ..
    SELECT 'FY'||DECODE( TO_CHAR(TO_DATE('1/30/2008','MM/DD/YYYY'),'MON'),'JAN',
         DECODE('(TO_DATE(''1/30/2008'',''MM/DD/YYYY'') >= TO_DATE(''1/30/2008'',''MM/DD/YYYY''))','TRUE',
         TO_CHAR(TO_DATE('1/30/2008','MM/DD/YYYY'),'YYYY')
         ,TO_NUMBER(TO_CHAR(TO_DATE('1/30/2008','MM/DD/YYYY'),'YYYY')-1))
    ,TO_CHAR(TO_DATE('1/30/2008','MM/DD/YYYY'),'YYYY')
    ) FROM dual
    unable to get the result in true condition
    it should print FY2008 but printing FY2007 why?
    can anyone help me on this ?
    Regards
    shyam~

    Try This
    SELECT 'FY'||
    DECODE(TO_CHAR(TO_DATE('1/30/2008','MM/DD/YYYY'),'MON'),'JAN',
    DECODE('(TO_DATE(''1/30/2008'',''MM/DD/YYYY'') >= TO_DATE(''1/30/2008'',''MM/DD/YYYY''))','TRUE',
    TO_CHAR(TO_DATE('1/30/2008','MM/DD/YYYY'),'YYYY')
    ,TO_NUMBER(TO_CHAR(TO_DATE('1/30/2008','MM/DD/YYYY'),'YYYY')))
    ,TO_CHAR(TO_DATE('1/30/2008','MM/DD/YYYY'),'YYYY')
    ) FROM dual
    Cheers
    http://fiedizheng.blogspot.com/

  • Suggest a good book for learning?

    Hey, all.
    Trying to get into the automating/scripting thing as I've started a new job that has to do a lot of versions of similar animations/illustrations. I'm no programmer, but have had some success with simple AppleScripts in Illustrator and Photoshop, but After Effects doesn't like to play nice with AS. So I figure I may as well focus my efforts on ExtendScript/JavaScript to work with all the apps, be cross-platform, plus help with my limited Expressions knowledge.
    So can anyone suggest some good books for learning the JavaScript language? I've done online tutorials, which have helped a little, but just a big ol' consolidated JavaScript book, teaching the structure and syntax from the beginning (again, not a programmer by trade) would be best for me. Thing is, 95% of the books I've looked at are focused on web design, which I'm not that interested in. I'll use one if the core JavaScript teachings are well-presented and I can just ignore the web stuff; just don't want to buy a book that I'm only going to read half of and not learn everything I need to.
    All suggestions welcome, and thanks in advance.

    Hi there - lots of resources...
    Look up "eloquent javascript" online for a pdf.
    Javascript - The Definitive guide
    NewThinkTank on youtube
    Codeacademy
    Then it's the scripting guide for the other half.

  • Dynamic shared datasource

    Hi,
       How to create a dynamic shared data source in SSRS?

    Hi,
      Dynamic in the sense i can connect to all SQL servers in my environment using a single data source by giving expression. How i can convert this data source into shared data source? I'm getting error that Expression defined data source can't be converted
    into shared data source.
    Yes its a SSRS limitation
    expression based connection string is only alllowed for embedded data sources
    But you can apply this workaround if you want which would require a linked server setup
    http://blog.softartisans.com/2011/04/19/how-to-create-a-dynamic-reporting-services-shared-data-source-using-linked-servers/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Is there a way to change the formulas for the fields of the Quiz Results slide?

    I see the placeholders for the fields on the Quiz Results Slide (Number of Questions = {total-questions}).  Is there a way to view and change those calculations?

    You can select which variables appear on the Quiz Results slide, but you cannot really change the calculations used by Captivate under the hood.
    Depending on what you're trying to achieve, you might be able to insert your own captions reading off the same variables and use Advanced Actions and Expressions to cook up different results.  But it depends very much on what you want to do and whether or not the variables are exposed, and whether or not the limited Expressions available will allow the math.

Maybe you are looking for

  • Ipod formatted on intel Mac can't be read when connected to G4 w/ 10.3.9

    Is there anyway to add music to an iPod (from iTunes) running on a an older G4 Mac with OS X 10.3.9 if the iPod has been formatted on a newer intel based Mac running Lepord? The error I get on my G4 says that the disc I've inserted has volumes on it

  • LiquidData SP2 Web Services

    Hi, I am getting one problem with LiquidData SP2. I am invoking a Web Service (LiquidData query exposed as WS) through a Java client and getting following exception, com.bea.ldi.server.common.MetaDataException at com.bea.ldi.server.common.DefaultStor

  • My Network Preferences obstinately refuses to change the remembered password to a network, even though it's wrong!

    I am having trouble connecting to my school's wireless network. Initially I couldn't connect at all, but someone helped me by going into the Network Preferences and changing the password stored there (it was trying to use an earlier one that was used

  • Creating change documents for VDH1N-customer hierarchy

    Hi i need to create change documents so that i can read the changes and extend DEBMAS06 to send customer hierarchy data to non-sap system using IDOC. can anyone let me know how to create change documents to customer hierarchy ...

  • Applying halftone effect in photoshop

    Hi, I have a bmp file opened in Photoshop CS5 to which I would like to apply a halftone effect. The image was selected in CS5, but when I went to "Filter", none of the options under it was active, except for "Browse filters online". Could someone adv