Sqlldr v11 Unable to locate character set handle for character set ID

Good day,
Having recently migrated to a 11g oracle database(11.2.0.1.0) from 9i on a test server, running SQL loader gives/throws the above error.
I've seen a few posts about this but with pretty vague explanations, below is what my bash profile looks like though and i compared NLS_PARAMETERS to another server that already has version 11 running.
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_SID=mtctst
export ORA_NLS10=$ORACLE_HOME/nls/data
export ORACLE_BASE=/oracle/app/product
export ORACLE_HOME=/oracle/client/11.2.0/dbhome_1
#export ORACLE_HOME=/oracle/client/9.2.0
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib/X11; export LD_LIBRARY_PATH
PATH=$ORACLE_HOME/bin:$HOME/bin:/bin:/usr/bin:/usr/local/bin:/bin/X11;
export PATH
#export LD_LIBRARY_PATH=$ORACLE_HOME/lib
#LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$LD_LIBRARY_PATH
#LD_LIBRARY_PATH_64=$ORACLE_HOME/lib
#export LD_LIBRARY_PATH
#export LD_LIBRARY_PATH_64
#PATH=$ORACLE_HOME/bin:$HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11; export PATH
#PATH=$PATH:$HOME/bin
#export PATH
umask 002
unset USERNAMEYour assistance will be appreciated.
Regards,

The complete command as follows:
sqlldr userid=user/password@alias control=myctlfile.ctl log=$logfile discard=$CUR_DIR$oldfilename.discard bad=$CUR_DIR$oldfilename.bad silent=feedback errors=10000000I'm running the command on the database server that gives the following error with log entries:
File found: gsmoly2012080612005072206
SQL*Loader: Release 11.2.0.1.0 - Production on Mon Aug 6 16:36:09 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
SQL*Loader-282: Unable to locate character set handle for character set ID (178).
after main file sqlldr before test if sqlldr was successfull: gsmoly2012080612005072206
in mystring_risk before assign can_continue = blank: PBXOG,,26492092,,,120806,115829,120806 115829,22,,811274127,,,,,,0,,,WORK/gsm/data/gsmoly2012080612005072206,9833407,OLY.GSM  ,
SQL*Loader: Release 11.2.0.1.0 - Production on Mon Aug 6 16:36:18 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
SQL*Loader-282: Unable to locate character set handle for character set ID (178).
value of can_continue after sqlldr of risk file: F

