Doubt Regarding Collection Methods

Hello,
I am working on Oracle version 10g Release 2
I wanted to know that how can we find a particular name (person) exists in a Collection..
Below is my Code
DECLARE
TYPE nested_tab IS TABLE OF VARCHAR2(100);
l_tab nested_tab := nested_tab();
BEGIN
SELECT e.ent_id BULK COLLECT INTO l_tab
FROM entity_master e
WHERE e.ent_id IN ('N002208', 'Z002011', 'V002313', 'X002011'..... & so on);
IF l_tab.EXISTS('N002208') THEN
dbms_output.put_line('element exists');
ELSE
dbms_output.put_line('NO element ');
END IF;
END;
ORA-06502 - Numeruc or Value Error
what can be the work around for this...?

Aijaz Mallick wrote:
Ok.
But It would be really helpfull if you Elaborate this Example a Bit...
I mean the I/O part because Quering table also Require I/OANY data that you need to access (in any computer system and language) requires I/O. That data needs to be read from disk (PIO or physical I/O) or buffer cache (LIO or logical I/O) and processed.
So the important part is optimising I/O. If you only need 1MB of data from a 100GB data structure, you do not want to I/O that entire data structure to find that 1MB of data that is relevant to your code.
The answer to this is three fold.
Firstly, you design that data structure optimally. In databases, that means a proper and sound relational database model.
Secondly, you implement that data structure optimally. In databases, that means using the most appropriate physical data model for storing that relational data model. Using the features like indexing, partitioning, index organised tables, and so on.
Lastly, in some cases your requirements will require scanning a large volume of that data structure. Which means that there is no option but to use a lot of I/O. In such a case, parallelising that I/O is important. I/O has inherent latency. Which means idle time for your code, waiting for data to arrive from the I/O system. Parallel processing enables one to address this and increase performance and scalability.
So what do you need to do with your "large" table?
- make sure it is correctly modelled at a logical data model level
- make sure it is optimally implemented physically in Oracle, making best use of the features that the Oracle RDBMS provide
- when your code has to deal with large volumes of data, design and code for parallel processing
& how about Java Part. ..?Java is worse than PL/SQL in this regard as the data path for data to travel from the database layer into Java is longer and slower than the same path to PL/SQL.
Storing/caching that data in the application layer is an attempt to address the cost of this data path. But this is problematic. If another application makes a change to data in the database, the cached data in the application tier is stale - and incorrect. Without the application layer knowing about it.
Storing/caching that data in the application layer means a bigger and more expensive h/w footprint for the application layer. It means that scaling also requires a cluster cache in the application layer to address scalability when more application servers are added. This is complex. And now reintroduce a data path that runs over the network and across h/w boundaries. Which is identical to the data path that existed between the database layer and application layer in the first place.
It also makes the border between the database layer and application layer quite complex as caching data in the application layer means that basic database features are now also required in the application layer. It is an architectural mess. Contains complex moving parts. Contains a lot more moving parts.
None of this is good for robustness or performance or scalability. Definitely not for infrastructure costs, development costs,and support and maintenance costs, either.
In other words, and bluntly put. It is the idiotic thing to do. Unfortunately it is also the typical thing done by many J2EE architects and developers as they have a dangerous and huge lack of knowledge when it comes to how to use databases.

