Parameter list in SQL native queries

I need to migrate from Toplink 10 to EclipseLink.
In my "old" project, I have some SQL native queries like '...... where field in #pFieldValues'
#pFieldValues is an arraylist/vector.
It was working perfectly with TopLink 10, but now it fails with 'Oracle Error' 'Invalid column type'.
How can I achieve this now with EclipseLink?  (I don't want to use EJBQL queries (or JPQL queries).
Thanks

I made it work modifying SQL statement for Access database by passing parametres in where clause.
But it works only for single value , though I have checked Allow multiple values: true. but fails when passing more than one value,
Error message pops up " Failed to retrive data from database. The Microsoft Access database engine could not find the object tblHirarchy('ANSTG', 'MCIS')
How to resolve it?
SELECT tbl_CBP.forcast_in_MON, tbl_CBP.forcast_MON, tbl_CBP.forcast_QTR,
tbl_Hierarchy.Technology_Group, tbl_Hierarchy.[Business_ Unit],
tbl_Hierarchy.Product_Family, tbl_CBP.Units, tbl_CBP.Cost, tbl_CBP.REV,
tbl_Time.Sort_order
FROM (tbl_Hierarchy INNER JOIN tbl_CBP ON tbl_Hierarchy.Product_Family =
tbl_CBP.PF) INNER JOIN tbl_Time ON tbl_CBP.forcast_MON =
tbl_Time.Fiscal_Month
where tbl_Hierarchy.Technology_Group = {?TG}
ORDER BY [sort_order]
union all
SELECT [Forcast_In_MON] & ' Actuals' AS forcast_In, tbl_Time.Fiscal_Month,
tbl_Time.Fiscal_Quarter, tbl_Hierarchy.Technology_Group, tbl_Hierarchy.
[Business_ Unit], tbl_Hierarchy.Product_Family, tbl_Actuals.Units,
tbl_Actuals.Cost, tbl_Actuals.REV, tbl_Time.Sort_order
FROM (tbl_Actuals INNER JOIN tbl_Hierarchy ON tbl_Actuals.PF =
tbl_Hierarchy.Product_Family) INNER JOIN tbl_Time ON tbl_Actuals.Actuals_MON
= tbl_Time.Forcast_In_MON
where tbl_Hierarchy.Technology_Group = {?TG}
ORDER BY [sort_order];
your HELP is highly appreciated.

Similar Messages

  • Dynamic SQL Command Queries Using Parameters

    Post Author: tdoman
    CA Forum: Data Connectivity and SQL
    I'm using Crystal Reports 11 and am trying to dynamically build part of the "Where" clause in the SQL command query to filter data on the server before the results are sent to the client. I'm doing this to decrease the load time of my reports by not having to send a large set of data to the client, then filter the results on the client side.
    I want to create a parameter list that is dynamically generated from a table in a database and allows you to select mutiple values from that list. For example: I have two tables. One employee table and one employee type table. The employee table lists all employees and their related employee types (full-time, part-time, and contractor). The employee type table lists the employee types that will dynamically be loaded into the parameters list.
    Employee Table
    ID    Name       TypeID
    1     Bob          2
    2     Steve        1
    3     John         3
    4     Bill            1
    Employee Type Table
    ID   Type
    1     Full-Time
    2     Part-Time
    3     Contractor
    Assuming the user selects u2018Full-Timeu2019 and u2018Contractoru2019 from the parameter list, the SQL command query I want to generate is as follows:
    SELECT *
    FROM emp, emp_type
    WHERE emp.ID = emp_type.ID and emp.TypeID in (u20181u2019, u20183u2019)
    I tried building the following SQL command query so it would dynamically replace {?EmpType} with the IDu2019s of the types the user selected but it doesnu2019t work. Any ideas how to fix this?
    SELECT *
    FROM emp, emp_type
    WHERE emp.ID = emp_type.ID and emp.TypeID in ({?EmpType})

    Post Author: tdoman
    CA Forum: Data Connectivity and SQL
    btw...I just realized I had a typo in my "where" clause of the previous example. It should have been like so:WHERE emp.TypeID = emp_type.ID and emp.TypeID in (u20181u2019, u20183u2019)  satish_nair31:
    Instead of passing the filter condition as parameter it would be fine if you pass it by ReportViewer.SelectionFormula Property.
    The selection formula property of report viewer control will dynamically append the where condition with the SQL value. You will pass the filter condition as per the syntax of language supported by crystal reports.I believe using the ReportViewer.SelectionFormula property you are referring to is only available if I'm loading the report through a VB application. If this is true, then this option will not work for me because I'm loading the report in a browser from the Crystal Report web server and currently don't have a VB application that can load the report. If I did, then I could dynamically build the SQL string using VB then pass it to the Crystal Report on the fly.But I'm trying to figure out if it's possible to do it without loading the report using VB. Please correct me if I'm wrong on these assumptions.

  • 11g Upgrade - removal and new parameter list queries

    Hi All,
    We are planning to upgrade the 10.2.0.4 E Business suite (11.5.10.2. ) database to 11.2.0.1.
    We have few removal and new parameter list in 11g database based on the note 216205.1
    We will be having the compatible mode as 10.2.0 before and after the upgrade until the system gets stable. So until we change the compatible to 11.2.0, do we need to have the parameters in the removal list or we can remove that even if we have the compatible as 10.2.0 during the upgrade.
    There are also two new parameters optimizerautostats_job=false and sec_case_sensitive_logon = FALSE.
    Please let us know if we can have these new /removal parameter changes when we have the compatible as 10.2.0 in 11g database.
    Thanks & Regards,
    Rakesh

    Rakesh,
    Please let us know if we can have these new /removal parameter changes when we have the compatible as 10.2.0 in 11g database.You can have those parameters, and you can remove it later once you are done with the upgrade.
    Note: 881505.1 - Oracle Applications Release 11i with Oracle 11g Release 2
    Adjust the Initialization Parameter File for the New Release
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10819/afterup.htm#CEGHAAFH
    Thanks,
    Hussein

  • Native Queries in Netweaver 7.1

    Hello Forum,
    how do i convince the EntityManager that a select statement used for a native query is actually a select statement?  I tried to issue an SQL statement starting with the keyword "select", containing a few parameters (i used a bare "?" to denote them, would this be correct?), a subselect, and some grouping operations, but upon calling getResultList(), the entity manager threw an Exception stating that the select statement was not a select statement.
    Regards,
    - Thomas

    Rolf Paulsen wrote:
    In native queries, according to the JPA spec, using positional parameters like :"?1", "?2",... is the only way to add parameters. Neither named parameters like ":foo" nor plain "?" are supported according to JPA 1.0 spec.
    See JSR 220: Enterprise JavaBeansTM,Version 3.0, Java Persistence API, section 3.6.3 "Named parameters":
    Only positional parameter binding may be portably used for native queries.
    I only have (really good) experience with EclipsesLink where defining parameters in native queries works fine with ?1, ?2 like in the JPA spec. If in  SAP JPA parameters in native queries must be defined in the query string using plain ?, it will not be compliant with the spec.
    SAP JPA passes the SQL string specified in a native query raw (unparsed) to the database. This means that SAP JPA does make any assumption with respect to the syntax required by the underlying database with respect to paramter markers. In standard SQL, a plain ? character is used as a parameter marker. Standard SQL does not understand ?1 nor :foo.
    The only binding mechanism for parameter values in native queries supported by SAP JPA is positional (as in alignment with the spec). Example
    Query query = em.createNativeQuery("SELECT LAST_NAME FROM EMPLOYEE WHERE FIRST_NAME = ?");
    query.setParameter(1, "Tim");
    Rolf Paulsen wrote:
    > And in SAP JPA NetWeaver 7.30, we do not get fully transparent lazy loading like in EclipseLink but a weaker form using cglib with EntitiyManager.getReference(): Whenever you need lazy loading, you have to hand-code it into your code.
    This is  a misundersanding. In 7.30, lazy loading of single-valued relationships is supported as an automatic mechanism. You do not need to programatically use getReference. However, as lazy loading of single-valued relationships has been introduced onyl with 7.30, you need enabled it explicitly in order to preserve a downward compatible behavior:
    http://help.sap.com/saphelp_nw73/helpdata/en/68/f676ef36094f4381467a308a98fd2a/frameset.htm
    -Adrian

  • CR 2008, all values in parameter list not showing up

    The parameter is not optional, the parameter value exists in the view on SQL server, but at report run-time, only get 5 pages of possible values to select from and user needs to go back farther to get the required report.
    I can get the report to run in full CR version by passing the value into the select expert, but users only get prompt window from the runtime version of CR.
    How can I get ALL the values of the field in the view to show up in parameter list?
    Thanks for any pointers.
    Robert

    Not sure if the help you metion is equivalnet to KB [1218588 - How to increase the number of values in a dynamic parameter list?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313338333533383338%7D.do], but have a look.
    Also, make sure you are on SP3:
    https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • CR 2008, missing parameter values in parameter list

    somehow this thread got posted in the  .NET SDK section, so re-posting here...
    When my users run the report, the list of values in the paramter list does not include all the possible values that exist in the view on SQL server.
    How can I get ALL the values of the field in the view to show up in parameter list?  What is controlling how many/few values show up?  I have not limited in any way what should be returned from the view (not a cascading set of parameters), and the view is not set up to limit what values are available either.
    Thanks for any pointers.
    Robert

    From a mis-post on the .NET forum, a solution was suggested that works....
    Re: CR 2008, all values in parameter list not showing up

  • Parameter not showing in Active parameter List.

    Dear Team,
    I have fresh Install SAP 4.7 with sql 200 on Windows 2000 server. After proper installation .I have activate the Profile.
    When I Edit the parameter  via RZ10 and then add new paramer
    i.e Login/no_automatic_user_sapsta    1
    Proper save .Then proper Restart the instance .but Its now showing in my Active parameter List.
    Whats the reasion.   Or what the step i am messing.
    Thanks & Regards
    Jagdish Kumar

    In which profile did you make the change (the program that lists active parameters only lists those for the instance that you are logged into).
    Here are some links on maintaining profiles:
    [Checking Active Parameters|http://help.sap.com/saphelp_nw70/helpdata/EN/c4/3a62e3505211d189550000e829fbbd/frameset.htm]
    [Maintaining Profiles|http://help.sap.com/saphelp_nw70/helpdata/EN/c4/3a62e3505211d189550000e829fbbd/frameset.htm]
    Hope that helps.
    Joe Haynes

  • Dynamic Parameter List questions: Length and Custom Values

    I've got a Crystal Report that I want to use Dynamic Values for.
    Right now... this report is simply a "SELECT stuff  FROM table" SQL query... with a parameter that the report uses to filter.
    I use a "Select DISTINCT value from table" to generate a list of values. I put those values into a txt. I then import the text into a static list. This creates a parameter list that is 11 "pages" long on the parameter screen. I also have "custom" values allowed. This is to allow for "new" values and also allow not needing to browse 11 pages for one or two known values.
    If I turn the parameter into a Dynamic List based on the same Select statement it stops at 5 pages, obviously cutting off half of the possible values.
    Dynamic List also removes the ability to do Custom Values. The filter option wouldn't be a bad alternative BUT it don't work for pages 6+ that aren't there.
    How can I remove the 5 page limit (or whatever it is) for Dynamic values?
    Thanks
    Chris
    Edited by: WernerCD on Aug 4, 2010 4:14 PM

    There is a limit of 1000 records in dynamic parameters. You can change this by adding a registry value:
    registry key : HKEY_CURRENT_USER\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports\DatabaseOptions\LOV
    and then add a key called MaxRowsetRecords and give it a value.
    if you have Crystal 2008 then the above registry folder will say Suite 12.0.

  • Most urgent:::: passing parameter list  to reports containing record groups

    hi
    can any one help me , i am getting frm-41214 when i pass a paramter list containing record group as data parameter to run_report_object as parameter, calling report from forms 10g, but when i dont pass the parameter list the report runs displaying no data(as it should do), otherwise it dont run and display the frm-41214
    zulfiqar

    Hi!
    To suppress Oracle Reports native Parameter Form just add:
    add_parameter( pl_id, 'pARAMform', text_parameter, 'NO' );
    Andrew Velichko
    Brainbench MVP for Oracle Developer 2000 http://www.brainbench.com
    null

  • When sharing iMovie11 project  with iDVD inmediately message 'the project could not be prepared for publishing because an error occurred (Error in user parameter list).  Finalize issue?

    When sharing my 60 minutes iMovie project with iDVD inmediately message 'The project could not be prepared for publishing because an error  occurred (Error in user parameter list)' appears. Could not find the user parameter list, so I've no more info about this error.
    Option File - Finalize Project gives inmediately the same errormessage.
    Also option Share - Media Browser - Large/Medium/Mobile give the same errormessage.
    Please advise, thank you!

    Additional info: trying to write to internal disk (268 GB Free out of 499 GB)
    Please advise, alko80

  • Reports 6.0 and Parameter Lists and Generate to File

    I am using the run_product built in from Forms 6.0 and opening
    up a report passing it several parameters via a parameter list.
    Everything works great when previewing the report.
    There is the option in the report preview under File -> Generate
    to File. When I generate a report to file using any type of
    format it appears that the report does not use the parameters
    that I passed in originally from the form. It appears that it
    looses all the parameters I passed in. This is most concerning
    to me. Am I doing something wrong or is this a "feature" I
    didn't know about? I really would like users to have this
    ability.
    null

    Yes I guess this will work, but the option to generate to file
    is extremely misleading if you ask me. This option should
    generate the current report with the current parameters. This
    is unacceptable as far as I am concerned and should be
    considered a bug. Oracle needs to give us more control over
    FORMS and REPORTS into all too many situations I have been
    frustrated because I am not able to do something that I want to
    do.
    I feel in general REPORTS object is very limited compared to
    crystal reports....
    Dan Paulsen (guest) wrote:
    : Give the user the option on the calling form whether to save
    the
    : report to file or just view it. If they want to save to file,
    : pass the parameter to save to file when you call the report
    and
    : suppress the parameter form, this will eliminate the problem.
    : Spencer Tabbert (guest) wrote:
    : : I am using the run_product built in from Forms 6.0 and
    opening
    : : up a report passing it several parameters via a parameter
    : list.
    : : Everything works great when previewing the report.
    : : There is the option in the report preview under File ->
    : Generate
    : : to File. When I generate a report to file using any type of
    : : format it appears that the report does not use the
    parameters
    : : that I passed in originally from the form. It appears that
    it
    : : looses all the parameters I passed in. This is most
    : concerning
    : : to me. Am I doing something wrong or is this a "feature" I
    : : didn't know about? I really would like users to have this
    : : ability.
    null

  • How to get key name  from parameter list

    hi..
    i want string from parameter list.. i hv already created parameter list like
    ADD_PARAMETER (param_list_id, 'EMPID', TEXT_PARAMETER,'123');
    ADD_PARAMETER (param_list_id, 'EMPNM', TEXT_PARAMETER, 'ABC');
    ADD_PARAMETER (param_list_id, 'EMPADD', TEXT_PARAMETER, 'XXX');
    i got value like '123' ,'ABC', 'XXX' using
    eg. get_parameter_attr(param_list_id,'EMPID',aprmlist,avalue)
    but i want key name like 'EMPID' , 'EMPNM', 'EMPADD' from param_list_id
    is it possible to get this key name from parameter list ???
    Thanks...

    I cannot think of a way to do that. The code that reads the list is supposed to know the key names. That is sort of the point with parameter lists. If you need to have parameter lists that can be interepreted by some code that doesn't know about a specific list but knows how to interpret it by inspecting the key names, perhaps you can specify a separate parameter list with the key names as values and call the keys of that list something generic?

  • How and where should I create a parameter list

    Hi, I4m trying to create a parameter lists but I don4t know where and how.
    I guess as a program unit but as function or procedure, sorry I4m new on this for that I4m finding this a bit difficult. Please, someone could help me to understand this:
    PROCEDURE Run_Emp_Report IS
    pl_id ParamList;
    BEGIN
    ** Check to see if the 'tmpdata' parameter list exists.
    pl_id := Get_Parameter_List('tmpdata');
    ** If it does, then delete it.
    IF NOT Id_Null(pl_id) THEN
    Destroy_Parameter_List( pl_id );
    END IF;
    ** Create the 'tmpdata' parameter list afresh.
    pl_id := Create_Parameter_List('tmpdata');
    ** Add a data parameter to this parameter list that will
    ** establish the relationship between the named query
    ** 'EMP_QUERY' in the report, and the record group named
    ** 'EMP_RECS' in the form.
    Add_Parameter(pl_id,'EMP_QUERY',DATA_PARAMETER,'EMP_RECS');
    **Pass a Parameter into PARAMFORM so that a parameter dialog
    will not appear
    **for the parameters being passing in.
    Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
    ** Run the report synchronously, passing the parameter list
    Run_Product(REPORTS, 'empreport', SYNCHRONOUS, RUNTIME,
    FILESYSTEM, pl_id, NULL);
    END;

    Hi,
    What you've pasted the code here is absolutely correct.
    You'll have to write the code in Forms builder.
    You can either paste the same code in a procedure & call that procedure
    from button's When-Button-Pressed trigger or paste the code in
    your button's When-Button-Pressed trigger like this :
    DECLARE
    pl_id ParamList;
    BEGIN
    ** Check to see if the 'tmpdata' parameter list exists.
    pl_id := Get_Parameter_List('tmpdata');
    Run_Product(REPORTS, 'empreport', SYNCHRONOUS, RUNTIME,
    FILESYSTEM, pl_id, NULL);
    END;
    However, don't write the code in a function as you will need to return some value from the function.
    Thanks,
    Mayur Shah
    [email protected]

  • How do I Pass a parameter to a SQL Component Task where the source SQL statement is also a variable

    Hi,
    I have been tasked with making a complex package more generic.
    To achieve this I need to pass a parameter to a SQL Component Task where the source SQL statement is also a variable.
    So to help articulate my question further I have create a package and database as follows; -
    USE [KWPlay]
    GO
    /****** Object: Table [dbo].[tblTest] Script Date: 05/14/2014 17:08:02 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[tblTest](
    [ID] [bigint] IDENTITY(1,1) NOT NULL,
    [Description] [nvarchar](50) NULL,
    CONSTRAINT [PK_tblTest] PRIMARY KEY CLUSTERED
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    I populated this table with a single record.
    I unit tested the SQL within SSMS as follows;
    SELECT * FROM dbo.tblTest
    Result; -
    ID           
    Description
    1             
    Happy
    DECLARE @myParam NVARCHAR(100)
    SET @myParam = 'Sad'
    UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
    SELECT * FROM dbo.tblTest
    Result; -
    ID   
    Description
    1    
    Sad
    Within the package I created two variables as follows; -
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
    Name: strStatus
    Scope: Package
    Data Type: String
    Value: Happy
    I then created a single ‘Execute SQL Task’ component within the control flow as follows; -
    However when I run the above package I get the following error; -
    SSIS package "Package.dtsx" starting.
    Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = @myParam FR..." failed with the following error:
    "Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Task failed: Execute SQL Task
    Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. 
    The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the
    errors.
    SSIS package "Package.dtsx" finished: Failure.
    I also tried; - 
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
    However I received the error; - 
    SSIS package "Package.dtsx" starting.
    Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = ? FROM dbo...." failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with
    the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Task failed: Execute SQL Task
    Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches
    the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
    SSIS package "Package.dtsx" finished: Failure.
    Kind Regards,
    Kieran.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Tried; - 
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
    and; - 
    Result; - 
    SSIS package "Package.dtsx" starting.
    SSIS package "Package.dtsx" finished: Success.
    Therefore the answer was to put the parameter number rather than the parameter name under the parameter mapping tab-> parameter name column. 
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

  • Passing a parameter list from a web form to a report

    I am using FORMS6 and REPORTS6, with OAS 4.07 on NT4 (SP3).
    In client server mode all works well - i am able to pass parameter lists from my calling form to the relevant reports and view them (using RUN_PRODUCT).
    However, when i try and do the same by deploying the web Form I come up against several obstacles.
    1. How do you pass a parameter list over without using "Paramform=Yes" - a waste of time seeing a html version of the reports parameter form when all the necessary parameters have been selected in the form.
    2. if i use web.show_document, with paramform=no, the report runs but with it's default settings.
    Any light you can shed would be greatly appreciated.

    Hi Tony ,
    Launcher form is just a simple form(Non database form) which will be having all fields that is required for the report and button to run the report .
    When button pressed trigger
    Pass all the parameters which are required using Run_product tool & Call the report by Web.Show_document
    Best way to see the report is in .pdf format in adobe acrobat reader
    I hope it will help you
    Bye
    Rao guduru

Maybe you are looking for