Similar Messages

  • SQL*Loader-282: Unable to locate character set handle for character set ID

    How do I fix this error that i'm getting when running SQL Loader and connecting to an Oracle 10g database. I'm on 10g client.
    SQL*Loader-282: Unable to locate character set handle for character set ID (46).
    Here's the NLS parameter settings in database: select * from v$nls_parameters
    PARAMETER     VALUE
    NLS_LANGUAGE     AMERICAN
    NLS_TERRITORY     AMERICA
    NLS_CURRENCY     $
    NLS_ISO_CURRENCY     AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     DD-MON-RR
    NLS_DATE_LANGUAGE     AMERICAN
    NLS_CHARACTERSET     WE8ISO8859P15
    NLS_SORT     BINARY
    NLS_TIME_FORMAT     HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT     HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY     $
    NLS_NCHAR_CHARACTERSET     AL16UTF16
    NLS_COMP     BINARY
    NLS_LENGTH_SEMANTICS     CHAR
    NLS_NCHAR_CONV_EXCP     TRUE
    Message was edited by:
    evo

    Yep that's it, thanks, I found out about V$NLS_PARAMETERS:
    SQL> select * from v$nls_parameters;
    PARAMETER                  VALUE
    NLS_LANGUAGE               AMERICAN
    NLS_TERRITORY              AMERICA
    NLS_CURRENCY               $
    NLS_ISO_CURRENCY           AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CALENDAR               GREGORIAN
    NLS_DATE_FORMAT            DD-MON-RR
    NLS_DATE_LANGUAGE          AMERICAN
    NLS_CHARACTERSET           WE8ISO8859P1
    NLS_SORT                   BINARY
    NLS_TIME_FORMAT            HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT       DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT         HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT    DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY          $
    NLS_NCHAR_CHARACTERSET     AL16UTF16
    NLS_COMP                   BINARY
    NLS_LENGTH_SEMANTICS       BYTE
    NLS_NCHAR_CONV_EXCP        FALSEGiven that 9i is not available for Solaris x86,
    how do I change NLS_NCHAR_CHARACTERSET to something that
    will work, like UTF-8?
    Thanks
    Ed

  • SQL*Loader-266: Unable to locate character set handle for None

    Hi All,
    I am getting "SQL*Loader-266: Unable to locate character set handle for None" through sql loader.
    NLS Parameters are :
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_CHARACTERSET AL32UTF8
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_NCHAR_CHARACTERSET UTF8
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    Kindly help
    Thanks in advance

    Please, provide the exact value of the NLS_LANG environment variable, if defined in the shell environment of SQL*Loader, and the NLS_LANG Registry setting, if on Windows. Please, provide the SQL*Loader control file.
    -- Sergiusz

  • Unable to locate the xml-definition for FieldName with FieldId

    On a site collection of SP2013 on-premise farm, I found there are many similar log occur every minute. The logs are like:
    Unable to locate the xml-definition for FieldName with FieldId '56747800-d36e-4625-abe3-b1bc74a7d5f8', exception: Microsoft.SharePoint.SPException: Catastrophic  failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) --->  System.Runtime.InteropServices.COMException:
    Catastrophic failure  (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))      at  Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String  bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)     
    at  Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String  bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)
    The log level is medium. The same set of log occur every minute with same set of 60 different GUIDs. All related function on the site is working as expected. By using PowerShell to loop thru the site collections I confirmed there is no field using these
    GUID. Also I have checked the content database and configuration database, also no luck to finding these GUIDs.
    These logs should be related with the search service since the Authentication Authorization log mentioned it is the "Crawler" account in action. However I have no idea why the crawler keep looking for these GUID. I have reset the farm service multiple
    times already.
    The farm was upgraded from SP2010 and it seems no such logs before upgrade.
    Any advice? Thank you.

    Hi Mark,
    From your description, this issue ocurred after you upgraded SharePoint 2010 to SharePoint 2013. Is it right?
    Whether you have some solutions in SharePoint 2010.
    If yes, please make sure you deploy the solution in SharePoint 2013 well after you upgraded to SharePoint 2013.
    There are some similar posts, please check if they are useful for you:
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/5fa900f0-8a1d-4ce8-9ef8-d6e599106834/unable-to-locate-the-xmldefinition-for-fieldname-with-fieldid?forum=sharepointdevelopmentprevious
    http://shipoint.com/2013/03/22/fixing-unable-to-locate-xml-definition-for-ctype-with-spcontenttypeid-in-sharepoint-2010/
    Best Regards,
    Wendy
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Unable to locate the Printer Code for Desktjet 3070A, please help?

    Unable to locate the Printer Code for Desktjet 3070A, please help?

    You can follow this link for steps on getting started with ePrint on the Deskjet 3070A: http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02728147&cc=us&dlc=en&lc=en&product=5068754&too...=
    I am an HP employee

  • Unable to locate the xml-definition for FieldName with FieldId '1f8a351c-965d-4927-9c22-8772b7089f55' when trying to activate feature with references a custom field type

    I´ve a solution which contains a custom field type (found somewhere on the net, the custom field type maps a choice field to managed metadata). There is a second solution which contains site column and site content type definitions using the custom field
    type definition from field type solution.
    On my developement environment, there is no problem with this two solutions. When field type solution is deployed, i can deploy the content type solution and activate the feature and everything is fine.
    However if i give the two solutions to our adminstrator to deploy them into our staging environment, content type feature activation fails. Deploying the field type solution makes no problems. The field type is then available and i can manually creates
    columns with this new field type. However activating the content type solution fails with the error shown in the title of this message. The FieldID from the message is not part of my content type project. Searching the net doens´t show any results for that
    id. So i think it´s not some of the standard field id´s from sharepoint.
    Can anyone help?

     Stack Trace
    Unable to locate the xml-definition for FieldName with FieldId '1f8a351c-965d-4927-9c22-8772b7089f55', exception: Microsoft.SharePoint.SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
    at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)
    at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes) -
    -- End of inner exception stack trace ---
    at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
    at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)
    at Microsoft.SharePoint.SPFieldCollection.FetchFieldsFromWeb()

  • Unable to get automatic event handling for OK button.

    Hello,
    I have created a form using creatobject. This form contains an edit control and Search, Cancel buttons. I have set the Search buttons UID to "1" so it can handle the Enter key hit event. Instead its caption changes to Update when i start typing in the edit control and it does not respond to the Enter key hit. Cancel happens when Esc is hit.
    My code looks like this -
    Dim oCreationParams As SAPbouiCOM.FormCreationParams
            oCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
            oCreationParams.UniqueID = "MySearchForm"
            oCreationParams.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable
                    Dim oForm As SAPbouiCOM.Form = SBO_Application.Forms.AddEx(oCreationParams)
    oForm.Visible = True
    '// set the form properties
            oForm.Title = "Search Form"
            oForm.Left = 300
            oForm.ClientWidth = 500
            oForm.Top = 100
            oForm.ClientHeight = 240
            '// Adding Items to the form
            '// and setting their properties
            '// Adding an Ok button
            '// We get automatic event handling for
            '// the Ok and Cancel Buttons by setting
            '// their UIDs to 1 and 2 respectively
            oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
            oButton = oItem.Specific
            oButton.Caption = "Search"
            '// Adding a Cancel button
            oItem = oForm.Items.Add("2", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 75
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
            oButton = oItem.Specific
            oButton.Caption = "Cancel"
    oItem = oForm.Items.Add("NUM", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 105
            oItem.Width = 140
            oItem.Top = 20
            oItem.Height = 16
            Dim oEditText As SAPbouiCOM.EditText = oItem.Specific
    What changes do i have to make to get the enter key to work?
    Thanks for your help.
    Regards,
    Sheetal

    Hello Felipe,
    Thanks for pointing me to the correct direction.
    So on refering to the documentation i tried out a few things. But I am still missing something here.
    I made the following changes to my code -
    oForm.AutoManaged = True
    oForm.SupportedModes = 1 ' afm_Ok
    oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
    oItem.SetAutoManagedAttribute(SAPbouiCOM.BoAutoManagedAttr.ama_Visible, 1, SAPbouiCOM.BoModeVisualBehavior.mvb_Default)
            oButton = oItem.Specific
            oButton.Caption = "OK"
    AND
    oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE
    oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
    oItem.AffectsFormMode = False
    I get the same behaviour OK button changes to update and enter key does not work.
    Could you please tell me find what is it that i am doing wrong?
    Regards,
    Sheetal

  • How to find out the set handler for a particular signal?

    I have an interesting puzzle to solve. l'm investigating problems with someone else's code and I'd like to get the name of the handler that is set for SEGV. psig shows that the process catches SEGV, however I don't have access to the source code for all the libraries it links against and none of the source code I have sets a handler for SEGV. Is there a way to find out the name of the signal handler that is set for a particular signal in a process? I'm sure the source was compiled with cc -g. Solaris 8

    Hello Haritha,
    Please follow the path.
    Go to RSA1 -> Metadata Repository ->DataStore Objects(ODS) -> Find you DSO(ODS) there and click on that, you will get all the details(Queries, Objects - Char, Key figures, update rules,etc..) related to that particular DSO(ODS), same is the case for Cube as well.
    Please assign points.

  • Unable to locate unrestricted policy files for the Sun JCE for download

    My platform:
    java version "1.6.0_26"
    Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
    Oracle JRockit(R) (build R28.1.4-7-144370-1.6.0_26-20110617-2130-windows-x86_64, compiled mode)
    I am unable to locate the Unlimited Strength Jurisdiction JCE files.
    According to BouncyCastle for Java 1.6:
    ..."you must download the unrestricted policy files for the Sun JCE if you want the provider to work properly. The policy files can be found at the same place as the JDK download. Further information on this can be found in the Sun documentation on the JCE."

    The version at the very bottom of http://www.oracle.com/technetwork/java/javase/downloads/index.html should work.

  • To SET HANDLER for parameter value

    Dear Gurus,
    When the user enters a plant value in PARAMETER then i need to hide some of the Screen fields.
    But the system has to trigger the PAI automatically
    I know this can be acheived using CL_GUI_CFW but how to implement the SET HANDLER method for a parameter
    I searched and found the HANDLER METHODS for ALV, TREE, TIMER etc but I want it for  SELECTION-SCREEN elements.
    I searched WIKI.SDN.SAP.COM and SDN and other stuff.
    Please provide me sample code possibly
    Please guide me.
    Regards
    Ramchander Rao.K

    for selecion screens, I have this:
    PARAMETERS p_cebe TYPE char01 RADIOBUTTON GROUP grp1 DEFAULT 'X' USER-COMMAND flag.
               PARAMETERS p_ceco TYPE char01 RADIOBUTTON GROUP grp1.
    PARAMETERS: p_kokrs LIKE cobk-kokrs DEFAULT 'CORP' MODIF ID cec,
                                        p_gjahr LIKE cobk-gjahr                MODIF ID cec.
             PARAMETERS : p_rbukrs LIKE faglflexp-rbukrs MODIF ID ceb,
                                       p_ryear LIKE faglflexp-ryear   MODIF ID ceb,
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF p_cebe = 'X' AND screen-group1 = 'CEC'.
          screen-active = '0'.
        ENDIF.
        IF p_ceco = 'X' AND screen-group1 = 'CEB'.
          screen-active = '0'.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.

  • How to reset and activate an iPad when you are unable to locate the original Apple ID that set it up

    My son received an iPad as a gift from someone we don't know.  He got it to a state of needing to be reset.  I am having trouble activating it because it is looking for the original Apple ID that set it up.  I have an Apple ID and was able to reset it but am having issues activating it.  Any ideas???

    Sorry, but you can't use that device; only the person who set the lock or Apple can remove it, and Apple will only do so for its original owner(assuming they're alive.)
    (125225)

  • CUCM SIP Trunk Unable to find a device handler for the request received

    I have a lab running CUCM 10.0 that has a SIP trunk to a VCS.  Previously I was able to place and receive calls across the trunk, but now I can only place calls, not receive.  I did recently upgrade to 10.5, but I really can't recall if it ever worked after the upgrade.   The error I'm getting in CUCM is
    Unable to route message, Cannot find the SIP Device with Name=192.1.1.61, Source Port=5060, IpAddress Type=0
    This confuses me, because the destination IP/port of the VCS SIP trunk is 192.1.1.61:5060.  The trunk on CUCM show as up and the Zone in VCS shows as up.  What is going on?
    Thanks,  Mike

    I figured it out.  Long story short, it was a port mismatch.  When you configure Mobile Remote Access on the Expressway Core it creates a SIP trunk from Expressway to CUCM using port 5060.  If you then create another SIP trunk from the same Expressway to CUCM for firewall traversal or external calling, you must use a different port.  The port used for the zone in Expressway must match the SIP security profile used on the CUCM side SIP trunk.  So I had created another SIP Security profile in CUCM with port 5062 for this purpose.  However, the VCS in question that I was working with was only being used for FW traversal, so I used 5060 as the port on the VCS side, but I applied the SIP security profile that used 5062 on the CUCM side.  That's why CUCM was throwing that "device not found" error.  Once I changed the Security Profile to match the same port used on VCS (5060) all was well.  Sorry for the long winded answer.  Hope it helps someone else down the road.

  • Unable to locate a printer driver for a Samsung ML-2165 mono laser on OSX5.8 despite installing software successfully. Any ideas?

    I've installed successfully from disc (and removed it manually and reinstalled and restarted and unplugged etc). The iBook G4 sees the printer but the dialogue tells me there is no appropriate printer driver and to select one.  The only Samsung ones that appear are Guttenberg ones for different models. The Samsung folder appears in the Library/Printers folder. I have also downloaded Mac drivers from Samsung's website they unzip to folders 10.4, 10.5 and 10.6. The 10.5 one includes
    file://localhost/10.5/autosetupinfo.plist
    file://localhost/10.5/Command%20File%20Filter/
    file://localhost/10.5/Filter-%20SPL/
    file://localhost/10.5/ML-2160.icns
    file://localhost/10.5/PDE/
    file://localhost/10.5/PPD/
    file://localhost/10.5/SCMS/
    file://localhost/10.5/statusDesc.plist
    file://localhost/10.5/Utilities/
    I've put the folders in the printers folder - no change, I don't think anything has installed itself. There is certainly no installer automatically opening. What to do next?
    Samsung have sent me a standard Microsoft reply..... Hope someone can advise.

    Thank you very much for your clear advice which ought to work.
    Unfortunately none of this seems to work and is what I have already tried. This is a new printer - I have installed the software from the CD to no avail - I can select the printer but am told I have to download software..
    I have manually deleted software.  Then, I have downloaded the Mac software from the UK and the italian websites. The printer is found in the menu but again it says there is no suitable software. When browing under the 'other' heading the contents of the downloaded folder are greyed out and can't be installed. It appears the Samsung printer driver is not making itself available to the Print and Fax selector.
    It does make me wonder whether I have accidentally removed a vital piece of software - having removed most of the printer drivers a while ago to save disc space.

  • Unable to locate a default player for iTunes audio files in Windows Vista

    I previously owned a Compaq and saved my music in an external storage and worked perfectly. I then purchased a HP with Windows Vista and now am having problems with iTunes. The new computer indicates that iTunes has detected that is not the default player for audio files. It gives me a selection of file extensions, "iTunes music database files", "iTunes music store URL", "M3U Audio Playlist", "MPED4 Audio Files", and others in Windows Media Player. Which one should I select? Thanks
    Joe

    I created a config file (which is very handy in deployment and debuggin) that contains the class name and other additional parameters that is available in the optionsMap inside the LoginModule.
    My Config file looks like :
    DatabaseAuthenticate {
    com.mahesh.research.jaas.auth.CLoginModule required debug=true database.userid="matest" database.password="matest" database.driver="oracle.jdbc.driver.OracleDriver" database.url="jdbc:oracle:thin:@den-dev-2:1521:trexdev" ;
    and i have an entry in the policy file
    grant{
    permission java.util.PropertyPermission "*" , "read, write" ;
    when running the application i specify the following VM Parameter.
    -Djava.security.auth.login.config ="file:/D:/Research/Jb6/JaasResearch/config/login.config"
    offcourse, the jar files in the classpath.
    When i Create a LoginContext and call its login() method, Everything works fine.
    you might wanna try this way and very important you need to specify all permission.
    if you are running under Security manager , try switcing on the debug option as -Djava.security.debug=access.failure that should give a hint on where the problem is.
    hope this helps

  • Set flag for a set of records

    Hi
    I have a table that stores requests raised by employees as below
    name Request_ID date status
    ABC 112 05-Dec-11 rejected
    ABC 786 06-Dec-11 approved
    ABC 987 07-Dec-11 rejected
    ABC 119 08-Dec-11 approved
    MNP 221 09-Nov-11 rejected
    MNP 666 10-Nov-11 approved
    MNP 221 11-Nov-11 rejected
    MNP 999 12-Nov-11 approved
    RST 99 23-Dec-11 rejected
    RST 101 24-Dec-11 approved
    RST 876 25-Dec-11 rejected
    RST 127 26-Dec-11 approved
    I need to check the status of the latest request of each employee and set the flag of all his requests as -
    ‘A’ if the latest request status is ‘approved’
    ‘B’ if the latest request status is ‘rejected’
    The resultset should be something like -
    name Request_ID date status Flag
    ABC 112 05-Dec-11 rejected A
    ABC 786 06-Dec-11 approved A
    ABC 987 07-Dec-11 rejected A
    ABC 119 08-Dec-11 approved A
    MNP 221 09-Nov-11 rejected B
    MNP 666 10-Nov-11 approved B
    MNP 221 11-Nov-11 approved B
    MNP 999 12-Nov-11 rejected B
    RST 99 23-Dec-11 approved A
    RST 101 24-Dec-11 approved A
    RST 876 25-Dec-11 rejected A
    RST 127 26-Dec-11 approved A
    Could you please help me in framing this SQL. Use of any analytical function would be helpful
    Regards
    -pankaj

    Hi, Pankaj,
    Welcome to the forum!
    910543 wrote:
    Hi
    I have a table that stores requests raised by employees as belowWhenever you have a problem, please post CREATE TABLE and INSERT statements for your sample data, so that the people who want to help you can re-create the probelm accurately and test their ideas. since this is your first message, I'll do it for you:
    CREATE TABLE     table_x
    (     name           VARCHAR2 (5)
    ,     request_id     NUMBER
    ,     dt          DATE          -- DATE is not a good column name
    ,     status          VARCHAR2 (10)
    ,     CONSTRAINT  x_uk     UNIQUE (name, dt)
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('ABC', 112, TO_DATE ('05-Dec-2011', 'DD-Mon-YYYY'), 'rejected');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('ABC', 786, TO_DATE ('06-Dec-2011', 'DD-Mon-YYYY'), 'approved');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('ABC', 987, TO_DATE ('07-Dec-2011', 'DD-Mon-YYYY'), 'rejected');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('ABC', 119, TO_DATE ('08-Dec-2011', 'DD-Mon-YYYY'), 'approved');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('MNP', 221, TO_DATE ('09-Nov-2011', 'DD-Mon-YYYY'), 'rejected');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('MNP', 666, TO_DATE ('10-Nov-2011', 'DD-Mon-YYYY'), 'approved');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('MNP', 221, TO_DATE ('11-Nov-2011', 'DD-Mon-YYYY'), 'rejected');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('MNP', 999, TO_DATE ('12-Nov-2011', 'DD-Mon-YYYY'), 'approved');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('RST',  99, TO_DATE ('23-Dec-2011', 'DD-Mon-YYYY'), 'rejected');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('RST', 101, TO_DATE ('24-Dec-2011', 'DD-Mon-YYYY'), 'approved');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('RST', 876, TO_DATE ('25-Dec-2011', 'DD-Mon-YYYY'), 'rejected');
    INSERT INTO table_x (name, request_id, dt, status) VALUES ('RST', 127, TO_DATE ('26-Dec-2011', 'DD-Mon-YYYY'), 'approved');
    COMMIT; name Request_ID date status ...If those are all the columns in the table, and you want to display a flag column, you can do something like this:
    SELECT     name
    ,     request_id
    ,     dt
    ,     status
    ,     CASE  FIRST_VALUE (status) OVER ( PARTITION BY  name
                               ORDER BY     dt     DESC
              WHEN  'approved'     THEN  'A'
              WHEN  'rejected'     THEN  'B'
         END          AS flag
    FROM     table_x
    ;If the table has a flag column, and you need to populate it, you can use the query above in a MERGE statement. (You may be better off not actually storing the flag, however, if it's hard to keep up to date.)
    MNP 221 09-Nov-11 rejected
    MNP 666 10-Nov-11 approved
    MNP 221 11-Nov-11 rejected
    MNP 999 12-Nov-11 approved ...
    I need to check the status of the latest request of each employee and set the flag of all his requests as -
    ‘A’ if the latest request status is ‘approved’
    ‘B’ if the latest request status is ‘rejected’
    The resultset should be something like -
    name Request_ID date status Flag
    MNP 221 09-Nov-11 rejected B
    MNP 666 10-Nov-11 approved B
    MNP 221 11-Nov-11 approved B
    MNP 999 12-Nov-11 rejected BIn the original data, the status for the row with request_id=999 was 'approved'. Is there a typo somewhere?
    Edited by: Frank Kulash on Jan 26, 2012 10:57 PM

Maybe you are looking for

  • How can I sync just one folder of photos

    I have created a photo folder which I want to use to sync photos with.  I set up iTunes to sync just that folder.  I added 4 new photos to the folder on my iMac, then tried to sync, butt he photos were not sent to my iPhone.  Why not?

  • Need to fetch value from a table based on data range

    Hello there, I was hoping that the community could give me a hand with this little puzzle I got. I am currently creating a Time Dimension for a data wharehouse, and I have the requirement to populate a column named SEASON (e.g: Summer, Winter, Spring

  • Alternating Blue Screen

    I have a Satellite P855-S5102 and when I went to turn it on today it began flashing from the Windows 8 screen to a blank blue screen, again and again. I am not able to open any programs other than Task Manager. I decided to 'reset' the computer, pres

  • How to make the collection with fetched rows process dependant

    Hello, I have the following problem. A page containing some select lists narrowing the tabular form selection. In this tabular form I have an edit button that goes to another "detail" page for editing the selected record. Now I want to put next and p

  • Ale,idoc,bapi

    Can anyone pls let me know what is the difference between these 3 terminology? How we r using it in SD?