How to dynamically query from an LOV CO?

Hi,
I have a page and AM
I also have an LOVVO linked to LOVAM.
The LOV Vo is query based and contains a whereclause like user_id = :1
I have created a LovRN and LovCO based on the RN
I want to filter LOV values based on logged in user ID during PR
How to dynamicaly invoke the execute query from Lov CO PR() ?
I have written a method in LOV AM and when I try to invoke it from Lov CO, i get an error 'Method does not exist'. Should I write the method in Room AM?
In case I write the method in Root AM (linked to OA pages), how can I access the LOV VO as it is assigned to LOv AM only.
Thanks,
Kamath

Hi
write this code in CO
OAApplicationModuleImpl am =
(OAApplicationModuleImpl) pageContext.getApplicationModule(webBean);
System.out.println("Inside CO");
am.invokeMethod("initEmpVO");
write this code in AM
public void initEmpVO()
VacancyVOImpl vo = getVacancyVO();
System.out.println("Inside initEmpVO");
if(vo == null)
MessageToken errTokens[] = {
new MessageToken("OBJECT_NAME", "VacancyVO")
throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
} else
vo.executeQuery();
System.out.println("Execute Query");
Thanks
Nilesh

Similar Messages

  • Dynamic query from Infopath

    Greetings.  My ultimate goal is to be able to type in an account number in a browser enabled InfoPath form textbox and have it retrieve information about that account (customer's name, address, etc.).  I've set up an External content type
    to a SQL table with 100,000+ rows and created the external list to hold the data (after disabling the throttling limits).  I set a filter when creating the ECT and can't filter the data any more for my purposes.  I increased the data
    connection timeouts and response sizes in InfoPath just to see how long it would take to retrieve this data in InfoPath so that I could use a form to interface and query the data.  The performance of the form is unacceptable to me as it took nearly 7
    minutes to load.  So, my question: are there alternatives to custom code that will work for my situation?  Can I somehow dynamically set the content type filter through an InfoPath field so that I need not query all 100,000 records?  I
    know I can dynamically adjust a querystring directly to SQL through C# or VB but I'm trying to avoid that because I want to publish my form as a site content type (as opposed to an administrator approved form template). 
    Thanks in advance.
    Andy
     

    Hi,
    According to your post, my understanding is that you wanted to dynamic query from Infopath.
    I recommend to add code to the "click" event of a button to modify a SQL Server secondary data connection to use a "filter" from your form.
    Here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/en-US/5aa4519c-b8e0-4a7c-85b4-09f7e1d0747a/dynamic-sql-data-connection-in-infopath?forum=sharepointcustomizationprevious
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to dynamically query oracle from SAPGUI

    hi all,
    there are so many facilities available in SAPGUI to query the database for checking it status etc etc. but these queries i guess are based on the last database check done using db13. if it is true can any body tell me how can i dynamically query the database as and when required. eg to check the status of the datafile etc. 
    if i check the "space statistics" in db02 is is based on the db13 database check. "refresh" is not feasible as it takes much longer time and puts load on produciton system.
    regards
    Aijaz

    You could do a cost analysis on a SQL Statement to get to a screen where you can put in a straight SQL Statement (I think ST04 can get you there somehow, I don't know, I've move from Basis to BI, so I can't check to confirm if that's the right transaction).  But I don't know if it will allow you access to non-schema owned tables such as dba_data_files.
    Your best bet would be to have your Oracle DBA or OS or Basis group write a simple SQL query that is triggered at the OS level via sqlplus and maybe tie it to a command you could run ad-hoc via immediate job execution.

  • XSQL File - Dynamic query from standard Browser - XML response.

    Hi, this is my first post !
    I need to query an Oracle DB from the web browser and get the data in XML format.
    I've made some progress but they're still not enough.
    I wrote a FIXED query from JDeveloper XSQL File (here is my big lack of knowledge) and then I compiled it, and run it. Doing so, a tcp service listening to specific port was created. (I also have a program called lsnrctl running at server side). For example:
    http://IP:PORT/Application1-test1-context-root/query.xsql
    Ok, pointing that address from explorer, I happily have the result of my FIXED query in XML format:
    <?xml version="1.0" encoding="windows-1252"?>
    <ROWSET>
    <ROW NUM = '1'>
    <field_1>value_1</field_1>
    <field_2>value_2</field_2>
    <field_3>value_3</field_3>
    <field_4>value_4</field_4>
    </ROW>
    <ROW NUM = '2'>
    <field_1>value_A</field_1>
    <field_2>value_B</field_2>
    <field_3>value_C</field_3>
    <field_4>value_D</field_4>
    </ROW>
    </ROWSET>
    BUT I need to pass the query as a DYNAMIC parameter. Something like:
    http:IP:PORT/...?SQL="SELECT * FROM MY_TABLE WHERE my_condition ORDER BY my_column" from the browser.
    Please, I will appreciate any suggestion, to put me in the right way!!
    I am struggling to find out the solution since last two weeks!
    Thank you in advance !
    JM

    Ok,what I needed was this xsql file:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <page xmlns:xsql="urn:oracle-xsql" connection="jdbc/user_xsql_1DS">
    <xsql:query max-rows="-1" null-indicator="no" tag-case="lower">
    {@sql}
    </xsql:query>
    </page>
    So, from the web browser i can pass ?sql=MY_GENERIC_QUERY. And it works just as I expect.
    BUT. I tried this running Embedded OC4J Server (from the IDE). The last step I need is to achive the same result but from a generic web server like Apache.
    If I copy the .xsql file to ../htdocs/ the root apache directory for documents, and I ask for http://localhost/query.xsql what I get is the QUERY but not the RESPONSE. I don't get the values from the selected table, what I get again is:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <page xmlns:xsql="urn:oracle-xsql" connection="jdbc/user_xsql_1DS">
    <xsql:query max-rows="-1" null-indicator="no" tag-case="lower">
    {@sql}
    </xsql:query>
    </page>
    Can anybody guide me to configure Apache in order to get the resulting XML, not my query!!
    Thank you in advance!
    Juan Manuel

  • How to unassign query from a role

    Hi All,
    I have wrongly published a query in a role through query designer 2 times. Can you pls suggest how to unassign the query from that role, Your quick response will be appreciated.
    Thanks in advance,
    Sananda

    Use Tcode PFCG and there you can delete th query from the role. Then the query gets deleted only from that role view. Then you can assign it to the new role.

  • How to get query from a record group

    HI
    do we get the query from which record groupis based on in oracle forms with out checking in to the properties.

    Hello,
    No, you cannot get the initial SELECT order from the Record Group.
    Francois

  • How I create query from infoset ???

    Case 1 : I cannot create query from infoset
    Case 2 : I cannot create query from multiprovider that is created from infoset
    When I create multiprovider from infoset , I open query designer from this multiprovider... I received error message from query designer as below...
    File name : bextrace_qd_25510925_0556.txt
    Application error:
    17:56:02.171: Info: Query Designer Start. Revision: 601
    QueryDesigner.UserSettings.LoadSettings: Could not find file 'BExQueryDesigner.xml'.
    17:56:11.15: DEBUG ASSERT ### False - QDbCommandManager::.ctor - Method not called from CommandManager
    -CALLING-FROM- 17:56:11.15: DEBUG ASSERT ### False - QDbCommandManager::.ctor - Method not called from CommandManager ---
       at com.sap.bi.et.common.appl.Log.Debug.WriteTraceToFile(Level lLevel, String lString, Exception ex)
       at com.sap.bi.et.common.appl.Log.Debug.Assert(Boolean iExpectedCondition, String iAdditionalInformation, String iDetailedMessage)
       at com.sap.bi.et.QueryDesigner.QDfForm.InitFromCommandManager(QDbCommandManager iCommandManager)
       at com.sap.bi.et.QueryDesigner.QDbCommandManager..ctor(QDbApplicationData iApplicationData, QDfForm iWindow)
       at com.sap.bi.et.QueryDesigner.QDbApplicationData.Init()
       at com.sap.bi.et.QueryDesigner.QDbApplicationData.Run(Boolean iAsApplication)
       at com.sap.bi.et.QueryDesigner.QDbQueryDesigner.Run(Boolean iAsApplication)
       at com.sap.bi.et.QueryDesigner.QDStarter.QDStartup.Main()
    QDbApplicationData::ApplyUserSettings  - Standard View
    QDbCommandManager::DoViewCommand  - Table View
    QDbCommandManager::DoViewCommand  - Rows/Columns
    QDbCommandManager::DoViewCommand  - Cells
    QDbCommandManager::DoViewCommand  - Conditions
    QDbCommandManager::DoViewCommand  - Exceptions
    QDbCommandManager::DoViewCommand  - InfoProvider
    QDbCommandManager::DoViewCommand  - Filter
    QDbCommandManager::DoViewCommand  - Documents
    QDbCommandManager::DoViewCommand  - Where-Used List
    QDbCommandManager::CommandExecute  - Properties
    QDbCommandManager::DoViewCommand  - Properties
    QDbCommandManager::DoViewCommand  - Messages
    QDdEventDispatcher::MenuItemClickedHandler - Bar clicked: NewQuery
    QDbCommandManager::CommandExecute  - New...
    QDdEventDispatcher::MenuItemClickedHandler - Bar clicked: OpenQuery
    QDbCommandManager::CommandExecute  - Open...
    -EXCEPTION-START- 18:03:12.671: TRACE EXCEPTION  ---
    Exception Name: NullReferenceException
    Exception Message: Object reference not set to an instance of an object.
    Exception    at com.sap.bi.et.QueryDesigner.QDmCharacteristic.LoadValues()
       at com.sap.bi.et.QueryDesigner.QDbCharacteristic.GetValues(Boolean iReload)
       at com.sap.bi.et.QueryDesigner.QDmMetaBase.GetValues(Boolean iReload)
       at com.sap.bi.et.QueryDesigner.QDmCharacteristic.get_ValuesNonTechnical(QDeInfoObjectFilter iFilter)
       at com.sap.bi.et.QueryDesigner.QDpCharacteristicReference.ValueInitial()
       at com.sap.bi.et.QueryDesigner.QDpCharacteristicReference.set_pValue(Object value)
       at com.sap.bi.et.QueryDesigner.QDpString.set_Value(String Value)
       at com.sap.bi.et.QueryDesigner.QDbVariable.FromTable(RSZ_X_VAR isVar, QDcElement iElements)
       at com.sap.bi.et.QueryDesigner.QDbElement.FromTables(Hashtable iTables, QDcElement iElements)
       at com.sap.bi.et.QueryDesigner.QDbElement.CreateElements(Hashtable iTables, QDcElement iElements)
       at com.sap.bi.et.QueryDesigner.QDbElement.Load(QDeElementType iElementType, String iName, String iCompUid, String iGenUniId)
       at com.sap.bi.et.QueryDesigner.QDbQuery.Load(String iName, String iCompUid, String iGenUniId)
       at com.sap.bi.et.QueryDesigner.QDbApplicationData.LoadQuery()
       at com.sap.bi.et.QueryDesigner.QDbApplicationData.LoadFromServer()
       at com.sap.bi.et.QueryDesigner.QDbCommandOpenQuery.ExecuteCommand()
       at com.sap.bi.et.QueryDesigner.QDbCommandBase.Execute()
       at com.sap.bi.et.QueryDesigner.QDbCommandManager.CommandExecute(QDbCommandBase iCommand)
       at com.sap.bi.et.QueryDesigner.QDbCommandManager.InitialCommandExecute(QDbCommandBase iCommand)
       at com.sap.bi.et.QueryDesigner.QDbCommandManager.DoExecuteCommandInternal()
       at com.sap.bi.et.QueryDesigner.QDbCommandManager.ItemClickedHandler(Object sender, BarItemClickedEventArgs args)
       at com.sap.bi.et.QueryDesigner.QDdEventDispatcher.MenuItemClickedHandler(Object iSender, BarItemClickedEventArgs iE)
       at Syncfusion.Windows.Forms.Tools.XPMenus.BarManager.OnItemClicked(BarItemClickedEventArgs args)
       at Syncfusion.Windows.Forms.Tools.XPMenus.BarItem.OnItemClicked(EventArgs args)
       at com.sap.bi.et.QueryDesigner.QDiBarItem.OnItemClicked(EventArgs args)
       at Syncfusion.Windows.Forms.Tools.XPMenus.BarItem.PerformClick()
       at Syncfusion.Windows.Forms.Tools.XPMenus.BarRenderer.OnMouseUp(MouseEventArgs e)
       at Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnMouseUp(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    Full Stack:   at com.sap.bi.et.common.appl.Log.Debug.WriteTraceToFile(Level lLevel, String lString, Exception ex)
       at com.sap.bi.et.common.appl.Log.Trace.Exception(Exception ex, String iAdditionalInformation)
       at com.sap.bi.et.QueryDesigner.QDbApplicationData.OnGuiUnhandledException(Object iSender, ThreadExceptionEventArgs iEventArgs)
       at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
       at System.Windows.Forms.Control.WndProcException(Exception e)
       at System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at com.sap.bi.et.QueryDesigner.QDbApplicationData.Run(Boolean iAsApplication)
       at com.sap.bi.et.QueryDesigner.QDbQueryDesigner.Run(Boolean iAsApplication)
       at com.sap.bi.et.QueryDesigner.QDStarter.QDStartup.Main()
    -EXCEPTION-END----
    -CALLING-FROM- 18:03:12.671: TRACE EXCEPTION  ---
       at com.sap.bi.et.common.appl.Log.Debug.WriteTraceToFile(Level lLevel, String lString, Exception ex)
       at com.sap.bi.et.common.appl.Log.Trace.Exception(Exception ex, String iAdditionalInformation)
       at com.sap.bi.et.QueryDesigner.QDbApplicationData.OnGuiUnhandledException(Object iSender, ThreadExceptionEventArgs iEventArgs)
       at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
       at System.Windows.Forms.Control.WndProcException(Exception e)
       at System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at com.sap.bi.et.QueryDesigner.QDbApplicationData.Run(Boolean iAsApplication)
       at com.sap.bi.et.QueryDesigner.QDbQueryDesigner.Run(Boolean iAsApplication)
       at com.sap.bi.et.QueryDesigner.QDStarter.QDStartup.Main()
    Please kindly help me !!

    Hi,
    check the links to create  Infosets
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d6419190-0201-0010-0cb0-d7e4503c1231
    http://help.sap.com/saphelp_nw04s/helpdata/EN/ab/7a877cba29144b85d07f26f1f50cd8/content.htm
    Thanks.

  • How to get  query used in LOV

    Hi all,,,
    Assume that my lov is listing (eg empno, ename,dept) when i query for empno. Actually i want to change that empno to deptno ie(deptno,ename,dept) when i queried for empno. How to accomplish this. I think by form personalization we can do ie. BY creating own record group and replacing that with old one, we can do. But i want to know the query used in old record group. How to accomplish this task. plz help me.. Its urgent ... plz... Advance thanks. Any other approach most welcome.. Plz

    Hi all,,,
    Assume that my lov is listing (eg empno, ename,dept) when i query for empno. Actually i want to change that empno to deptno ie(deptno,ename,dept) when i queried for empno. How to accomplish this. I think by form personalization we can do ie. BY creating own record group and replacing that with old one, we can do. But i want to know the query used in old record group. How to accomplish this task. plz help me.. Its urgent ... plz... Advance thanks. Any other approach most welcome.. Plz

  • How to get Query from bw?

    I use BI XMLA Connector to connect BW System,I want to get QUERY.But I only get the DATA.I want to get the Query completely,
    include style,navigation,and so on.not a table.
    WHAT CAN I DO?

    HI,
    It is seemed rather odd that WEBI does not use the MASTER DATA search that is defined in the BEX query, the UNV based on.
    We are talking about objects that have less than 200 values in the MASTER DATA, usually it is an Authorization Object, that the User needs to select from it during runtime.
    We can also change the maximum value listed from MASTER DATA to be higher than 200.
    This is very poor performance to get the LOV after several minutes instead of few seconds.
    >> first of all the BI authorization you configure are not relevant for master data unless you are using authorization variables and BEx does a paging of the values - it does not retrieve all values. it does retrieve the values in chunks
    Using delegating search is not always possible when the user needs to select random values.
    Although delegate search improved getting the LOV from 5 minutes to 2 minutes (in our case), still waiting for 2 minutes,
    just to get the LOV is very long time for an enduser. (and now he has to wait for the WEBI query to be executed).
    >> using delegated search is possible. and delegated search means you are not retrieving a list of values at all so the 2 min that you mentioned indicates you didn't configure it properly.
    Ingo

  • How to copy query from one cube to another ? OR atlest a KF strecture?

    Hello edperts,
    just wanted some tips on coping a query or KF strecture from one cube to other . i am trying to use TCODE RSZC, but bcoz some of the chars. are not present in the target cube i a m not able to copy it.
    But, looks like both the cube has save KFs, so i thought atlest let me copy KFS , so i just have to pull manually chars. but thats also not working..
    Is there any back door way to do it ? please help me, it might save lots of time.
    Appreciated.

    Hi,
    Check the below article, it might help you out.
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/204111a9-0fca-2d10-219c-be20e686cdb5?QuickLink=index&overridelayout=true]
    Regards,
    Durgesh.

  • How to programatically querying from a custom scope

    Hi All
    I am using below code in a visual wp to implement search functionality.
    SearchServiceApplicationProxy proxy
    = (SearchServiceApplicationProxy)SearchServiceApplicationProxy.GetProxy(SPServiceContext.GetContext(SPContext.Current.Site));
    KeywordQuery query
    = new KeywordQuery(proxy);
    query.ResultsProvider = Microsoft.Office.Server.Search.Query.SearchProvider.Default;
    query.QueryText = queryText;
    query.RowLimit = 100;
    Above code is showing data from default scope ie 'All Sites' but I want show data from custom scope 'MyCustomScope'. Is it possible to provide scope name in code
    Please help

    Hi Pramod,
    You can define your scope in  HiddenConstraints property of KeywordQuery class.
    keywordQuery.HiddenConstraints = "scope:\"XYZ\"";
    In your case
    query.HiddenConstratints = "scope:\"MyCustomScope\"";
    Also you can refer below link for more information,
    http://www.mstechblogs.com/paul/sharepoint-2010-keywordquery-and-the-hiddenconstraints-property
    Regards,
    Uday G

  • How to transport Query from one client to another

    There is a following query in XXX-010:
    Queries of user group: UTILITY
    Name: YWH_2
    Is it possible to transport the same to XXX-020?
    Could you please check and inform ASAP?
    Regards,
    M.R.Reddy

    Hi M.R.Reddy,
    please enter transaction SQ02, then at the menu Environment > Transports. This allows you to export/import infosets and/or queries and/or user groups between your systems. You can also do this "transport" just by downloading in your source system/client and uploading into the target one.
    I hope it helps. Best regards,
    Alvaro

  • Dynamic query table for report based on LOV selected

    Hi,
    Need some suggestion and guidance how to dynamically query table via lov for report .
    Scenario:
    Table, TABLE_LIST, has tablename (table in DB) and filter (for where clause) column. The TABLENAME_LOVE is derived from table TABLE_LIST.
    SELECT TABLENAME D, TABLENAME R FROM TABLE_LIST
    In Page 2,a page select list item,P2_TABLENAME to use TABLENAME_LOV
    All data in tables in the table_list have identical structure (columns, triggers, primary key, and so on).
    I want to have the report region query from the table based on selected LOV.
    Example,
    Tablename Filter
    TB1
    CD2 ACTIVE='Y'
    When select TB1, the report regin will query based on TB1.
    When select CD2, the report regin will query based on CD2 WHERE ACTIVE='Y'
    Question:
    How can I query based on &P2_TABLENAME. WHERE &P2_FILTER.
    Like
    select col1, col2 from &P2_TABLENAME WHERE &P2FILTER
    Greatly appreciate any suggestion and some guidance.
    Tigerwapa

    Hi,
    You should always post your Apex version, DB version and other information as suggested in the FAQ.
    And the moment you talk report you should state whether it is IR or Classic.
    As for your query, have you explored the Report type "SQL Query (PL/SQL function body returning SQL query)" ?
    That might be a good fit for what you are trying to achieve.
    Regards,

  • Duplicate records for Dynamic Query in WLS 7

    I am getting duplicate records back when I run a dynamic query. If I run the same
    query via a finder method, I get the correct results.
    Here's the query:
    SELECT DISTINCT OBJECT(a) FROM Company AS a, b IN a.userRole WHERE b.userId = ?1
    AND a.deptId IN ('1', '2', '3')
    Company EJB maps to LU_Company (look up table for company)
    Company to UserRole is a one-to-many relationship.
    The number of duplicates is equal to the number of records I have for the same company_id
    in User_Role table.
    The ids for the object I should get back are 1, 2, 3.
    Instead I get back 1, 1, 2, 2, 2, 2, 2, 3, 3, 3
    In the database, company_id 1 occurs twice in user_role table; company_id 2 occurs
    five times.
    Any ideas of why the dynamic query has this problem whereas the same query for a
    finder method works fine?
    Thanks for your help.

    Thanks Greg, that worked!
    "Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote:
    You can supply properties on the query request, perhaps there is a
    SQL_SELECT_DISTINCT property:
    Properties p = new Properties();
    p.setProperty("GROUP_NAME", "fieldgroup");
    p.setProperty("INCLUDE_UPDATES", "true");
    p.setProperty("SQL_SELECT_DISTINCT", "true");
    Collection people = myQuery.find(
    "SELECT OBJECT(o) FROM PersonCMPEJB o WHERE o.lastName = 'Smith'", p);
    -Greg
    Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
    www.amazon.com/exec/obidos/ASIN/1931822468 or www.titan-books.com
    "Mike" <[email protected]> wrote in message
    news:[email protected]...
    Matt,
    <sql-select-distinct> needs to be set in <weblogic-query> element. I amgenerating
    a dynamic query from within a local client. So I don't have a finderdefined for
    this method. (I don't want to define a finder for this method). How doyou suggest
    I can use this? Thanks again for your help.
    Matthew Shinn <[email protected]> wrote:
    Hi Mike,
    I just filed a bug report for this (CR079471). As a work around, you
    can
    use the
    setSQLSelectDistinct flag so the database will weed out the duplicates.
    The only thing to
    look out for when using this flag is that Oracle will not allow the use
    of 'SELECT DISTINCT'
    in conjunction with a 'FOR UPDATE' clause, thus,<sql-select-distinct>True
    CANNOT be used if
    any Bean in the calling chain has a method with <transaction-isolation>
    set to
    <isolation-level>TRANSACTION_READ_COMMITTED_FOR_UPDATE. Sorry for theinconvenience.
    - Matt
    Mike wrote:
    I am getting duplicate records back when I run a dynamic query. If
    I
    run
    the same
    query via a finder method, I get the correct results.
    Here's the query:
    SELECT DISTINCT OBJECT(a) FROM Company AS a, b IN a.userRole WHERE
    b.userId
    = ?1
    AND a.deptId IN ('1', '2', '3')
    Company EJB maps to LU_Company (look up table for company)
    Company to UserRole is a one-to-many relationship.
    The number of duplicates is equal to the number of records I have forthe same company_id
    in User_Role table.
    The ids for the object I should get back are 1, 2, 3.
    Instead I get back 1, 1, 2, 2, 2, 2, 2, 3, 3, 3
    In the database, company_id 1 occurs twice in user_role table;
    company_id
    2 occurs
    five times.
    Any ideas of why the dynamic query has this problem whereas the same
    query
    for a
    finder method works fine?
    Thanks for your help.

  • Finding minimum value in each row using dynamic query

    need to find the minimum and maximum value from each row using dynamic query
    [from curr] will be given as input
    Tuky

    DECLARE @t TABLE(a INT,b INT,c INT);
    INSERT @t VALUES(1,2,3),(9,8,7),(4,6,5);
    SELECT *
    ,      (   SELECT  MAX(val) 
               FROM    (VALUES (a)
                           ,   (b)
                           ,   (c)
                       ) AS value(val)
           ) AS MaxVal 
    ,      (   SELECT  MIN(val) 
               FROM    (VALUES (a)
                           ,   (b)
                           ,   (c)
                       ) AS value(val)
           ) AS MinVal 
    FROM @t;
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • Upgrading capabilities (software)

    I've just learned iMovie and iDVD and authored my first DVD. And I'm just pleased as punch; you are "looking" at one happy woman. Well, you know, suddenly you "need" things you never even thought about yesterday.... For example, I wanted to put audio

  • SQL from Table Column with Dynamic URL Problem

    This is the SQL I'm attempting to save to a table column via the Object Browser; select "a"."PBR_BRIEF_ID" "Brief ID", "a"."PROJECT_NUMBER" "Project", "b"."DESCRIPTION" "Description", "b"."ACTUAL_END_DATE" "Actual End", "b"."RFS_DATE" "RFS", "b"."LOC

  • Photo prints

    Hello, I just took my printer out of the box and set it up.  I printed three pictures and they all have lines running through them.  Is this a roller issue a paper issue or what?  I ams so frustrated and disappointed Thanks for any advice you can off

  • ANE Native extension freezes app when debug=false and using non-interpreted IOS build

    There's a problem with Adobe Air iOS that is somewhat known, and that problem has an unknown variant that's very tricky. The problem is with linking optimized flash and ANEs. If the linker treats the ANE as an included SWC, calls to the library will

  • Ipod cannot be synced and cannot be restored

    Please if someone knows what to do with these problems please help me. Bought the 30g 5th generation ipod, used to sync perfectly in the other computer, in the new computer however nothing but trouble. Please help!