Similar Messages

  • Doubt regarding Generic methods

    I have 4 generics Methods getEJBHome,getEJBLocalHome ,findEJBLocalHomeAndPopulateCache,findEJBHomeAndPopulateCache
         public <T extends EJBHome> T getEJBHome(final String jndiName,final Class<T> ejbHomeClass) throws NamingException,ClassCastException{
              T ejbHome=null;
              try{
                   if(serviceLocatorCache.containsKey(jndiName)){
                        ejbHome=(T)serviceLocatorCache.get(jndiName);     
                   else{
                        ejbHome=findEJBHomeAndPopulateCache(jndiName,ejbHomeClass);
              catch(NamingException namingException ){
                   System.err.println("Exception in getEJBHome ["+namingException.getMessage()+"]");
                   throw namingException;
              catch(ClassCastException classCastException ){
                   System.err.println("Exception in getEJBHome ["+classCastException.getMessage()+"]");
                   throw classCastException;
              return ejbHome;
         private <T extends EJBHome> T findEJBHomeAndPopulateCache(final String jndiName,final Class<T> ejbHomeClass) throws NamingException{
              T ejbHome=null;
              try{
                   ejbHome=(T)javax.rmi.PortableRemoteObject.narrow(context.lookup(jndiName),ejbHomeClass);
                   serviceLocatorCache.put(jndiName,ejbHome);
              catch(NamingException namingException){
                   System.err.println("Exception in findEJBHomeAndPopulateCache ["+namingException.toString()+"]");
                   throw namingException;
              return ejbHome;
         }i am calling findEJBHomeAndPopulateCache like normal method call,When i try to call findEJBLocalHomeAndPopulateCache from getEJBLocalHome it shows compile time error .
         public <T extends EJBLocalHome> T getEJBLocalHome(final String jndiName) throws NamingException{
              T ejbLocalHome=null;
              try{
                   if(serviceLocatorCache.containsKey(jndiName)){
                        ejbLocalHome=(T)serviceLocatorCache.get(jndiName);     
                   else{
                        ejbLocalHome=this.<T>findEJBLocalHomeAndPopulateCache(jndiName);
                        //ejbLocalHome=findEJBLocalHomeAndPopulateCache(jndiName); ERROR
              catch(NamingException namingException ){
                   System.err.println("Exception in getEJBLocalHome ["+namingException.getMessage()+"]");
                   throw namingException;
              catch(Exception exception ){
                   System.err.println("Exception in getEJBLoacalHome ["+exception.getMessage()+"]");
                   throw new NamingException("Exception in getEJBLoacalHome ["+exception.getMessage()+"]");
              return ejbLocalHome;
         }when i try to call method findEJBLocalHomeAndPopulateCache like ejbLocalHome=findEJBLocalHomeAndPopulateCache(jndiName);
    i am getting compile time error
    ServiceLocator.java:133: type parameters of <T>T cannot be determined; no unique maximal instance ex
    ists for type variable T with upper bounds T,javax.ejb.EJBLocalHome
        [javac]                             ejbLocalHome=findEJBLocalHomeAndPopulateCache(jndiName);
        [javac]     ^
    when i am calling that method like
    this.<T>findEJBLocalHomeAndPopulateCache(jndiName); it is not showing any error.normally we are invoking generic methods like normal methods ?
    Why i am getting a compile time error for findEJBLocalHomeAndPopulateCache method?
    method findEJBLocalHomeAndPopulateCache is as shown
         private <T extends EJBLocalHome> T findEJBLocalHomeAndPopulateCache(final String jndiName) throws NamingException{
              T ejbLocalHome=null;
              try{
                   ejbLocalHome=(T)context.lookup(jndiName);
                   serviceLocatorCache.put(jndiName,ejbLocalHome);
              catch(NamingException namingException){
                   System.err.println("Exception in findEJBLocalHomeAndPopulateCache ["+namingException.toString()+"]");
                   throw namingException;
              return ejbLocalHome;
         }Plz help

    Hi Ben,
    Thanks for your replay, Can you please tell me why in first case ie getEJBHome method call findEJBHomeAndPopulateCache(jndiName,ejbHomeClass) not causing any error.In both case upper bound of ‘T’ is EJBLocalHome .Kindly give me a clear idea.
    Plz help

  • Doubt Regarding Collection

    Hello,
    How can we perform a search inside a collection Variable ...
    Like ... we use a IN .... If Yes then how ..?

    Below is the illustration to query a collection in a where clause.
    create or replace type test_coll as object(a number, b number);
    create or replace type test_collnest as table of test_coll;
    create table test_nestab(col1 number, col2 test_collnest) nested table col2 store as tab_nest
    SQL> ed
    Wrote file afiedt.buf
    1* insert into test_nestab values (&n,test_collnest(test_coll(&n,&n)))
    SQL> /
    Enter value for n: 1
    Enter value for n: 100
    Enter value for n: 200
    old 1: insert into test_nestab values (&n,test_collnest(test_coll(&n,&n)))
    new 1: insert into test_nestab values (1,test_collnest(test_coll(100,200)))
    1 row created.
    SQL> /
    Enter value for n: 2
    Enter value for n: 200
    Enter value for n: 300
    old 1: insert into test_nestab values (&n,test_collnest(test_coll(&n,&n)))
    new 1: insert into test_nestab values (2,test_collnest(test_coll(200,300)))
    1 row created.
    SQL> /
    Enter value for n: 3
    Enter value for n: 300
    Enter value for n: 400
    old 1: insert into test_nestab values (&n,test_collnest(test_coll(&n,&n)))
    new 1: insert into test_nestab values (3,test_collnest(test_coll(300,400)))
    1 row created.
    Query the collection using TABLE function
    1* select t1.col1,t2.* from test_nestab t1, table(t1.col2) t2
    SQL> /
    COL1 A B
    1 100 200
    2 200 300
    3 300 400
    Where Query based on collection attribute
    1 select t1.col1,t2.* from test_nestab t1, table(t1.col2) t2
    2* where t2.a = 200
    SQL> /
    COL1 A B
    2 200 300

  • Doubt Regarding Statistics Collection in 10g

    Hello,
    Me Jr Dba i have a doubt regarding statistics calculation in 10g.As we know that if we set
    the initilization parameter STATISTICS_LEVEL=Typical then AOS(Automatic Optimizer staistics) calculate the statistics for the tables, whose blocks are greater then 10% changed from the last calculation.Here my doubt is since already statistics are gathered,
    is there any necessity for us to gather the statistics manually by using
    DBMS_STATS.GATHER to see the tables or system statistics.
    Can u plz assist me on the above
    Regards,
    Vamsi

    Hi,
    Please see here,
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#i41448
    If the table/s are changing very frequently than its better to gather the stats manually.This would lead teh volatile table coming up into the stats job again and again.
    For the system stats and data dictionary stats,they are not collected by default.So there is no choice but to gather them manually.
    Aman....

  • System does not allow to me to change collect method in RZ20

    Hi.
    I Have the problem with my SAP R/3.
    I have productive, based on 4 application servers. In RZ20, alerts of  MTE Operating System for one application server is not work. In nodes properties I have collect method "CCMS_Cpu_Collect_c". On other application servers - "CCMS_OS_Collect". System does not allow to me to change collect method
    What will I do? Please help me.
    Edited by: Viktor Unsub on Jul 18, 2008 4:55 PM

    Hello Victor,
    the data collection method CCMS_OS_COLLECT is an ABAP report as you can see in the method overview in rz21. This report is used to collect the operating system data and send it to the CCMS.
    As soon as you install the sapccm4x agent on an instance the agent will take over the data collection for the operating system subtree (this is also described in [note 522453 |http://service.sap.com/sap/support/notes/522453]. Important: point 4. of the note!). I.e. as soon as the agent is responsible for the data collection you will see the mentioned CCMS_Cpu_Collect_c.
    If the MTE doesn't display data you should check if the agent is running.
    Regards, Michael

  • Unable to Data Collection Methods in CCMS/RZ20

    Hi gurus,
    There are lot of Montoring Objects for which there are no data collection methods already assigned which I am trying to do.
    I am able to do method assignments only to data analysis and auto reaction methods but not " data collection " which remains in display only mode even after using the edit option,
    Kindly let me know how to proceed.
                                                                                    Regards,
    Sandeep.

    Hi,
    in the past there was the option to change the data supplier. After several customers accidentally entered analysis or auto-reaction methods, the changed that to read-only, because its completely preconfigured - no need to change. And: you cannot know the name of a data supplier to be entered.
    NO METHOD does not mean: There is no data supplier. There are a lot of MTEs being refreshed with data, although there is NO METHOD being entered. These MTEs are refreshed by so called active data suppliers - they run independently from the CCMS Moni Infra.
    Example: Syslog. Data collection method: NO METHOD. Real data supplier: The SAP kernel, which reports into syslog (when there is something to be reported) and into CCMS in parallel. All changes to that MTE would cause a problem in data supplying.
    So please feel free to open a n SAP call, whenever an MTE in CCMS is white (no data), and you are interested in that information. Sometimes we disable data supplying by default - then we can tell you how to enable it.
    Best regards
    Christoph Nake
    PM CCMS

  • Error messages are not posted into ECH using collect method

    In asynchronous interface, Error messages are not posted into tcode:ECH_MONI_SEL using collect method.
    In the collect method, passing software component version,business process and error messages.but its not posted into ech and ppo.

    Hi,
    Have you created the FEH class for the proxy. In that, from within the PROCESS method, when there is an error you will be placing those errors into a table and this needs to be passed to the COLLECT method.
    CALL METHOD i_ref_registration->collect
       EXPORTING
         i_single_bo      = input
         i_component      = 'ZSWC'   "Software component defined while FEH customisation
         i_process        = 'ECH_BP'  "ECH Business process defined while FEH customisation
         i_error_category = lc_errcat
         i_main_message   = wa_error
         i_messages       = lt_error
         i_main_object    = wa_object.
    Here while populating the wa_object, the  objtype field should be populated with the object type defined while FEH customization.
    If all these things are done, then this should post the error.
    Regards,
    Abijith

  • Doubts regarding a Servlet.

    few doubts regarding servlets :
    1. Can a servlet have a constructor ? - my answer is yes.
    2. is it mandatory that i should override the doGet() and doPost() methods ? Can I have a servlet(user defined servlet) without doGet() and doPost() methods ?
    3 Suppose I have a userdefined servlet that extends HttpServlet what are the methods that I mandatorily need to override in my user defined servlet ?
    4. In the below code :
    out.println(getServletContext().getInitParameter("adminEmail"); // assuming adminEmail is a context parameter name defined in web.xml.
    I read the explanation in HeadFirst as "Every Servlet inherits a getServletContext() method". I saw in the Servlet and ServletRequest api but didnt find this method there.
    I saw this method only in ServletConfig interface.
    out.println(getServletContext().getInitParameter("adminEmail"); is nothing but out.println(*this*.getServletContext().getInitParameter("adminEmail"); // whats this here, i mean on which object does the method get invoked ?

    1. Can a servlet have a constructor ? - my answer is yes.It must have a public default (no-args) constructor, provided either by you or the compiler. No other constructor will be used, so there's no point in writing any constructor as the compiler will do it for you.
    2. is it mandatory that i should override the doGet() and doPost() methods ?This question is answered in the [Servlet API|http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/index.html].
    Can I have a servlet(user defined servlet) without doGet() and doPost() methods ?This question is answered in the [Servlet API|http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/index.html].
    3 Suppose I have a userdefined servlet that extends HttpServlet what are the methods that I mandatorily need to override in my user defined servlet ?This question is answered in the [Servlet API|http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/index.html].
    I saw this method only in ServletConfig interface.Which is implemented by GenericServlet, which is the base class for all servlets.
    // whats this here, i mean on which object does the method get invoked ?'this' is what it always is. The current object.

  • Doubt regarding SHDB transaction

    Hi All,   
                I have a doubt regarding the Process Tab in the application tool bar of SHDB transaction. What is the use of the following check boxes?
    1)       Default Size
    2)       Cont.after commit
    3)      not a batch input session
    4)      END: Not a Batch Input session
    5)      Simulate Background mode

    Hi,
    Basically these are the properties for CALL TRANSACTION using. You need not worry about these unless you really need those.
    1) Default Size: it will set the Default screen size for CALL TRANSACTION USING...
    2) Cont.after commit : it will set indicator that CALL TRANSACTION USING... is not completed by COMMIT. after commit also the process will continue
    3) not a batch input session: sets indicator that present session is not batch input
    4) END: Not a Batch Input session
    5) Simulate Background mode : session will be run in foreground. but similar to back grpund
    you can see the documentation by placing the cursor on these and click f1.

  • I was looking at the "Find my iPhone" app and I have a doubt regarding how it works for the macbook. In order to detect the location, the macbook should remain signed into iCloud. What if the thief logs out of iCloud. Would we able to locate the macbook?

    I was looking at the "Find my iPhone" app and I have a doubt regarding how it works for the macbook. In order to detect the location, the macbook should remain signed into iCloud. What if the person who has stolen my macbook logs out of iCloud.
    It should work fine for iPhone/iPad because we can enable "Restrictions" to prevent the user from signing out of iCloud. Do we have simialr settings for the macbook?
    Thanks,

    If it's not on the device list, it indicates that someone has gone to Find My iPhone on icloud.com and manually deleted it from the device list (as explained here: http://help.apple.com/icloud/#mmfc0eeddd), and it has not gone back online since (which would cause it to reappear on the device list; Find My iPhone has been turned of in settings on the device; the iClolud account has been deleted from the device; or the entire devices has been erased and restored.
    Unfortunately, there's no other way to track the phone other than through Find My iPhone.  You could call your carrier and see if they would blackliste it so at least the theif couldn't use it.

  • Very urgent: Doubts regarding CRM WORKFLOW OF BUSINESS PARTNER CREATION

    HI ,
    I HAVE DOUBTS REGARDING CRM WORKFLOW OF BUSINESS PARTNER CREATION, WHILE I AM CREATING BUSINESS PARTNER THROUGH R/3 , IT REFLECT IT INTO MYSAP CRM ALSO, AT THAT TIME IT SENDING THE MAIL TWICE TO THE RECEIPIENT. IS THERE ANY WAY THROUGH  WHICH I CAN RESTRICT IT TO SEND THE MAIL ONLY ONCE,
    PLZ SEND ME THE REPLY AS SOON AS POSSIBLE,
    THANKS  ADVANCED,

    HI
    WORKFLOW SEETING. SAP MAIL
    MULTIPLE MAILS AND
    ONLY ONCE CHOOSE
    ONLY ONCE OPTION ON WHICH VERSION U R WORKING?
    REWARD IF HELPFUL
    VENKAT

  • Doubt regarding  ALE SETTINGS in IDOC scenario.

    Hi Friends,
            I have some doubts regarding ALE settings for IDOC scenarios,  can anyone  please clarify my doubts.
    For exmaple take IDOC to FILE scenario
    The knowledge i got from SDN is --
    One need to do at the  R3 side is  --- RFC DESTINATION (SM59)  for the XI system.
                                                       --- TRFC PORT  for sending IDOC  to the  XI system
                                                       --- CREATING LOGICAL SYSTEM
                                                       --- CREATING PARTNER PROFILE 
                   at the XI side is  --- RFC  Destination ( For SAP sender system)
                                           --- CREATING  PORT  for receiving IDOC from the SAP sending system(IDX1).
    1. Do we create two logical systems for both Sender ( R3 system ) and Receiver( XI system ) in R3 system itself or in XI system or in both systems we create these logical systems? Is this a mandatory step in doing ALE configurations?
    In IDOC to IDOC scenario-------
      2.  Do we craete two RFC destinations in XI system? One RFC DESTINATION for the Sender R3 system and another RFC DESTINATION for the Receiver R3 System? and do we create RFC DESTINATION for the XI system in receiver R3 system? If not.....y we don't create like this........Please give me some clarity on this.............
      3.  If we use IDOC adapter ,since IDOC adapter resides on the ABAP STACK ,we don't need sender communication channel ,for the similar reason----
    y we r creating receiver communication channel in the case of FILE to IDOC scenario?
      4. Can any one please provide me the ALE settings for IDOC to FILE scenario,
                                                                                    FILE to IDOC scenario,                                                                               
    IDOC to IDOC scenario individually.
    Thanks in advance.
    Regards,
    Ramana.

    hi,
    1. Yes, we create two logical systems for both Sender ( R3 system ) and Receiver( XI system ) in R3 system itself and
    it is a mandatory step in doing ALE configurations
    2. We create 1 RFC destination each in R3 and XI.
        R3 RFC destination points to Xi and
        XI RFC destination  points to R3
    3 We need to create Communication Channel for Idoc receiver as the receiver channel is always required but sender may not be necessary
    4. ALE settings for all IDOC scenarios are same  as follows....
    Steps for ALE settings:-
    Steps for XI
    Step 1)
         Goto SM59.
         Create new RFC destination of type 3(Abap connection).
         Give a suitable name and description.
         Give the Ip address of the R3 system.
         Give the system number.
         Give the gateway host name and gateway service (3300 + system number).
         Go to the logon security tab.
         Give the lang, client, username and password.
         Test connection and remote logon.
    Step 2)
         Goto IDX1.
         Create a new port.
         Give the port name.
         Give the client number for the R3 system.
         Select the created Rfc Destination.
    Step 3)
         Goto IDX2
         Create a new Meta data.
         Give the Idoc type.
         Select the created port.
    Steps for R3.
    Step 1)
         Goto SM59.
         Create new RFC destination of type 3(Abap connection).
         Give a suitable name and description.
         Give the Ip address of the XI system.
         Give the system number.
         Give the gateway host name and gateway service (3300 + system number).
         Go to the logon security tab.
         Give the lang, client, username and password.
         Test connection and remote logon.
    Step 2)
         Goto WE21.
         Create a port under transactional RFC.(R3->XI)
         Designate the RFC destination created in prev step.
    Step 3)
         Goto SALE.
         Basic settings->Logical Systems->Define logical system.
         Create two logical systems(one for XI and the other for R3)
         Basic settings->Logical Systems->Assign logical system.
         Assign the R3 logical system to respective client.
    Step 4)
         Goto WE20.
         Partner type LS.
         Create two partner profile(one for XI the other for R3).
         Give the outbound or inbound message type based on the direction.
    Step 5)
         Goto WE19
         Give the basic type and execute.
         fill in the required fields.
         Goto IDOC->edit control records.
         Give the following values.(Receiver port,partner no.,part type and sender Partner no. and type)
         Click outbound processing.
    Step 6)
         Go to SM58
         if there are any messages then there is some error in execution.
         Goto WE02.
         Check the status of the IDOC.
         Goto WE47.
         TO decode the status code.
    Step 7)
         Not mandatory.
         Goto BD64.
         Click on Create model view.
         Add message type.
    BD87 to check the status of IDOC.
    In case if not authorized then go to the target system and check in SU53, see for the missing object
    and assign it to the user.
    SAP r3
    sm59(status check)(no message)
    WE02(status check)
    WE05(status check)
    BD87(status check)
    Xi
    IDx5(Idoc check)
    SU53(authorization check)
    Reward points if helpful
    Prashant

  • Doubt Regarding validation of IDOCS

    Hi Gurus,
               I have some doubts regarding IDOCS.
    1. If we are sending a IDOC from XI to R/3, where does we do validations from R/3 side and how do we do that.  Suppose if we are sending a Purchase order IDOC form XI to R/3, how to do validations for that particular IDOC for PO number and some other fields  from R/3 side.
    2. Do we need to do validations in a aABAP Program.
    please clarify me these Questions. Thanks in advance..
    santosh.

    Hi Santhosh,
    If you want to do any validations in ur IDOC,then from XI just push the IDOC,dont post it.
    (ie)Send the IDOC from XI in status 64 :IDoc ready to be transferred to application.
    Once R/3 Received this status then thru your ABAP progream just get this IDOC no: and do the validations then Post the IDOC manually.
    Thanks.
    Note:Reward Points if you find useful.

  • Doubts regarding XML Form Builder

    Hi All,
          I am having some doubts regarding XML Forms (Projects) that is created using XML Form Builder. Where are exactly these projects stored. Can I edit these projects and add my own Java Functionality in these. And also the data which I fill using these project where is it stored. Suppose New Project I ve created using XML Form Builder, now I want to feed in the news. Where exactly are these news stored.
    Thanks in Advance
    Anish

    Hi Anish
    You can make the standard settings and modify the XML forms builder in line with your requirements in the options. You can set the standard paths for your project on the <b>Paths</b> tab page.
    To get a clear understanding, please go through this link.
    http://help.sap.com/saphelp_erp2004/helpdata/en/62/ca6f365a6df84e87ba085f9b5fb350/content.htm
    Hope that was helpful
    Warm Regards
    Priya

  • Have some doubt regarding the  weblog (Lookup's in XI made simpler)

    Hi All,
    I have created the same scenario as mentioned in Siva's weblog (Lookup's in XI made simpler).
    I having some doubts regarding the scenario, it will be great if you help me to resolve the same.
    I am having a file-file scenario where I need to do lookup in database(MS-Access)  through mapping.
    The standard file-file scenario is in place and in addition I have created a receiver jdbc channel . I  have also created the receiver agreement for the same in the cofiguration.
    While creating the receiver agreement you have to specify the interface name which includes the message type…I have specified the normal format which we specify while configuring the jdbc receiver adapter.
    In the message mapping I have created a advance user defined function as mentioned in your weblog which calls my receiver jdbc channel.
    I have also specified the select query to be executed in the mapping program.
    While testing I am getting the following error
    Cannot produce target element /ns0:Role_MT/URole. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    <b>Can you please suggest me what all I need to do in addition to the file-file scenario for this lookup scenario to work.</b>
    Thanks and Regards
    Rahul

    Hi,
    Following is my user defined function
    //write your code here
    String Query = "";
    Channel channel = null;
    DataBaseAccessor accessor = null;
    DataBaseResult resultSet = null;
    Query = "Select URole from  Lookup where UName = '  " + UName[0] + "  ' and UPassword = '  " + Pwd[0] +" '  ";
    try{
    channel = LookupService.getChannel("DB_service","JDBC_channel_receiver");
    accessor = LookupService.getDataBaseAccessor(channel);
    resultSet  = accessor.execute(Query);
    for(Iterator rows = resultSet.getRows();rows.hasNext();){
    Map rowMap = (Map)rows.next();
    result.addValue((String)rowMap.get("URole"));
    catch(Exception ex){
    result.addValue(ex.getMessage());
    finally{
    try{
    if (accessor!= null) accessor.close();
    catch(Exception ex){
    result.addValue(ex.getMessage());
    Thanks and Regards
    Rahul

Maybe you are looking for