How to take care of case statements while migration

Hello Sir,
using migration workbench tool for converting SQL server database to Oracle Databse.Getting error message in converting below SP with Case Statement.
Please help me in solving this problem
****** Object: Stored Procedure dbo.SP_Sec_GetScreenFieldAccessLevel
Procedure Name : SP_Sec_GetScrnFldAccessLevel
Notes :
This procedure selects data from E_E_C_field_Access_level table
CREATE PROCEDURE SP_Sec_GetScrnFldAccessLevel
AS
Select Screen_ID + '-' + FieldDescription as ScreenFieldName
,Level=
CASE
WHEN Len(IsNull(E_E_C_field_Access_level.ein_code,''))= 1 THEN campus_name
WHEN Len(E_E_C_field_Access_level.ein_code)> 1 THEN ein_name
END,
ein_name,campus_name,Urole,
IsLocked=case IsLocked
when 1 then 'Yes'
when 0 then 'No'
End
from E_E_C_field_Access_level,Field_Name_Field_Description,User_Roles_Master,EIN,Campus
where
E_E_C_field_Access_level.Screen_Field_ID*=Field_Name_Field_Description.ID
and E_E_C_field_Access_level.User_role_Id *=User_Roles_Master.Role_Id
and E_E_C_field_Access_level.ein_code *= EIN.ein_code
and E_E_C_field_Access_level.campus_code *= Campus.campus_code
and E_E_C_field_Access_level.del_flag=0
order by E_E_C_field_Access_level.date_created desc
IF @@ERROR <> 0
RETURN @@ERROR
ELSE
RETURN 0

If not using the new SQL DEveloper Migration Workbench, then u should be. I think this new version takes care of case statements.

