Best practice - comparing NUMBER(4, 0) and VARCHAR2(5)

I have two fields in two different views that I am comparing in a complex query. This is just one small part of the query.
I want to make sure I am doing this the best way. First, here are the two fields:
ZAS.ORG_ID NUMBER(4,0)
ORG.IORG_NBR VARCHAR2(5)
And here is the part of the query that I select the first field.
(CASE WHEN ZAS.ORG_ID IS NULL THEN NULL ELSE (TO_CHAR(ZAS.ORG_ID, '0000')) END)
As you can see, I do the same thing in the second part of the query. To help you understand, note that I am basically pulling back a bunch of data from two sources and comparing them.
(CASE WHEN org.iorg_nbr IS NULL THEN NULL ELSE (TO_CHAR(org.iorg_nbr, '0000')) END)
Please let me know if I need to supply any additional information. Any help would be greatly appreciated. Thanks!

Hello,
This:
(CASE WHEN ZAS.ORG_ID IS NULL THEN NULL ELSE (TO_CHAR(ZAS.ORG_ID, '0000')) END)Could simply be this:
(TO_CHAR(ZAS.ORG_ID))And this:
(CASE WHEN org.iorg_nbr IS NULL THEN NULL ELSE (TO_CHAR(org.iorg_nbr, '0000')) END)Can simply be this:
(org.iorg_nbr)No need to do anything with that, since it's already TRIMmed (no spaces), and you're converting ZAS.ORG_ID to a CHAR string, so they both will match without the extra '0's. And no need to explicitly handle NULLs at all.

