Creating an LOV from function returning Varray

I have a select statement which runs in PLSQL and runs in the SQL Commands of SQL Workshop, but when I try to use the select statement as an LOV, I keep getting "LOV query invalid, a display and a return value are needed, the columns names need to be different. if your query contains an in-line query, the first FROM clause.....must not belong to the in-line query." My select statement is as follows:
select a.obj, a.ename from THE (select cast(getxmlnodes('filename.xml') as NodeTableType2 from dual) a;
The function getxmlnodes reads an xml file and returns the nodes from my xml file. It works fine from SQLPlus etc. but the LOV balks. Can anyone out there help? Thanks

For anyone who sees this. My select statement didn't work because I had put a
';' at the end of the statement. I accidentally left off the ; in one of my tests and the select statement worked like a charm. Everyone likes to have a person answer their own question.

Similar Messages

  • Select from function return rowtype @ db link

    Hi, I am trying to select a row from a function which return a row type @ another DB.
    First DB
    ==========
    Function: fn_something(params) return mytable@snddb%rowtype
    DB Link: snddb
    Second DB
    ==========
    Table: mytable (Column: mycol)
    I have tried to execute query
    select fn_something(params) from dual
    OR
    select mycol from table(fn_something(params))
    but I have got "invalid datatype" error.
    What would be the correct syntax for my query? Thanks.

    Hi Andy,
    Thanks for your reply.
    My function itself has no problem and has been using for a while.
    The function return a rowtype(a table row) and it is using in a stored procedure.
    It could be done in stored procedure but I would like to know if I could call it directly from a query.
    I have just read another thread
    Help - Oracle function w/RETURN VIEW_NAME%ROWTYPE
    which is quite similar to mine
    but I am trying to get a column value from the function and execute an insert statement.
    Could I do it without wrapped by begin end ?

  • Creating an LOV from month

    Hi all,
    I have a report that uses the select extract (month xxx) function to select the month number from a date field from another table.
    I wish to filter these months by using an LOV. How would I go about doing that?
    Thanks.
    Shahram

    Try to ask it into Forms<br>
    <br>
    Nicolas.

  • How to create webservice from function module

    Hello,
    I'm trying to create webservice from function module from. I choose Utilities/More Utilities/Create Webservice/..From function Module. What data should I enter in section "Enter Package/Request" ?
    When I check "Local object" checkbox I get a message "Test objects cannot be created in foreign namespaces"
    Is there any doc about this procedure (web service creation) with description of all sections ?
    thanks for any reply,
    Lukasz Ferenc

    Hi,
    Which SAP product of wich release of which SP are you using ?
    The procedure is documented in help.sap.com and in blogs and SDN forum messages.
    It means that the use of the SEARCH button should give plenty of answers...
    >When I check "Local object" checkbox I get a message "Test objects cannot be created in foreign >namespaces"
    As usual, begin your choosen name with an "Z".
    Regards,
    Olivier

  • Provide Asynchornous Webservice from Function Module

    Hi!
    I need to create a webservice to provide master data. My scenario do not use Process Integration, so I create the webservice from function module (Remote-Enable Module) through SE80.
    When service is created I can see in the configuration tag that is not possible to change to asynchronous mode.
    I want to create asynchronous webservice because I need to return master data. Selecting this data consume a lot of time, so in order to avoid timeouts I think is better to create asynchronous webservice.
    May be I am wrong but I think is not possible to create async webservice without PI.
    All documents I have read until now show async comunication through PI and using proxy clients but I have not found the case I am talking.
    Thanks
    Reagards
    Edited by: jordis on Mar 17, 2011 4:45 PM

    Thanks Raja,
    I think I'm confusing about synchronous / asynchronous concept in webservices. I need an example or an explanation where I can understand it. Taking account that I do not have PI, where scenario I'm moving in?
    I mean, is it possible that an external client calls my webservice created through FM in async mode? Maybe is the client who has to create the corresponding call to the webservice in async mode and I have to do anything.
    Another question related, what does it means the propierty sync/async in a proxy?
    I do not understand your sugestion since I think that proxy creaton is relevant in case of the connecting SAP with an external system (I tried it and I have to inform an URL o WSDL).
    All documents I have readed have been in the context of PI and I think my case is more simply.
    Any more suggestions, links or ideas?
    Thanks
    Regards
    Edited by: jordis on Mar 18, 2011 12:41 PM

  • Issue in creating dependent LOV

    Hi,
    I am creating a dependentLOV Items.
    1) Selecting Project Number.
    2) List of Tasks in the selected Projects.
    when ever user selects particular project number in 1st LOV item the list of tasks assossiated to that project should be
    populated in 2 nd LOV.
    Can any one suggest.
    Regards,
    Krishna

    Hi Reetesh,
    I am unable to create dependency.
    VO Querys of Projects and Tasks
    Projects VO
    select a.SEGMENT1,a.NAME,a.PROJECT_ID
    from pa_projects_all a
    TasksVO
    select a.TASK_NUMBER,a.TASK_NAME,a.PROJECT_ID
    from pa_tasks a
    I am explaing the steps I have done just show where I met error.
    1) Create ProjectsLOVRN (projectno,name,projectId) TasksLOVRN (TaskNumber,Name,ProjectId)
    2) Create 2 LOV Items Projects and Tasks
    3)In Projects LOV I created 2 LOV Maps which returns Project No and Project Id
    4)In Tasks LOV created 2 LOV Maps as you suggested
    in first map LOV Region Item TasksLOVRN(TaskNumber)
    Criteria Item returned ProjectId from ProjectsLOVRN
    Required and Programatic Query is set to true
    for crieteria item will be the Project LOv Item how can I select an ProjectsLOV Item in TasksLOV
    in second map
    LOV Region Item TasksLOVRN(TaskNumber)
    return Item LOV ItemTask
    While running page At header I am getting an error
    Error
    Developer Mode Exception : Lov Input should by default be the queryable criteria and Result.
    Please suggest where exactly Iam making mistake to create Dependent LOV
    Regards,
    Krishna

  • Creating a LOV by using a Command Object

    Hello All,
    I have a report that's driven by a parameterized sproc, which is a year parameter.  However, we have a table that I would like to use in my object command to populate this parameter with the values from the select statement to enforce consistency. A new year is inserted into to this table yearly by another process, which would keep me from having to go into a static list to update the year options yearly. 
    I've created the command object and saved it to the repository, but I can't figure out how to associate it to the report as the parameter.
    Can anyone point me in the right direction?
    Thanks in advance.

    hi DevinM,
    two choices:
    A) add the Command to your report
    1) you can add the Command to your report...don't link it to any tables though...you'll get a "Generally not supported error" but you can ignore it for this test
    2) now in your prompt you will have the Command available for the dynamic values
    3) check that the number of records on your report remains the same as before...it should...any test i have run on this is aok
    B) create a Business View
    1) go into the Business View Manager and create a business view from the data foundation up
    2) once you've got the business view built you can create an LOV from there which is available to your current report and all other reports
    jw

  • Identifying business content based on requirements from Functional Doc

    Hi everyone,
    I have a requirement to create technical documents from functional documents that I have received. The funct. docs describe the report to be created however, the fields that the user is looking for are basically in plain English (or atleast what the user sees in Peoplesoft). We are implementing SAP and everything is to be converted from Peoplesoft. The fields are as follows:
    Year, YTD, Month, Company Code, Cost Center, GL Account #, GL Account name, Report Date, Actual Amount, Budget Amount, Variance Amount.
    The functional doc I feel is incomplete since we dont have the source system table and field names in ECC that correspond to the users fields. Anyway, I think the idea at the moment is to create a first draft TD using Business Content. Can someone please tell me what area they think these fields are from? It looks like FI. Does anyone know of any Business Content objects that may contain the some of the users fields (chances of finding all in say one cube may not be high, am I right?). I am new to BI, so please spell everything out in simple terms and a step-by-step manner. I really appreciate the input of all the experts on this forum.
    Thanks. <removed by moderator>.
    Edited by: Siegfried Szameitat on Nov 25, 2008 3:44 PM

    yes MD you are on the right track
    But I would advise you to use the ASAP methodology and run blueprint workshops first before even approaching technical specs
    If you dont know how the R3 system is structured how can you build a tech spec?
    In the workshop there will be functional R3 guys as well as BW consultants and the clients
    The clients bring their high level requirements to the table and everybody dicusses it
    What you dont want to do is assume that std R3 objects are going to be in place
    With the exampel you have given - this may be the only place where budgets have been discussed - the FI guys havent catered for it - so how are you goign to deliver it
    I have given you the content areas in my last post I would expect the data to be in - I would suggest you go to the BI content area of help.sap.com and look for each of the areas I have given
    Unfortunately there is not enough space here and I dont have enough time to step you through it step by step - thats what Principal BW consultants and architects on your projects are for - talk to them.
    If you haven't got any - I suggest your project manager better go out quickly and hire some.
    I would strongly advise you to gointo solution manager or sdn and grab hold of the latest ASAP accelerators and ppts - they will help guide you through functional requirements gathering - btu to be quite honest you shoudln't be doing this yourself if you are new to BW
    (oh and every wondered why clients pay top dollar for good BW consultants - this is the reason why)

  • Function returning query takes more time to run in Apex4.0

    Hi All,
    I created a report using function returning query. The function returns query based the parameters which returns dynamic columns. When I run the query in sql developer the query generates and returns the result in 3mins. But in apex it takes maximum of 35mins to return.
    The query will return around 10000 rows.
    Is it a performance issue in the query or in Apex?can anyone please help
    Regards
    Raj

    RajEndiran wrote:
    Hi Roel,
    Thanks much for your suggestion. I run in TOAD and got the result as
    Row 1 of 500 fetched so far in 3.31 minutes which means it queried for 500 records alone ? is that not the actual time taken to run the fulll query?That reflects the time to return the first 500 records...
    Please suggest.With all the best will in the world, if I was your user and I had to wait 3 minutes for the page to refresh, I'd steadily lose the will to live!
    As this is primarily an SQL tuning question, have a look at this message in the FAQ thread in the {forum:id=75} forum:
    {message:id=9360003}
    That should give you some pointers on the right approach.

  • Urgent: Web Service from Function Module

    Hi guys, I am new to this area so please help to achieve following:
    I want to show a demo to load data from a web service to BI. I have performed the following steps and don’t know how to process further. Please help me in the sense where do I put the logic to show fields on the web service and ….
    1. I have created a web service data source in BI with four fields (Cal dat, material, amount and currency)
    2. This created a Web Service /RFC FM automatically.
    3. From this FM I created a web service (Utilities – create web service – from function module)
    4. I followed the web service creation wizard.
    Thanks,
    sam

    releasing and related steps are fine,
    what i want to know is, BW/BI datasource will create a FM, from this FM inturn I will create a webservice.
    Lets say BW/BI datasource has 4 fields account, company, amount & currency.
    I want to enter these 4 values from the webservice which will bring these values to BW delta queue and eventually get loaded in BW.
    For this process do I need to code anything in the FM or any other part of the system

  • Creating generic datasource using function module in R/3 4.6c

    Hi,
    I am not able to see the option (in TC RSO2) to create generic datasource using function module in R/3 4.6c. Is there any special plug in or some SAP Note to be applied to get the option ?
    Waiting for a quick response.
    Thanks and Regards,
    Deepak

    Hi Sat,
    Thanks for the reply.
    I know that creating generic datasource from function module is available in R/3 4.7.
    In 4.6c version there are only two options available. They are Extraction from DB View and Extraction from SAP Query.
    The third option i.e. Extraction from Function Module is not available in 4.6c. I wanted to know if there is any plugin that needs to be installed to get this option.
    Thanks and Regards,
    Deepak

  • Create LOV from OID entries

    I do not know how to build a LOV from the available list of user ids in Internet Directory. My intention is to use the Internet Directory as my "system of record" for Personnel and reference the User ID in records in the database. Is there a way to build a materialized view for this? or is there some other mechanism you can point me to?
    I am building a slew of data capture forms of which I would like to enter the userid of the logged in user. I know how to use wwctx_api.get_user_id however my user may want to override their name with someone else.
    Ergo, my need for an LOV.

    I had the same problem
    not sure about going to the tables direct, a little messy
    have a look a d the OID developers guide there is an example of querying the OID using DBMS_LDAP
    here is my fucntion to get the parameter that i need form OID it returns any array of records then you can process the array
    type user_profile_rec is record (
                                            first_name varchar2(100)
                                            ,last_name varchar2(100)
                                            ,cn           varchar2(100)
                                            ,dn          varchar2(200)
                                            ,displayname          varchar2(200)
                                            ,jpegPhoto     varchar2(10000)
                                            ,orclisvisible varchar2(10));
    type profile_array is table of user_profile_rec index by binary_integer;
    function user_profiles ( ldap_host VARCHAR2 default portal.wwsec_oid.GET_OID_HOST
                                  ,ldap_port VARCHAR2 default portal.wwsec_oid.GET_OID_PORT
                                  ,ldap_user VARCHAR2
                                  ,ldap_passwd VARCHAR2
                                  ,ldap_base VARCHAR2
                                  ,search_letter varchar2
                                  ) return profile_array
    as
    -- this function uses the dbms_ldap package to query the ldap repsoitory
    -- to get the user details.
    -- this will search the named source
              -- create ldap parameters
              retval PLS_INTEGER;
              my_session DBMS_LDAP.session;
              my_attrs DBMS_LDAP.string_collection;
              my_message DBMS_LDAP.message;
              my_entry DBMS_LDAP.message;
              entry_index PLS_INTEGER;
              my_dn VARCHAR2(256);
              my_attr_name VARCHAR2(256);
              my_ber_elmt DBMS_LDAP.ber_element;
              attr_index PLS_INTEGER;
              i PLS_INTEGER;
              my_vals DBMS_LDAP.STRING_COLLECTION ;
    --          ldap_host VARCHAR2(256);
    --          ldap_port VARCHAR2(256);
    --          ldap_user VARCHAR2(256);
    --          ldap_passwd VARCHAR2(256);
    --          ldap_base VARCHAR2(256);
              -- value to hold the return string from ldap
              val DBMS_LDAP.STRING_COLLECTION ;
         -- create the varray variables ( define find in the package spec      
              profile_rec user_profile_rec;
              profile_varray profile_array;
              begin
              retval := -1;
              /*ldap_host := 'uk-abi-sap01.uk.evotecoai.com' ;
              ldap_port := '4032';
              ldap_user := 'cn=orcladmin';
              ldap_passwd:= '1vindaloo';
              ldap_base := 'cn=users,dc=uk,dc=evotecoai,dc=com';
              -- Choosing exceptions to be raised by DBMS_LDAP library.
              DBMS_LDAP.USE_EXCEPTION := TRUE;
              my_session := DBMS_LDAP.init(ldap_host,ldap_port);
              -- bind to the directory
              retval := DBMS_LDAP.simple_bind_s(my_session,ldap_user, ldap_passwd);
              -- issue the search
              my_attrs(1) := 'sn'; -- retrieve all attributes
              my_attrs(2) := 'dn'; -- retrieve all attributes
              my_attrs(3) := 'cn'; -- retrieve all attributes
              my_attrs(4) := 'givenname'; -- retrieve all attributes
              my_attrs(5) := 'orclisvisible'; -- retrieve all attributes
              my_attrs(5) := 'displayname'; -- retrieve all attributes
              my_attrs(6) := 'jpegPhoto'; -- retrieve all attributes
              retval := DBMS_LDAP.search_s(my_session, ldap_base,DBMS_LDAP.SCOPE_SUBTREE,'sn='||UPPER(search_letter)||'*',my_attrs,0,my_message);
              -- count the number of entries returned
              retval := DBMS_LDAP.count_entries(my_session, my_message);
              -- get the first entry
              my_entry := DBMS_LDAP.first_entry(my_session, my_message);
              entry_index := 1;
              -- Loop through each of the entries one by one
              while my_entry IS NOT NULL loop
              -- print the current entry
                        -- return the dn for the current user row
                        my_dn := DBMS_LDAP.get_dn(my_session, my_entry);
                        profile_rec.dn := my_dn;
                        -- gets the arribs the check to make sure one is returned then assign to the array
                             val:= dbms_ldap.GET_VALUES( LD=>my_session, LDAPENTRY=>my_entry, ATTR=>'givenname' );
                        -- check if returned
                        if val.COUNT > 0 then
                        -- loop thought the values
                        FOR i in val.FIRST..val.LAST loop
                             -- set the value in the array
                             profile_rec.first_name := SUBSTR(val(i),1,200);
                        end loop;
                        end if;
                        -- get the sn
                        i:=1;
                        val:= dbms_ldap.GET_VALUES( LD=>my_session, LDAPENTRY=>my_entry, ATTR=>'sn' );
                        if val.COUNT > 0 then
                        FOR i in val.FIRST..val.LAST loop
                             profile_rec.last_name := SUBSTR(val(i),1,200);
                        end loop;
                        end if;
                        -- get cn
                        i:=1;
                        val:= dbms_ldap.GET_VALUES( LD=>my_session, LDAPENTRY=>my_entry, ATTR=>'cn' );
                        if val.COUNT > 0 then
                        FOR i in val.FIRST..val.LAST loop
                             profile_rec.cn := SUBSTR(val(i),1,200);
                        end loop;
                        end if;
                        -- get orclisvisible
                        i:=1;
                        val:= dbms_ldap.GET_VALUES( LD=>my_session, LDAPENTRY=>my_entry, ATTR=>'orclisvisible' );
                        if val.COUNT > 0 then
                        FOR i in val.FIRST..val.LAST loop
                                  profile_rec.orclisvisible := SUBSTR(val(i),1,200);
                        end loop;
                        end if;
                        -- get orclisvisible
                        i:=1;
                        val:= dbms_ldap.GET_VALUES( LD=>my_session, LDAPENTRY=>my_entry, ATTR=>'displayname' );
                        if val.COUNT > 0 then
                        FOR i in val.FIRST..val.LAST loop
                                  profile_rec.displayname := SUBSTR(val(i),1,200);
                        end loop;
                        end if;
                        -- get orclisvisible
                        i:=1;
                        val:= dbms_ldap.GET_VALUES( LD=>my_session, LDAPENTRY=>my_entry, ATTR=>'jpegPhoto' );
                        if val.COUNT > 0 then
                        FOR i in val.FIRST..val.LAST loop
                                  profile_rec.jpegPhoto := SUBSTR(val(i),1,200);
                        end loop;
                        end if;
              -- itterate thoguht the array
              -- set the values of the record to the array
              profile_varray(entry_index).cn := profile_rec.cn;
              profile_varray(entry_index).first_name := profile_rec.first_name;
              profile_varray(entry_index).last_name := profile_rec.last_name;
              profile_varray(entry_index).dn := profile_rec.dn;
              profile_varray(entry_index).displayname :=profile_rec.displayname;
              profile_varray(entry_index).orclisvisible :=profile_rec.orclisvisible;
              profile_varray(entry_index).jpegPhoto :=profile_rec.jpegPhoto;
              my_entry := DBMS_LDAP.next_entry(my_session, my_entry);
              entry_index := entry_index+1;
              end loop;
              -- unbind from the directory
              retval := DBMS_LDAP.unbind_s(my_session);
              -- return the arreay
              return profile_varray;
    end user_profiles;

  • How to create a LOV based on a stored procedure returning a cursor

    Hello,
    I've tried to search the forum, but did not find much. We are facing a problem of large LOVs and creating large TMP files on the app server. Our whole application is drived by store procedures. LOVs are built manually by fetching data from cursors returned from stored procedures. That creates the issue when whole LOV needs to be stored in the memory and thus the TMP files.
    Is there anyway how to create LOV based on a procedure returning cursor ?
    Thank you,
    Radovan

    Hello,
    As of now we populate the record group by looping through the ref cursor and adding rows into it. Is there a better way? That forces the whole record group to be stored in a memory on the app server.
    Thank you,
    Radovan

  • How to create and execute a function whose return value is  a table

    hi folks ,
    i would like know how to create and execute a function whose return value is a table ,
    am new to pl/sql ,
    my statement for the function is
    SELECT ct.credential_code, c.expiration_date
    FROM certifications c, credential_types ct
    WHERE ct.crdnt_id = c.crdnt_id
    AND c.person_id = person_id;
    i would like to have the result of the above query as return value for the function.
    Thanks in advance ,
    Ashok.c

    hi Ps ,
    Can you please do small sample ,
    that would help me in clear understanding
    thanks in advance
    ashok.c

  • Can't create multiple dependent LOVs from the same bind variable

    Hi all,
    I'm having difficulty creating multiple dependent LOVs from queries based on the same bind variable in my JSF application (JDev 10.1.3.1). Basically I have a static LOV in a af:selectOneChoice component from which users select a value which then becomes the bind variable value for two separate queries that generate two different dependent LOV. Having developed the code along the lines of Steve Muench 's blog (http://radio.weblogs.com/0118231/2006/04/03.html#a685), the first dependent LOV works really well. The first dynamic LOV gets refreshed whenever the list from the static LOV changes, and I can execute other queries based on the values selected.
    The problem arises when I want to create the second dynamic/dependent LOV that has the same bind variable based on the same selected value from the static LOV. Here I would also like the functionality whereby the second dynamic LOV is also refreshed after the selected value in the static LOV changes. Thinking that all I had to do was replicate the methodology used in creating the first dependent LOV, I created the second iterator, invokeAction and other binding components in the PageDef. The executable section now looks like the following:
    <iterator id="SelectStaticQueryViewObjIterator"
                  Binds="SelectStaticQueryViewObj" RangeSize="-1"
                  DataControl="DMSApplicationModule1DataControl"/>
    <invokeAction id="refreshDynamicQuery1BindParameter"
                  Binds="ExecuteWithParams1" Refresh="prepareModel"
                  RefreshCondition="#{empty requestScope.VariableChanged}"/>
    <iterator id="SelectDynamicQuery1ViewObjIterator"
                  Binds="SelectDynamicQuery1ViewObj" RangeSize="-1"
                  DataControl="DMSApplicationModule1DataControl"/>
    <invokeAction id="refreshDynamicQuery2BindParameter"
                  Binds="ExecuteWithParams2" Refresh="prepareModel"
                  RefreshCondition="#{empty requestScope.VariableChanged}"/>
    <iterator id="SelectDynamicQuery2ViewObjIterator"
                  Binds="SelectDynamicQuery2ViewObj" RangeSize="-1"
                  DataControl="DMSApplicationModule1DataControl"/>I now have a problem whereby everytime I change the value of the static LOV, multiple HTML components for the same ADF component are being generated (the LOVs are refreshed via PPR). The surprising thing is that this duplicating behaviour applies to all ADF components listed after the first dynamic LOV in the *.jspx source. For example, I have a <af:outputText="Test Text"/> component created after the first dynamic LOV. Each time the value in the static LOV changes, a duplicate HTML component is created. This also applies to the 'related' second dynamic LOV which is bound to a af:selectOneChoice component - multiple dropdown lists are created. I've checked with the browser's Page Source and there are actually multiple html components being generated with their own unique ADF-generated IDs. I've tried all different options for the Referesh and RefreshCondition attibutes in the second invokeAction element but nothing seems to eliminate this issue.
    Any suggestions about how I might create multiple dependent LOVs from the same bind variable that get refreshed when the selected value changes would be greatly appreciated.
    Thanks
    George

    Hi all,
    Just updating the thread on how I've overcome this issue. As it stood the manner in which I was trying to solve my use case, as described above, was creating an absolute mess. Then with a blank sheet of paper I quickly realised that a much simpler solution would be to create a whole series of master-detail VOs and build my components around them. Thankfully I haven't had any issues going down this path as yet.
    Cheers
    George

Maybe you are looking for