Similar Messages

  • How to  take trace of concurrent programme while it is in running state?

    how to take trace of concurrent programme while it is in running state?

    838982 wrote:
    how to take trace of concurrent programme while it is in running state?You cannot until it is completed -- You may generate the TKPROF file if the trace file has been generated and contains some data but this may not be helpful.
    How To Trace a Concurrent Request And Generate TKPROF File [ID 453527.1]
    How Can Trace and Debug Be Turned On For A Concurrent Request? [ID 759389.1]
    How to Set a Trace with Bind and Waits from the Concurrent Request Form [ID 601647.1]
    How To Find Trace File From Concurrent Request ID [ID 452225.1]
    Thanks,
    Hussein

  • If I have floating values such as 6.3, 6.7, 6.9, 7.1, 7.2 how do I write a case statement to handle that

    How do I write a case statement If I want a case for x < 1.5;   a case for 1.5 <= x <= 3.7;  case for  3.7 < x < 7.2.....etc.   My input is a floating number.
    Thank you.
    Solved!
    Go to Solution.

    smercurio_fc wrote:
    Nice method with the Threshold function. I was not aware of the limitation with -Inf. Odd.
    Actually, my code operates correctly as long as the first element is smaller than all other elements in the array. We don't need any special handling.
    Maybe NaN is not a bug if the array starts with -Inf, because the interpolated index for any number between the second element and -inf will be infinitely close to 1, thus a result of zero can never be obtained (try a first element of -1e50 and you'll always get 1 unless you go to very huge negative numbers).
    The way threshold array is defined, the behavior should be obvious, the problem is assigning a fractional index.
    It is unexpected that an input equal to the second element also results in NaN. That might be a bug. (see image).
    I probably won't post an idea, maybe a bug report after some more thinking...
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    IdeaThresholdArray.png ‏19 KB

  • How to take care of Performance related issue in DRM?

    How we can optimize or take care of performance related issues when we have huge data in DRM application? especially when comes to Imports and Exports.
    Thanks
    -Ramesh

    Hi Ramesh,
    Below some suggestion from my side.
    1-Try to keep Current version open at the time of export and automator run.
    2-At extreme use derived property , else manage with somehow if you can
    3-If you are creating any derived property make sure you are restricting to related hier
    4-In case you are creating derived property check performance to take big hier with derived property node name and description ,if performance not seems to you satisfactory go with some other logic.
    5-Don’t use much looking property like Nodeinhier, hiernodepropvalue etc , if need then only use these
    6-Tack care of validation if you can do better with verification then don’t put validation in that case
    7-I do see some problem while loading data from DRM to DB try to avoid and use some workaround if possible ( like Sql loader)
    Not sure how much useful will be for you these points above.
    Thanks!
    Sandeep

  • How do I use the CASE statement  in the where clause?

    Hello Everyone,
    I have 2 queries that do what I need to do but I am trying to learn how to use the CASE statement.
    I have tried to combine these 2 into one query using a case statement but don't get the results I need.
    Could use some help on how to use the case syntax to get the results needed.
    thanks a lot
    select segment_name,
    product_type,
    count (distinct account_id)
    FROM NL_ACCT
    where
    ind = 'N'
    and
    EM_ind = 'N'
    and product_type in ('TAX','PAY')
    and acct_open_dt between (cast('2006-01-17' as date)) and (cast('2006-01-17' as date) + 60)
    GROUP BY 1,2
    order by product_type
    select segment_name,
    product_type,
    count (distinct account_id)
    FROM NL_ACCT
    where
    ind = 'N'
    and
    EM_ind = 'N'
    and product_type not in ('TAX','PAY')
    and acct_open_dt between (cast('2006-01-17' as date)) and (cast('2006-01-17' as date) + 30)
    group by 1,2
    order by product_type

    Something like:
    SELECT segment_name, product_type,
           SUM(CASE WHEN account_id IN ('TAX','PAY') and
                         acct_open_dt BETWEEN TO_DATE('2006-01-17', 'yyyy-mm-dd') and
                               TO_DATE('2006-01-17', 'yyyy-mm-dd') + 60 THEN 1
                    ELSE 0 END) tax_pay,
           SUM(CASE WHEN account_id NOT IN ('TAX','PAY') and
                         acct_open_dt BETWEEN TO_DATE('2006-01-17', 'yyyy-mm-dd') and
                               TO_DATE('2006-01-17', 'yyyy-mm-dd') + 30 THEN 1
                    ELSE 0 END) not_tax_pay
    FROM NL_ACCT
    WHERE ind = 'N' and
          em_ind = 'N' and
          acct_open_dt BETWEEN TO_DATE('2006-01-17', 'yyyy-mm-dd') and
                               TO_DATE('2006-01-17', 'yyyy-mm-dd') + 60
    GROUP BY segment_name, product_type
    ORDER BY product_typeNote: You cannor GROUP BY 1,2, you need to explicitly name the columns to group by.
    HTH
    John

  • How to retain the button over state while scrolling over a Pop-up Menu

    Are there updated instruction for Fireworks 8?
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15926&sliceId=1

    I just wouldn't use those menus at all - there are much
    better ways. Have
    you considered them?
    Check the uberlink and MacFly tutorials at PVII -
    http://www.projectseven.com/
    and the Navbar tutorial/articles at Thierry's place
    http://tjkdesign.com/articles/dropdown/
    Or this one (more recent article):
    http://tjkdesign.com/articles/Pure_CSS_Dropdown_Menus.asp
    Or to get it done fast, go here -
    http://www.projectseven.com/tutorials/navigation/auto_hide/index.htm
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "turpya" <[email protected]> wrote in
    message
    news:f2ilfs$7gr$[email protected]..
    > Hi,
    >
    > I am trying to work out how to retain button over state
    while scrolling
    > over a
    > pop-up menu. By default the button changes back to mouse
    out state, when
    > scrolling over menu items for that button.
    >
    > I have tried to follow the advice in the below technote
    (see link below),
    > but
    > it seems the instructions are incorrect.
    >
    > I am using Fireworks 8 - it appears the instructions are
    for a prior
    > version.
    > I cannot find function fwLoadMenus() mentioned in Step 3
    (number 6.).
    >
    > Has anyone accomplished this in Fireworks 8, that could
    provide me with
    > instructions?
    >
    > Thanks in advance,
    >
    > turpya.
    >
    >
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_15926
    >

  • How to manipulate arrays using case statements and boolean conditions?

    In the vi that is attached I am trying to compare two values in two different arrays and delete the value that is equal to zero.  The values of each array are rounded to the closest integer.  Then I attempted to apply the ">0" boolean as the condition for my case statement, but I am getting an error.  Any tips on manipulating arrays with case statements?
    Attachments:
    Patient Movement Monitoring.vi ‏141 KB

    Thank you!!! that was a huge help. I don't think I need the case structures at all.  The next part of the code compares the 4 values in the array. 
    If columns 0 and 1 are both positive -> output 1
    If column 0 is negative and 1 is positive -> output 2
    If columns 0 and 1 are both negative -> output 3
    If column 0 is positive and 1 is negative -> output 4
    (0 is x-axis value, 1 is y-axis value.....outputs are assigning quadrants to the combination)
    Only one of the "AND" booleans will return true for each index.  Is there a way to initialize another array of outputs 1-4 depending on which AND returns true?
    Attachments:
    Patient Movement Monitoring.vi ‏144 KB

  • How to use REGEXP for case statement

    Hello everyone, I'm very new here and am struggling with a using REGEXP in a case statement, OK I am using the REGEXP to find all strings that match a specific format for a particular brand of product, for example serial numbers, and I need to be able to say something like [case when(xx.brandid) = '123' then if xx.serialnumber REGEXP_LIKE(xx.serialnumber,'[A-za-z][A-za-z][A-za-z]\d{5,}[A-za-z]$') then 'TRUE' else 'FALSE' end "TRUE/FALSE".]
    Help would be greatly appreciated with this as I feel like I'm going backwards trying to figure this out
    Thanks in advance for any assistance.

    Like this?
    case
       when xx.brandid = '123' and
            regexp_like(xx.serialnumber,'[A-za-z][A-za-z][A-za-z]\d{5,}[A-za-z]$') then
          'TRUE'
       else
          'FALSE'
    end

  • How can we modify the distination url while migrate the personalization

    Hi All,
    I got the requirement to create a link in iSupplier home page. I have created the link using oa framework personalization and set the destination URL with the third party's test instance URL. It is available in test instance and the third party url is also the test instance url . I have to move this personalization to production. In production the same link has to open the third party's prod instance only. But i am little bit confused, how can we modify the detsination url in the personalizaed the document.
    Please suggest me if there is any generic way of modifying the link url while migrating the personalization from one instance to another instance.
    Thanks in Advance..
    Regards,
    Purushoth

    Hi,
    ---Its nt possible via personalization go for co extension
    Im not sure but pls try with below approach.
    ---In co get the webBean of OALinkBean and setDestination URL in code.
    if(Prod)
    setdestinationURL("");
    if(Testing)
    setDestinationURL("");
    Regards
    Meher Irk

  • How to take care of Transit loss / damange while cration Goods Receipt?

    Hi All,
    I have a business requirement to capture the transit loss / damange in a seprate GL then on Inventory while doing Goods Receipt
    e.g. vendor despatched 100 qty but at Plant they have recd 95 qty. 5 qty were loss due to any reason where i have to pay to vendor for 100 but at the same time inventory has to be increased with 5 quantity.
    Help to cater to the above business requirement.
    Thank You.
    Regards,
    DS

    if 5 qty not at all received
    If not received then I don't think you are going to pay for 100, you have to process for 95 only. but then also if you want to book for 100 then follow the same procedure as mentioned below.
    second if 5 qty received in complete non usable condition...
    Option 1: Want to update excise with 100 qty,
    Do GRN for 100, Do MIRO for 100, Scrap 5 by 551 Mvt.
    Option 2: Want to update excise for 95 qty,
    Do GRN for 95 with excise entry, Do seperate GRN for 5 qty with No excise entry, Do Miro for 100, Scrap 5 by 551 Mvt.

  • How to do a complicated case statement

    In my windows form program a user can create an invoice for customers. In order to load the products to create the invoice, I need to make an sql stored procedure that takes the products from the products table. The problem is that there is something called
    pricebooks in which a specific customer or group of customers can get a special price for a specific item and then when loading the products for the invoice if this customer has a special price it should put in the special price, if this customer belongs to
    a group that has a special price it should show that price else it should show the regular price for that item from the products table. How would I do that? I tried something and for any row that it had a customer and item matching in pricebooks as well it
    put that product down twice.
    SELECT ITEM, DESCRIPTION, ONHAND, CASE WHEN P.CUSTOMER = @CUSTOMER THEN P.PRICE WHEN C.PRICEGROUP = P.PRICEGROUP AND P.CUSTOMER = @CUSTOMER THEN P.PRICE ELSE I.PRICE END AS PRICE, COST, RETAIL FROM INVENTORY I LEFT JOIN PRICEBOOKS P ON I.ITEM = P.ITEM LEFT
    JOIN CUSTOMER C ON C.PRICEGROUP = P.PRICEGGROUP
    The pricebook table can have either a customer with the item that has a special price or a pricegroup with an item that has a special price and in the customer table some customers have that pricegroup. (can be many pricegroups).
    Debra has a question

    Thank you so much for your help. I tweaked up the procedure a little and now it works for my code.
    CREATE PROCEDURE PriceBookByCustomer (@CustomerId int)
    --declare @CustomerId int
    --set @CustomerId = 659
    --look up customer's group from customers table
    Declare @GroupId int
    SELECT @GroupId = PRICEGROUP FROM CUSTOMER WHERE ID = @CustomerId
    --get inventory, outer join to special customer pricing, outer join to special group pricing
    SELECT I.ITEM, I.DESCRIPTION, I.ONHAND, COALESCE(CP.PRICE, GP.PRICE, I.PRICE) AS PRICE
    , COST, RETAIL
    FROM INV I
          LEFT JOIN PRICEBOOKS CP
          ON I.ITEM = CP.ITEM AND CP.Customer = @CustomerId
          LEFT JOIN PRICEBOOKS GP
          ON I.ITEM = GP.ITEM AND GP.GroupId = @GroupId
    ORDER BY I.ITEM
    Debra has a question

  • How to convert the compund case statement into decode statement

    (CASE
    WHEN FRCST = 0 AND SALE = 0 THEN 'No transaction '
    WHEN FRCST = 0 AND SALE <>0 THEN 'Sale ag. Nil Forecast : '||SALE||' Kgs'
    WHEN FRCST<> 0 AND SALE = 0 THEN 'No Sale ag. Forecast : '||FRCST||' Kgs'
    WHEN FRCST<>0 AND SALE<>0 AND DIFF=0 THEN 'No Variance'
    ELSE TO_CHAR(ROUND((DIFF/FRCST),2))||'%'
    END)VARIANCE
    How to convert this tatement to decode statement ?
    Yogesh

    Decode(FRCST,0,DECODE(SALE,0,'nO TRANSACTION','SALE AGAINST NIL FORECAST'),DECODE(SALE,0,'NO SALE AGAINST FORECAST',
    DECODE(|SALE-FORECAST|,0,'NO VARIANCE',TO_CHAR(ROUND((DIFF/FRCST),2))||'%')))As per me whole case can be replaced by above decode

  • How to write the following CASE statement

    I need to calculate Retainer amount. The derivation of it is as follows:
    "A fixed value of 10000 per month for employees who have served for less than 2 years and 15000 for more than 2 years. This increment will be affected in two cycles a year, in the January or July."
    The years of service can be calculated using date_of_joining.

    Use this logic
    SELECT DECODE(SIGN(SYSDATE - ADD_MONTHS(HIREDATE,24)),-1,10000,1,15000) from <table_name>Is this you need
    In every Jan/July month employee get a Sal+Fixed allownce (10000 if less than 2 years in company/15000 if more than 2 years). In other month they get just the salary
    SELECT CASE WHEN TO_CHAR(SYSDATE,'MM') IN ('01','07') THEN
                   CASE WHEN SYSDATE- ADD_MONTHS(HIREDATE,24)> 0 THEN
                        SAL+15000
                    ELSE
                        SAL+10000
                    END
            ELSE
              SAL
            END  SAL
    FROM EMP
    /Edited by: Lokanath Giri on १७ सितंबर, २०१० ४:५६ अपराह्न

  • How to validate date using case statement.

    I have date like 022212. I split month,date,year using STUFF Function. Now, i have to validate month in range 01-12 and date in range 01-31.  Can some one help me with the query.
    Thanks, Shyam Reddy.

    That is not  date; it is apparently a string (we have no DDL because you are so rude). Any competent SQL programmer will use DATE.   You want help with a query, but there is no query.  
    CAST ('20' + SUBSTRING (crap_string_date, 5,2)+'-' + SUBSTRING (crap_string_date, 1,2) + '-' +  SUBSTRING (crap_string_date, 3,2)  AS DATE) AS redddy_screwed_up_date 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Problem with DECODE statement while migrating forms to 6i

    Hi,
    I'm migrating a form from 5 to 6i. When I compiled the form, I got this error witha decode statement.
    The error is
    Error 307 at line 15 column 7
    too many declarations of "DECODE" match this call
    The trigger has this code:
    IF :PRUN_RECS_INSERTED = 'Y' THEN
          RETURN ;
       END IF ;
       INSERT INTO GJBPRUN
        ( GJBPRUN_JOB,
          GJBPRUN_ONE_UP_NO,
          GJBPRUN_NUMBER,
          GJBPRUN_ACTIVITY_DATE,
          GJBPRUN_VALUE )
       SELECT :KEYBLCK_JOB,
              :ONE_UP_NO,
               GJBPDFT_NUMBER,
               SYSDATE,
          DECODE(GJBPDFT_VALUE, 'SYSDATE',
                          DECODE(GJBPDEF_LENGTH,'11',TO_CHAR(SYSDATE,'DD-MON-YYYY'), SYSDATE),
                          GJBPDFT_VALUE)
       FROM   GJBPDFT G, GJBPDEFEdited by: Charan on Mar 16, 2011 9:15 AM

    Hi Charan
    i think it's all about using both CHARACTER and DATE values at the same time in a DECODE statment u should either use char or date datatype.
    DECODE compares expr to each search value one by one. If expr is equal to a search, then Oracle Database returns the corresponding result. If no match is found, then Oracle returns default. If default is omitted, then Oracle returns null.
    e.g.
    If expr and search are character data, then Oracle compares them using nonpadded comparison semantics.
    expr, search, and result can be any of the datatypes CHAR, VARCHAR2, NCHAR, or NVARCHAR2.
    The string returned is of VARCHAR2 datatype and is in the same character set as the first result parameter.
    for more pls have a look here
    Hope this helps,
    Regards,
    Abdetu...

Maybe you are looking for

  • Need code to generate IP Number.....

    I need to retrieve the IP number of the person filling out a form which has an e-mail function that notifies the client by e-mail the contents of the message. The script that captures the data input from a form is structured to forward the informatio

  • BCC FlexUI fails to show all Assets involved in a Project

    In the BCC for ATG 10.0.2 there are 2 different UIs with which to configure a CA Project; The Flex UI is accessed via the Merchandising Menu and the Workflow UI is accessed via "Browse Projects" and the "To Do List". I have observed that the FlexUI c

  • Creating Data Source

    Hi Experts, While creating datasource,i am assigning it a view ( ZV_ZFT_CASHFLOW ) but following is error: Invalid extract structure template ZV_ZFT_CASHFLOW of DataSource ZFT_CASHFLOW      Message no. R8359 Diagnosis     You tried to generate an ext

  • Settlement rule in Production order

    Hello Gurus, I am new for SAP PP, I was creating Prod.Ord. Before saving it, system prompt me to enter "Percentage___%" in screen "Maintain settlement rule: distribution rule", can anybody help me to ressolve the issue?? Thanks in advance and regards

  • APD: dump GETWA_NOT_ASSIGNED

    When I try to display the data of a query as a source in the Analysis Process Designer (APD) in RSANWB, the dump GETWA_NOT_ASSIGNED occurs in the method CL_RSCRMBW_BAPI=>GET_KYF_DETAILS_BAPI as an error. Could anybody help me? Please give me your tho