Similar Messages

  • Any Best Practices (i.e. DOs and Don'ts) for source to target MAPPINGs?

    Hi Experts,
    Any Best Practices (i.e. DOs and Don'ts) for source to target MAPPINGs?
    I will appreciate any hints on this.
    Thanks

    Hi,
    I am assuming that you are asking about transformation mapping between source and target..
    1) One to One mapping
    2)Avoid using complex calculations
    3) if any calculations required use routine instead of formulas
    4)if possible avoid Using field routine (you can do start or end routine )
    5)Do not map unwanted fields ( unnecessary process time,database occupant, also problem while activation of DSO data )
    6)Avoid using master data read mapping option instead you can use routine to fetch the master data
    7) no need of using  infosurce
    8)Use standard time conversions for time fields
    Generally these things we need to consider while mapping..
    Regards,
    Satya

  • What's the 'best practice' way to get email and fax number from vendor?

    Hello *,
    could anybody let me know what the 'best-practice' is to get the fax number and smtp address from the vendor master? Is there a preferred function module I should use?
    Thanks a lot,
    Torsten

    Hi ,
    try that:
    TYPE-POOLS: szadr.
    DATA adr_kompl TYPE szadr_addr1_complete.
    DATA adr1 TYPE szadr_addr1_line.
    DATA adtel TYPE szadr_adtel_line.
    DATA admail TYPE szadr_adsmtp_line.
    DATA adfax TYPE szadr_adfax_line.
    CALL FUNCTION 'ADDR_GET_COMPLETE'
           EXPORTING
                addrnumber              = lfa1-adrnr
           IMPORTING
                addr1_complete          = adr_kompl
           EXCEPTIONS
                parameter_error         = 1
                address_not_exist       = 2
                internal_error          = 3
                wrong_access_to_archive = 4
                OTHERS                  = 5.
    * Mail
      LOOP AT adr_kompl-adsmtp_tab INTO admail.
        MOVE admail-adsmtp-smtp_addr TO atab-mail.
      ENDLOOP.
    * fax
      LOOP AT adr_kompl-adfax_tab INTO adfax.
        MOVE adfax-adfax-fax_number TO atab-fax_number.
      ENDLOOP.
    regards Andreas

  • Best practices on number of pipelines in a single project/app to do forging

    Hi experts,
    I need couple of clarification from you regarding endeca guided search for enterprise application.
    1)Say for example,I have a web application iEndecaApp which is created by imitating the jsp reference application. All the necessary presentation api's are present in WEB-INF/lib folder.
    1.a) Do I need to configure anything else to run the application?
    1.b) I have created the web-app in eclipse . Will I be able to run it from the any thirdparty tomcat server ? If not then where I have to put the war file to successfully run the application?
    2)For the above web-app "iEndecaApp" I have created an application named as "MyEndecaApp" using deploymenttemplate. So one generic pipeline is created. I need to integrate 5 different source of data . To be precise
    i)CAS data
    ii)Database table data
    iii)Txt file data
    iv)Excel file data
    v)XML data.
    2.a)So what is the best practice to integrate all the data. Do I need to create 5 different pipeline (each for each data) or I have to integrate all the 5 data's in a single pipeline ?
    2.b)If I create 5 different pipeline then all should reside in a single application "MyEndecaApp" or I need to create 5 difference application using deployment template ?
    Hope you guys will reply it back soon..... Waiting for your valuable response ..
    Regards,
    Hoque

    Point number 1 is very much possible ie running the jsp ref application from a server of your choice.I havent tried that ever but will draw some light on it once I try.
    Point number 2 - You must create 5 record adapters in the same pipeline diagram and then join them with the help of joiner components. The resultant must be fed to the property mapper.
    So 1 application, 1 pipeline and all 5 data sources within one application is what should be the ideal case.
    And logically also since they all are related data, so must be having some joining conditions and you cant ask 5 different mdex engines to serve you a combined result.
    Hope this helps you.
    <PS: This is to the best of my knowledge>
    Thanks,
    Mohit Makhija

  • Best Practice - Bounded Task Flows, Regions and Nested Application Modules

    Using JDev 11.1.1.3; understand that it's generally considered good practice to just have 1 root application module servicing model content / services for each page. In our application, we've used a number of bounded task flows and page fragments deployed as af:region's into pages as either a) views targeted in page-flow navigation, b) tab panel content inside a regular jspx, or c) af:popup / af:dialog content. As it stands, we've not engaged nesting of the application modules for this embedded region content, so these regions are no doubt instantiating new AM's if/when invoked. Should the AM's servicing these embedded regions be deployed nested within the root AM's, and then if so, does this change the way that the jsff / fragment content is actually developed (currently as per any other jspx using the DataControl pallete). Or are the best-practice directives talking about a page as being the design-time / declarative composition of content rather than the run-time aggregation of page + fragments ... in which case the fact that our embedded fragments are not using nested AM's is unlikely to concern.
    Thanks,

    Probably a better question for the ADF EMG: http://groups.google.com/group/adf-methodology?hl=en
    CM.

  • Best practice when developing APEX apps and using a SVN repository

    Hi experts,
    I wanted to get your opinion on best practice regarding how to use SVN and APEX combined.
    The idea is basically how to structure and how to save APEX apps the best way in a repository.
    I am currently working with a custom SVN structure, not using the default TRUNC/TAGS one : every app has a folder , under every app folder i have PAge number folders, and for each page reports, regions and global objects separated.
    This helps me because its more readable then saving the whole page export, its good for small changes and i have a clear overview of every bit and piece.
    What is everybody else using or is there a best practice to follow here that i dont know?
    Kind regards,
    Alex

    @tomaugerdotcom
    Something like this might help: https://testflightapp.com/
    Concevably, you could roll your own internal service if that particular one doesn't suit you. (I don't have any knowledge about how they are doing it, but it shouldn't be hard to figure out since Apple's constraining rules would only allow a few possibilities.)
    USB app install and debugging isn't supported on iOS. You have to use wireless.
    Another option specifically for multi-touch dev/testing, is to use an Android device.

  • Question - Best practice data source for Vs2008 and Crystal Reports 2008

    I have posted a question here
    CR2008 using data from .NET data provider (ADO.NET DATASET from a .DLL)
    but think that perhaps I need general community advise on best practice with data sources.
    In Crystal reports I can choose the data source location from any number of connection types, eg ado.net(xml), com, oledb, odbc.
    Now in regard to the post, the reports have all been created in Crxi 6.3, upgraded to Crystal XI and now Im using the latest and greatest. I wrote the Crystal Reports 6.3/ XI reports back in the day to do the following: The Reports use a function from COM Object which returns an ADO recordset which is then consumed fine.
    So I don't want to rewrite all these reports, of which there are many.
    I would like to know if any developers are actually using .NET Class libraries to return ADO.NET datasets via the method call or if you are connecting directly to XML data via whatever source ( disk, web service, http request etc).
    I have not been able to eliminate the problem listed in the post mentioned above, which is that the Crystal Report is calling the .NET class library method twice before displaying the data. I have confirmed this by debugging the class lib.
    So any guidance or tips is appreciated.
    Thanks

    This is already being discuss in one of your other threads. Let's close this one out and concentrate on the one I've already replied to.
    Thanks

  • Best practice for number of result objects in webi

    Hello all,
    I am just wondering if SAP has any recommendation or best practice document regarding number of fields in Result Objects area for webi. We are currently running on XI 3.1 SP3...one of the end user is running a webi with close to 20 objects/dimensions and 2 measure in result objects. The report is running for 45-60 mins and sometimes timing out. The cube which stores data has around 250K records and the report would return pretty much all the records from the cube.
    Any recommendations/ best practices?
    On similar issue - our production system is around 250GB what would be the memory on your server typically...currently we have 8GB memory on the sap instance server.
    Thanks in advance.

    Hi,
    You mention Cubes so i suspect BW or MS AS .   Yes,  OLAP data access (ODA) to OLAP DataSets is a struggle for WebIntelligence which is best at consuming Relational RowSets.
    Inefficient MDX queries can easily be generated by the webi tool, primeraly due to substandard (or excessive) query and document design. Mandatory filters and focused navigation (i.e. targetted BI questions) are the best for success.
    Here's an intersting article about "when is a webi doc too big" https://weblogs.sdn.sap.com/pub/wlg/18706
    Here's a best practice doc about webi report design and tuning ontop of BW MDX : https://service.sap.com/~sapidb/011000358700000750762010E 
    Optimization of the cube itself, including aggregates and cache warming is important. But especially  use of Suppress Unassigned nodes in the BW hierarchy, and "query stripping" in the webi document.
    finally,  patch level of the BW (BW-BEX-OT-MDX) component is critical.  i.e. anything lower than 7.01 SP09 is trouble. (memory management, mdx optimization, functional correctness)
    Regards,
    H

  • Which are the best practices with mail for machos and any email client for PC

    I got some mac`s at the office, and I want make a best practices manual for my users, like, please open the clip to attach the file intead of drag and drop, beacuse the pc users see the photo embedded into the message body.
    could someone helpme?

    Why not print out Mail's Help files?

  • Best Practice For Database Parameter ARCH_LAG_TARGET and DBWR CHECKPOINT

    Hi,
    For best practice - i need to know - what is the recommended or guideline concerning these 2 Databases Parameter.
    I found for ARCH_LAG_TARGET, Oracle recommend to setup it to 1800 sec (30min)
    Maybe some one can guide me with these 2 parameters...
    Cheers

    Dear unsolaris,
    First of all if you want to track the full and incremental checkpoints, make the LOG_CHECKPOINT_TO_ALERT parameter TRUE. You will see the checkpoint SCN and the completion periods.
    Full checkpoint is being triggered when a log switch happens and checkpoint position in the controlfile is written in the datafile headers. For just a really tiny amount of time the database could be consistent eventhough it is open and in read/write mode.
    ARCH_LAG_TARGET parameter is disabled and set to 0 by default. Here is the definition for that parameter;
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams009.htm
    If you want to set this parameter up the Oracle recommends it to be 1800 as you have said. This can subject to change from database to database and it is better for you to check it by experiencing it.
    Regards.
    Ogan

  • Best practice for migrating between environments and versions?

    Hi to all,
    we've got a full suite of solutions custom developed in SAP BPC 7.0, SP 7. We'd like to understand if
    - there are best practice in order to copy this applications from an environment to another environment (another client)
    - there are best practice in case the client has got a newer version of SAP BPC (they should install the 7.5, while we're still stucked with the 7.0).
    Thank you very much
    Daniele

    Hi Daniele
    I am not entirely sure, what you are asking, Please could you provide additional information.
    Are you looking for best practice recommendations for Governance, for example: Change transports between DEV, QA and PRD in BPC 7.0?
    What is the best method? Server Manager backup and restore, etc  ?
    And
    Best Practice recommendations on how to upgrade to a different version of BPC, for example: Upgrading from BPC 7.0 to 7.5 or 10.0 ?
    Kind Regards
    Daniel

  • Best Practice in maintaining multiple apps and user logins

    Hi,
    My company is just starting to use APEX, and none of us (the developers) have worked on this before either. It is greatly appreciated if we can get some help here.
    We have developed quite a few applications in the same workspace. Now, we are going to setup UAT and PRD environments and also trying to understand what the best practice is to maintain multiple apps and user logins.
    Many of you have already worked on APEX environment for sometime, can you please provide some input?
    Should we create multiple apps(projects) for one department or should we create one app for one department?
    Currently we have created multiple apps for one department, but, we are not sure if a user can login once and be able to access to all the authenticated apps.
    Thank you,
    LC

    LC,
    I am not sure how much of this applies to your situation - but I will share what I have done.
    I built a single 700+ page application for my department - other areas create separate smaller applications.
    The approach I chose is flexible enough to accomdate both.
    I built a separate access control application(Control) in its own schema.
    We use database authenication fo this app - an oracle account is required.
    We prefer to use LDAP for authentication for the user applications.
    For users that LDAP is not option - an encrypted password is stored - reset via email.
    We use position based security - priviliges are based on job functions.
    We have applications, appilcations have roles , roles have access to components(tabs,buttons,unmasked card numbers,etc.)
    We have positions that are granted application roles - they inherit access to the role components.
    Users have a name, a login, a position, and a site.
    We have users on both the East Coast and the West Coast, we use the site in a sys_context
    and views to emulate VPD. We also use the role components,sys_contexts and views to mask/unmask
    card numbers without rewriting the dependent objects(querys,reports,views,etc.)
    The position based security has worked well, when someone moves,
    we change the position they are assigned to and they immediately have the privileges they need.
    If you are interested I can rpovide more detail.
    Bill

  • Best Practice for saving all fieds and searches in capital letters

    I want to save all fields in my all pages in CAPS and also to search with CAPS e.g user enters search criteria in small letters, then automatically it should convert to caps. What is the best practice to do that?

    Hi,
    There are already so many discussions on this in this forum, some of the links are:
    Uppercase
    How to convert user input in the page to upper case?
    Sireesha

  • Best Practice for Buy in Set and Dismantle for Sales

    Hi All SAP Masters,
    We have a scenario that when purchasing an item as "set", in this set, it has a few components inside this set (something like a material BOM). Example, a machine which comes with several parts. However, when the user received this set from the supplier, the user would further dismantle certain part(s) from the set/"machine" and sell it separately to the customer as a component/"single item".
    What is the best practice in the SAP process to be adopted?
    Please help. Thank you.
    Warmest Regards,
    Edwin

    If your client  have PP module , then follow this steps
    Consider A is the purchased material and going to dismantle the A into B, and C
    1) create a BOM for B material
        and assign the header material  A as consumption material with + ve qty
       and C component as byproduct and maintain - ve qty in BOM
    2) maintain backflush indicator for A & C in material master MRP2 view
    3) create routing for B and maintain auto GR for final operation
    4) create a  production order for B
    5) confirm the order in Co11n, A  will be consumed in 261 movement, C will be receipt with 531 movement
    B will receipt in 101 movement .
    once the stock is posted into unrestricted you can sale B & C

  • Best Practices: Flash Player 10.1 and Flash Lite 4

    I've found the documentation for Flash Lite 4.  It appears to support most everything you'd want to do in AS3, aside from some desktop-specific APIs like Clipboard, File, ContextualMenu, etc..
    I've also noticed that there's a Flash Lite 4 compile target in Flash CS5.  Would it be considered a best-practice to target Flash Lite 4 instead of Flash Player 10 for web content?  (Obviously, desktoppy web apps would still need to be compiled for 10).

    TJ,
    Thanks for your great feedback and your kind words.  I'll certainly be making sure the team sees your comments, though I can't say we'll have 10.1 in place for you by Monday.
    Thanks
    -D

Maybe you are looking for

  • How to make selective fields of VD03 editable?

    Hi all, In VD03 transaction, if i press the Display -> Change option in Customer menu all the fields of the tabstrip sales, Billing Documents and Partner functions gets enabled, i.e ready for change. But I need to make only certain fields editable an

  • Invoking perl cartridge from another perl cartridge

    Hi, I have a perl cgi tht I am porting to the cartridge framework and am having the following issue: the perl script "opens" another perl script (and "system"s another). THis does not seem to work in my setup presumable because the standalone version

  • OID, JNDI and ObjectChangeListener

    i'll admit up front that i haven't research this extensively as of yet, but does OID 9.0.2 support EvenDirContexts and ObjectChangeListeners using JNDI? i've set up the following code: public class ObjectListenerTestClass implements ObjectChangeListe

  • How to convert table to control

    In my attached VIS, I am giving user input values to controls,the user input control values i am passing to a table and writing text file.how can i do exactly opposite of that what i am doing now.that means reading same text file(that i already writt

  • I can't change advanced type values (superscript & subscript)

    When i am trying to use subscript and superscript my text disappears. I think first that it is related to my font but when i open Preferences/Advanced Type I saw that both size and location values of superscript and subscript are zero. Everytime i ch