Parameter Binding Issue

I have an advanced function that that looks something like this:
function Audit-System
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)]
[Alias("Name")]
[string[]]$ComputerName
Process
foreach($computer in $ComputerName)
## Do stuff for every computer
Write-Verbose $computer
The followimg work ok:
"computer1","computer2" | Audit-System
Audit-System "computer1","computer2"
Audit-System "computer1"
The following doesn't work:
Get-ADComputer -Filter * SearchBase "CN=Computers,DC=contoso,DC=com" | Audit-System -Verbose
I would have thought that because the [Microsoft.ActiveDirectory.Management.ADComputer] has a 'Name' property parameter binding would have matched it up with my $ComputerName parameter. Why doesn't this work?

What version of PowerShell are you running? I have this working running PowerShell V4 and also having installed  KB2928680 which
fixed a known issue with PowerShell V4 and the use of -Properties * with Get-ADUser and Get-ADComputer.
Interesting. I still need to pipe through select on a fully patched Win8.1 and Win7 (with V4 installed).
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing)
Disregard this. After more testing (this time using the function), I run into the same issue. Appears that this particular issue is still occurring. I know there is a connect issue submitted for this, but wasn't able to locate it (at the time of this post).
Boe Prox
Blog |
Twitter
PoshWSUS |
PoshPAIG | PoshChat |
PoshEventUI
PowerShell Deep Dives Book

Similar Messages

  • Help with Invalid Parameter Binding issue

    let me prefix this with the fact that I'm about as ignorant as can be when it comes to oracle so speak slowly and hopefully I'll catch the low hanging fruit.
    I've inherited a project that someone else wrote and I'm trying to make the code base work, but I am getting 2 error messages and don't really know where to start to fix it.
    My project is using ActiveReports (yea I hate it too) to call a function into a 10g database. It is returning an error saying Invalid Identifier. When I try to run the function in visual studio I get an invalid parameter binding error message and it says parameter name "" (empty quotes, so who knows).
    here's what I have:
    the type definition:
    TYPE type_A AS OBJECT (date_a VARCHAR2(25), start_date VARCHAR2(25), end_date VARCHAR2(25), items_total INT, items_with_x INT, items_without_x INT, items_with_x_percent DECIMAL(7,6), items_without_x_percent DECIMAL(7,6))
    the type table:
    TYPE type_A_table AS TABLE OF type_A
    the function that is erroring:
    <em>FUNCTION func_A (start_date_str IN VARCHAR2, end_date_str IN VARCHAR2) RETURN type_A_table PIPELINED
    IS
    PRAGMA AUTONOMOUS_TRANSACTION;
        start_date_filter TIMESTAMP := TO_DATE(start_date_str,'MM/dd/yyyy HH:MI:ss AM');
        end_date_filter TIMESTAMP := TO_DATE(end_date_str,'MM/dd/yyyy HH:MI:ss AM');
        items_total INT;
        items_with_x INT;
        items_without_x INT;
        items_with_x_percent DECIMAL(7,6);
        items_without_x_percent DECIMAL(7,6);
        temp type_A;
    BEGIN
        SELECT COUNT(*) INTO items_total FROM atable WHERE (create_date BETWEEN start_date_filter AND end_date_filter);
        SELECT COUNT(*) INTO items_with_x FROM atable WHERE conditionx=1 AND (create_date BETWEEN start_date_filter AND end_date_filter);
        SELECT COUNT(*) INTO items_without_x FROM atable WHERE conditionx=0 AND (create_date BETWEEN start_date_filter AND end_date_filter);
        items_with_x_percent := 0.00;
        items_without_x_percent := 0.00;
        IF items_total > 0 THEN
            items_with_x_percent := (items_with_x*1.00)/(items_total*1.00);
            items_without_x_percent := (items_without_x*1.00)/(items_total*1.00);
        END IF;
        temp := type_A(
            TO_CHAR(CURRENT_DATE,'MM/dd/yyyy HH:MI:ss AM'),
            start_date_str,
            end_date_str,
            items_total,
            items_with_x,
            items_without_x,
            items_with_x_percent,
            items_without_x_percent
        PIPE ROW(temp);
        RETURN;
    END;</em>
    I've changed some of the details here from the original so there may be some syntax errors but hopefully you get the gist of the situation.
    any help would be appreciated.
    Thanks

    activereports is a report generator for .net
    as for why it's written the way it is, I have no idea. Like I said, I didn't write it, I'm only trying to get it to work. There is far too much of it (and I'm far under-skilled) to go back and re-write everything the way it should be.
    this function is pretty simple, it takes a start & end date as a string as parameters to the function. it converts those to timestamps and query's an existing table with data for the number of times condition X is true or false with in that date range. This is what the report being generated reports on.
    This one was short and simple which is why I posted it. Others are far more complex and do loop, but for the sake of simplicity I posted this one. I get the same error with all the rest and I figure if I can get one working, the rest probably suffer from the same issue so fixing the rest should be fairly straight forward.
    as for priv's the user is granted all priv's (that are available when you create a new user in 10g XE's web admin interface), and it won't let me grant/remove priv's from the visual studio addin for myself.

  • Crystal report Parameter binding issue with Liveoffice

    Hello,
    I have created a Crystal report on top of BW query. In crystal report when parameter is set to null the report gets all data from BW query.
    On inserting the same Crystal report to Live office document on binding the parameter i get the data for selected value for parameter but i am not able to set the parameter to null to get all the data from BW queries.
    Please help!
    Regards,
    Rahul Doshi

    Hi,
    I was able to solve the issue with the below code. I have added a parameter value as <Not Specifed> in paramter.
    if {?parameter1}='<Not Specified>' Then like '*' else
    ={?Parameter1} and
    if {?Parameter2}='<Not Specified>' Then like '*' else
    ={?Parameter2} and
    if {?Parameter3}='<Not Specified>' Then like '*' else
    ={?Parameter3} and
    if {?Parameter4}='<Not Specified>' Then like '*' else
    ={?Parameter4}
    This code works perfectly fine in crystal report. But when i bind the parameter with excel in Live office it gives me below error.
    Parameter has no value.
    Details: errorKind
    Error in File {7D9B961E-ADB9-4292-9DDE-A8D11B94D78E}.rpt:
    Error in formula  Record Selection:
    'if {?Sales Office}='<Not Specified>' Then {0SD_C03_ZQRY_0SD_C03_0011_BOBJ.D[0SALES_OFF]K} like '*' else
    Parameter has no value.
    Details: errorKind (LO 26603)  (6603)
    Please help.
    Regards,
    Rahul Doshi

  • How to pass parameter [bind variable or substitution variable] to a view?

    How can I pass a parameter [bind variable or substitution variable] to a view in Oracle?
    Some will tell me that this is not necessary, that I can only pass the parameter when I query the view, but I found some case where this cause performance issue. In long view where I use subquery factoring [WITH], it's necessary to pass the parameter many time through different subqueries and not only to the resulting view.
    In other database (SQL Server, Access), we can pass parameters through query. I can't find how to do that in Oracle. Can some one tell me what is the approach suggest by Oracle on that subject?
    Thank you in advance,
    MB
    What I can do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
    What I want to do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")(prmEMP_ID)
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES WHERE EMPLOYEE_ID IN (:prmEMP_ID);

    Blais wrote:
    How can I pass a parameter [bind variable or substitution variable] to a view in Oracle?
    Some will tell me that this is not necessary, that I can only pass the parameter when I query the view, but I found some case where this cause performance issue. In long view where I use subquery factoring [WITH], it's necessary to pass the parameter many time through different subqueries and not only to the resulting view.Yes, there can be performance issues. Views are a form of dynamic SQL and it is hard to predict how they will perform later.
    You can't pass parameters to a view. They are not functions. The mechanism to put the values in is what you mentioned, passing the parameter when you query the view.
    In other database (SQL Server, Access), we can pass parameters through query. I can't find how to do that in Oracle. Can some one tell me what is the approach suggest by Oracle on that subject? This functionality is not supported.
    What I can do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
    What I want to do:
    CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")(prmEMP_ID)
    AS
    SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES WHERE EMPLOYEE_ID IN (:prmEMP_ID);Include the bind value when you use the view in a SELECT. The value will be applied to the view at run-time, somthing like
    CREATE  VIEW "HR"."EMP_NAME_VW" ("FIRST_NAME", "LAST_NAME","EMPLOYEE_ID")(prmEMP_ID)
    AS  SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
    select *
      from emp_name_vw
      WHERE EMPLOYEE_ID IN (:prmEMP_ID);To use EMPLOYEE_ID I added it to your list of columns in the view so it can be referenced in the WHERE clause. If you don't want to see that value don't select it from the view.

  • OWB embeded process flow - parameter binding problem

    I've installed and Oracle 10g Database, after the database installation I added the Oracle Workflow server software. To complete the installation I ran the wfca.
    Later I get to define a process flow in OWB (cheesy) and the process flow seems to be working well (I've done all the registrations necesary also ), but when I am trying to do the parameter binding is not working. I do get the window prompt for the parameter and I enter the date parameter ( I tried different formats like 'YYYY/MM/DD' 'dd-mon-yyyy'), but after I check the runtime in the web browser the parameter is not pass to next process. I tried many things for the last week but I cannot get it to pass the parameter from one process to another.
    Any ideas,
    HELP !!!!!

    did u manage to resolve this issue? we are facing the same problem.

  • PL/SQL:- Invalid Parameter binding

    While calling a pl/sql function returning table type is shows error:
    Invalid parameter binding
    Parameter name: ""

    The problem is coming from .NET and most probably for NULL values.
    SQL> set serverout on
    SQL> create TYPE TEMP_TABLE AS OBJECT (
      2  COLUMN1 VARCHAR2(128),
      3  COLUMN2 VARCHAR2(32),
      4  COLUMN3 VARCHAR2(128));
      5  /
    Type created.
    SQL> create TYPE TEMP_TABLE_REC AS TABLE OF TEMP_TABLE;
      2  /
    Type created.
    SQL> create function SP_TEMP RETURN TEMP_TABLE_REC AS
      2 
      3  v_process_inputs TEMP_TABLE_REC :=TEMP_TABLE_REC();
      4 
      5  CURSOR CUR_EQUIP IS
      6  SELECT 'b' FROM dual
      7  UNION
      8  SELECT 'f' FROM dual;
      9 
    10  REC_EQUIP CUR_EQUIP%ROWTYPE;
    11 
    12  BEGIN
    13 
    14  OPEN CUR_EQUIP;
    15  LOOP
    16  FETCH CUR_EQUIP INTO REC_EQUIP;
    17  EXIT WHEN CUR_EQUIP%NOTFOUND;
    18  v_process_inputs.EXTEND;
    19 
    20  v_process_inputs(1):=TEMP_TABLE('a','b','c');
    21 
    22  END LOOP;
    23  CLOSE CUR_EQUIP;
    24 
    25  RETURN v_process_inputs;
    26  END SP_TEMP;
    27  /
    Function created.
    SQL> declare
      2     result temp_table_rec;
      3  begin
      4    -- Call the function
      5    result := sp_temp;
      6    FOR i in 1..RESULT.COUNT LOOP
      7     dbms_output.put_line(RESULT(i).COLUMN1||'--'||RESULT(i).COLUMN2||'--'||RESULT(i).COLUMN3);
      8    END LOOP;
      9  end;
    10  /
    a--b--c
    PL/SQL procedure successfully completed.Note the last null values ----.

  • Attachment binding issue in workflow

    Hi All,
    I have used FM 'SAP_WAPI_ATTACHMENT_ADD ' in method of my workflow. Here after executing this FM i m getting id of the attachment for this workitem. But now i need to assign this to  '_Attach_Objects' of workflow container. so please help me for this binding issue. which i need to bind from method to> task to> workflow. so from next step onwards in workflow i will get that attachment.
    Smit Shah

    Hi,
    1) In the T.code SWO1, you have to create a custom method for the BO, there execute that method and check whether it working fine
    2) Then goto  T.code PFTC and Create a Task (Task no. will generate automatically), then call this method and generate the binding
    3) Goto  T.code SWDD and call that Task by assigning that Task no. and assign the binding
    Then test your workflow.
    For the Binding see this [link|http://help.sap.com/saphelp_nw04/helpdata/en/c8/bfc39b0fc57a49a0291378f8be0cd6/frameset.htm].
    Regards,
    Surjith

  • Query In SP runs 10x slower than straight query - NOT Parameter Sniffing Issue

    Hi Everyone,
    I have a real mystery on my hands that appears to be a parameter sniffing issue with my SP but I think is not. I have tried every parameter sniffing workaround trick in the book ( local variables, option recompile, with recompile, optimize for variables,UNKNOWN,
    table hints, query hints, MAXDOP, etc.) I have dropped indexes/recreated indexes, updated statistics, etc. I have restored a copy of the DB to 2 different servers ( one with identical HW specs as the box having the issue, one totally different ) and the SP
    runs fine on those 2, no workarounds needed. Execution plans are identical on all boxes. When I run a profiler on the 2 different boxes however, I see that on the server having issues, the Reads are around 8087859 while the other server with identical HW,
    the reads are 10608. Not quite sure how to interpret those results or where to look for answers. When the sql server service is restarted on the server having issues and the sp is run, it runs fine for a time ( not sure how long ) and then goes back to its
    snail pace speed. Here is the profile trace:
    Here is the stored procedure. The only modifications I made were the local variables to eliminate the obvious parameter sniffing issues and I added the WITH NOLOCK hints:
    /****** Object:  StoredProcedure [dbo].[EC_EMP_APPR_SIGNATURE_SEL_TEST]    Script Date: 12/03/2014 08:06:01 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    /****** Object:  StoredProcedure [dbo].[EC_EMP_APPR_SIGNATURE_SEL_TEST]    Script Date: 12/02/2014 22:24:45 ******/
    ALTER PROCEDURE [dbo].[EC_EMP_APPR_SIGNATURE_SEL_TEST]
    @EMPLOYEE_ID varchar(9) ,
    @OVERRIDE_JOB_CODE varchar(8),
    @OVERRIDE_LOCATION_CODE varchar(8),
    @OVERRIDE_EST_CODE varchar(8),
    @OVERRIDE_EMP_GROUP_CODE varchar(8)
    AS
    set NOCOUNT ON
    declare
    @EMPLOYEE_ID_LOCAL varchar(9),
    @OVERRIDE_JOB_CODE_LOCAL varchar(8),
    @OVERRIDE_LOCATION_CODE_LOCAL varchar(8),
    @OVERRIDE_EST_CODE_LOCAL varchar(8),
    @OVERRIDE_EMP_GROUP_CODE_LOCAL varchar(8)
    set @EMPLOYEE_ID_LOCAL = @EMPLOYEE_ID
    set @OVERRIDE_JOB_CODE_LOCAL = @OVERRIDE_JOB_CODE
    set @OVERRIDE_LOCATION_CODE_LOCAL = @OVERRIDE_LOCATION_CODE
    set @OVERRIDE_EST_CODE_LOCAL = @OVERRIDE_EST_CODE
    set @OVERRIDE_EMP_GROUP_CODE_LOCAL = @OVERRIDE_EMP_GROUP_CODE
    select 3 as SIGNATURE_ID
    from EC_EMPLOYEE_POSITIONS p
    where p.EMPLOYEE_ID = @EMPLOYEE_ID_LOCAL
     and DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) between p.POSITION_START_DATE and ISNULL(p.POSITION_END_DATE, convert(datetime, '47121231', 112))
     and (dbo.lpad(isnull(p.job_code,''), 8, ' ') + dbo.lpad(isnull(p.location_code,''), 8, ' ') + dbo.lpad(isnull(p.ESTABLISHMENT_CODE,'<N/A>'), 8, ' ') + dbo.lpad(isnull(p.EMP_GROUP_CODE,''), 8, ' '))
     in
     (select (dbo.lpad(isnull(ep.REPORTING_JOB_CODE,''), 8, ' ') + dbo.lpad(isnull(ep.REPORTING_LOCATION_CODE,''), 8, ' ') + dbo.lpad(isnull(ep.REPORTING_ESTABLISHMENT_CODE,'<N/A>'), 8, ' ') + dbo.lpad(isnull(ep.REPORTING_EMP_GROUP_CODE,''),
    8, ' '))
      from EC_POSITIONS  ep
      where DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) between ep.POSITION_EFFECT_DATE
       and ISNULL(ep.POSITION_TERM_DATE, convert(datetime, '47121231', 112))
       and (dbo.lpad(isnull(ep.job_code,''), 8, ' ') + dbo.lpad(isnull(ep.location_code,''), 8, ' ') + dbo.lpad(isnull(ep.ESTABLISHMENT_CODE,'<N/A>'), 8, ' ') + dbo.lpad(isnull(ep.EMP_GROUP_CODE,''), 8, ' '))
       = (dbo.lpad(isnull(@OVERRIDE_JOB_CODE_LOCAL,''), 8, ' ') + dbo.lpad(isnull(@OVERRIDE_LOCATION_CODE_LOCAL,''), 8, ' ') + dbo.lpad(isnull(@OVERRIDE_EST_CODE_LOCAL,'<N/A>'), 8, ' ') + dbo.lpad(isnull(@OVERRIDE_EMP_GROUP_CODE_LOCAL,''),
    8, ' ')))
    union
    select 4 as SIGNATURE_ID
    from EC_EMPLOYEE_POSITIONS p
    where p.EMPLOYEE_ID = @EMPLOYEE_ID_LOCAL
     and DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) between p.POSITION_START_DATE and ISNULL(p.POSITION_END_DATE, convert(datetime, '47121231', 112))
     and (dbo.lpad(isnull(p.job_code,''), 8, ' ') + dbo.lpad(isnull(p.location_code,''), 8, ' ') + dbo.lpad(isnull(p.ESTABLISHMENT_CODE,'<N/A>'), 8, ' ') + dbo.lpad(isnull(p.EMP_GROUP_CODE,''), 8, ' '))
     in
     (select (dbo.lpad(isnull(ep.REPORTING_JOB_CODE,''), 8, ' ') + dbo.lpad(isnull(ep.REPORTING_LOCATION_CODE,''), 8, ' ') + dbo.lpad(isnull(ep.REPORTING_ESTABLISHMENT_CODE,'<N/A>'), 8, ' ') + dbo.lpad(isnull(ep.REPORTING_EMP_GROUP_CODE,''),
    8, ' '))
      from EC_POSITIONS  ep with (NOLOCK)
      where DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) between ep.POSITION_EFFECT_DATE
       and ISNULL(ep.POSITION_TERM_DATE, convert(datetime, '47121231', 112))
       and (dbo.lpad(isnull(ep.job_code,''), 8, ' ') + dbo.lpad(isnull(ep.location_code,''), 8, ' ') + dbo.lpad(isnull(ep.ESTABLISHMENT_CODE,'<N/A>'), 8, ' ') + dbo.lpad(isnull(ep.EMP_GROUP_CODE,''), 8, ' '))
       in   
     (select (dbo.lpad(isnull(ep.REPORTING_JOB_CODE,''), 8, ' ') + dbo.lpad(isnull(ep.REPORTING_LOCATION_CODE,''), 8, ' ') + dbo.lpad(isnull(ep.REPORTING_ESTABLISHMENT_CODE,'<N/A>'), 8, ' ') + dbo.lpad(isnull(ep.REPORTING_EMP_GROUP_CODE,''),
    8, ' '))
      from EC_POSITIONS ep  with (NOLOCK)
      where DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) between ep.POSITION_EFFECT_DATE
       and ISNULL(ep.POSITION_TERM_DATE, convert(datetime, '47121231', 112))
       and (dbo.lpad(isnull(ep.job_code,''), 8, ' ') + dbo.lpad(isnull(ep.location_code,''), 8, ' ') + dbo.lpad(isnull(ep.ESTABLISHMENT_CODE,'<N/A>'), 8, ' ') + dbo.lpad(isnull(ep.EMP_GROUP_CODE,''), 8, ' '))
       = (dbo.lpad(isnull(@OVERRIDE_JOB_CODE_LOCAL,''), 8, ' ') + dbo.lpad(isnull(@OVERRIDE_LOCATION_CODE_LOCAL,''), 8, ' ') + dbo.lpad(isnull(@OVERRIDE_EST_CODE_LOCAL,'<N/A>'), 8, ' ') + dbo.lpad(isnull(@OVERRIDE_EMP_GROUP_CODE_lOCAL,''),
    8, ' '))))
    order by SIGNATURE_ID
    Any suggestions would be greatly appreciated by anyone. I have no more tricks left in my toolbox and am starting to think its either the hardware or the database engine itself that is at fault.
    Max

    fast server:
    SQL Server parse and compile time:
       CPU time = 0 ms, elapsed time = 0 ms.
    SQL Server Execution Times:
    CPU time = 0 ms, elapsed time = 0 ms.
    SQL Server Execution Times:
       CPU time = 0 ms,  elapsed time = 0 ms.
    SQL Server Execution Times:
       CPU time = 0 ms,  elapsed time = 0 ms.
    SQL Server Execution Times:
       CPU time = 0 ms,  elapsed time = 0 ms.
    SQL Server Execution Times:
       CPU time = 0 ms,  elapsed time = 0 ms.
    SQL Server Execution Times:
       CPU time = 0 ms,  elapsed time = 0 ms.
    Table 'EC_POSITIONS'. Scan count 3, logical reads 10450, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    Table 'EC_EMPLOYEE_POSITIONS'. Scan count 2, logical reads 6, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    SQL Server Execution Times:
       CPU time = 3343 ms,  elapsed time = 3460 ms.
    SQL Server Execution Times:
       CPU time = 3343 ms,  elapsed time = 3460 ms.
    Slow server:
    SQL Server parse and compile time:
       CPU time = 0 ms, elapsed time = 0 ms.
    SQL Server Execution Times:
    CPU time = 0 ms, elapsed time = 0 ms.
    SQL Server Execution Times:
       CPU time = 0 ms,  elapsed time = 0 ms.
    SQL Server Execution Times:
       CPU time = 0 ms,  elapsed time = 0 ms.
    SQL Server Execution Times:
       CPU time = 0 ms,  elapsed time = 0 ms.
    SQL Server Execution Times:
       CPU time = 0 ms,  elapsed time = 0 ms.
    SQL Server Execution Times:
       CPU time = 0 ms,  elapsed time = 0 ms.
    Table 'EC_POSITIONS'. Scan count 3, logical reads 10450, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    Table 'EC_EMPLOYEE_POSITIONS'. Scan count 2, logical reads 6, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
    SQL Server Execution Times:
       CPU time = 37875 ms,  elapsed time = 38295 ms.
    SQL Server Execution Times:
       CPU time = 37875 ms,  elapsed time = 38295 ms.
    Big diff in server execution times....

  • [Oracle JDBC Driver]Invalid parameter binding(s).

    Hi there
    I am using the OracleCachedRowSet, and it works fine until I tries to update a resultset with a null value. When I call rs.acceptChanges(connection); it results in the following exception.
    Please help if anyone has found a workaround to this problem.
    java.sql.SQLException: [BEA][Oracle JDBC Driver]Invalid parameter binding(s).
    at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
    at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
    at weblogic.jdbc.base.BaseParameters.getParameter(Unknown Source)
    at weblogic.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)
    at weblogic.jdbc.base.BasePreparedStatement.setObject(Unknown Source)
    at weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:268)
    at oracle.jdbc.rowset.OracleCachedRowSetWriter.updateRow(OracleCachedRowSetWriter.java:429)
    at oracle.jdbc.rowset.OracleCachedRowSetWriter.writeData(OracleCachedRowSetWriter.java:534)
    at oracle.jdbc.rowset.OracleCachedRowSet.acceptChanges(OracleCachedRowSet.java:2926)
    at eurostat.Items.updateRS(Items.java:192)
    at eurostat.DBConnectionBean.updateRS(DBConnectionBean.java:94)
    at jsp_servlet.__mainpage._jspService(MainPage.jsp:248)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilter.java:246)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

    Hi Avi
    Thanks for the suggestion, but I don't thint that is the problem. In other forums I have found people describing the same problem(both with Oracle and Sun's implementation of CachedRowSet). See this link for an example http://bugs.mysql.com/bug.php?id=9831. So I figured that those other people needed to have a solution to the problem, but I can't find it.
    /Thomas

  • SAP Cloud For Customer : Add Extension Fields under the Parameter Binding For Mashups

    Hi Experts,
    I have requirements for the mashups, I have created the extension field in cloud for customer "Registered Product" TI screen i want to add that newly created extension fields under the Mashup Parameter Binding List.
    1) Is it possible ? If yes then How it is?
    2) Any Standard process or we go for the SDK to enhance the standard screen port binding?
    For more information refer the below screen.
    Awaiting for your reply or suggestion....
    Many Thanks,
    Mithun

    I have done the below changes on the custom BO.
    Step 1 . In the Event Handler i have change as per the previous reply.
    Step 2. Assign that Event to Import OnFire.
    I am getting this error when open the Account Screen and go to that Embed Tab.
    "Object [object Object] has no method 'getRawValue'".
    Kindly check the above steps are correct or any step missing.
    Many Thanks,
    Mithun

  • [OCI] Parameter Binding, repeated Statements with differing values

    Hello
    I am working on an application written in C which sends about 50 different SQL Statements to an Oracle Database using OCI. These Statements are executed repeatedly with different values.
    In order to improve performance I would like to know what possibilities I have.
    Whats the benefit of the following "techniques" ?
    - Parameter Binding
    - Statement Caching
    What else could I look into?
    with friendly greetings.

    It doesn't take zero-time of course, and it does level-off after a while, but array-bind/define or pre-fetching can make a significant impact on performance:
    truncated table: 0.907 / 0.918
    insert_point_stru_1stmt_1commit: x100,000: 0.141 / 0.144Above I truncate the table to get repeatable numbers; deleting all rows from a previous run leaves a large free list (I guess...), and performance of this little contrived benchmark degrades non-negligeably otherwise. This is a single array-bind insert statement.
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@0: 7.594 / 7.608
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@1: 4.000 / 4.004
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@10: 0.906 / 0.910
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@100: 0.297 / 0.288
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@1,000: 0.204 / 0.204
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@10,000: 0.265 / 0.268
    fetched 100,000 rows. (0 errors)Above I do a regular "scalar" define, but turn pre-fetching on (default is one row, but I tested with pre-fetching completly off too). @N means pre-fetch N rows.
    select_points_array: x100,000@10: 0.969 / 0.967
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@100: 0.250 / 0.251
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@1,000: 0.156 / 0.167
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@10,000: 0.156 / 0.157
    fetched 100,000 rows. (0 errors)Above I use array-defines instead of pre-fetch.
    select_points_struct: x100,000@10: 0.938 / 0.935
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@100: 0.219 / 0.217
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@1,000: 0.140 / 0.140
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@1,000: 0.140 / 0.140Above I use array-of-struct defines instead of pre-fetch or array-bind. Performance is just a little better, probably because of better memory "locality" with structures.
    The table is simple:
    create table point_tab(
    id number,
    x binary_float,
    y binary_float,
    z binary_float
    So each row is 22 + 4 + 4 + 4 = 34 bytes. There are no constraints or indexes of course to make it as fast as possible (this is 11g on XP win32, server and client on the same machine, single user, IPC protocol, so it doesn't get much better than this, and is not realistic of true client-server multi-user conditions).
    There aren't enough data point to confirm or not your prediction that the advantage of array-bind level-off at the packet size threshold, but what you write makes sense to me.
    So I went back and tried more sizes. 8K divided by 34 bytes is 240 rows, so I selected 250 rows as the "middle", and bracketed it with 2 upper and lower values which "double" up or down the number of rows:
    truncated table: 0.953 / 0.960
    insert_point_stru_1stmt_1commit: x100,000: 0.219 / 0.220
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@67: 0.329 / 0.320
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@125: 0.297 / 0.296
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@250: 0.250 / 0.237
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@500: 0.218 / 0.210
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@1,000: 0.187 / 0.195
    fetched 99,964 rows. (0 errors)
    select_points_array: x99,964@67: 0.297 / 0.294
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@125: 0.235 / 0.236
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@250: 0.203 / 0.206
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@500: 0.188 / 0.179
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@1,000: 0.156 / 0.165
    fetched 99,964 rows. (0 errors)
    select_points_struct: x99,964@67: 0.250 / 0.254
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@125: 0.203 / 0.207
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@250: 0.172 / 0.168
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@500: 0.157 / 0.152
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@1,000: 0.125 / 0.129As you can see, it still gets faster at 1,000, which is about 32K. I don't know the packet size of course, but 32K sounds big for a packet.
    truncated table: 2.937 / 2.945
    insert_point_stru_1stmt_1commit: x100,000: 0.328 / 0.324
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@1,000: 0.250 / 0.250
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@2,000: 0.266 / 0.262
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@3,000: 0.250 / 0.254
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@4,000: 0.266 / 0.273
    fetched 100,000 rows. (0 errors)
    select_first_n_points: x100,000@5,000: 0.281 / 0.278
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@1,000: 0.172 / 0.165
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@2,000: 0.157 / 0.159
    fetched 99,000 rows. (0 errors)
    select_points_array: x99,000@3,000: 0.156 / 0.157
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@4,000: 0.141 / 0.155
    fetched 100,000 rows. (0 errors)
    select_points_array: x100,000@5,000: 0.157 / 0.164
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@1,000: 0.125 / 0.129
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@2,000: 0.125 / 0.123
    fetched 99,000 rows. (0 errors)
    select_points_struct: x99,000@3,000: 0.125 / 0.120
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@4,000: 0.125 / 0.121
    fetched 100,000 rows. (0 errors)
    select_points_struct: x100,000@5,000: 0.125 / 0.122Above 32K, there doesn't seem to be much benefit (at least in this config. My colleague on linux64 is consistently faster in benchmarks, even connecting to the same servers, when we have the same exact machine). So 32K may indeed be a threshold of sort.
    In all, I hope I've shown there is value in array-binds (or defines), or even simple pre-fetching (but the latter helps in selects only). I don't think one can very often take advantage of it, and I have no clue how it compares to direct-path calls, but value there is still IMHO. --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Named parameter binding

    ODP.Net document said :
    The position of an OracleParameter added into the
    OracleParameterCollection is the binding position in the SQL statement.Position is 0-based and is used only for positional binding.
    If named binding is
    used, the position of an OracleParameter in the
    OracleParameterCollection is ignored.
    Then,how can I use named parameter binding ?

    Look up the BindByName property of the Oracle Command. It defaults to false (bind params by position). Set it to true for bind by name.

  • Name Parameter Binding

    Is there any sample code showing how to do named parameter binding using ODBC? I have stored procedures with 100+ parameters and default values assigned to most of the parameters and I want to be able to only bind to the variables that I need to pass. I have it working with MS SQL but with oracle it in not binding to the correct parameter
    Thanks

    I am tring to do Named "Parameter Binding", I am using using straight ODBC from vc++ with the latest driver 9205. I have also tried the DataDirect drivers and using ADO from VB6.
    The same code has worked fine with SQL Server but with oracle it always ingores the SQL_DESC_NAME setting in the SQLSetDescField statement and sets the first two parameters, not the 2nd and 3rd param.
    Thanks,
    Bill
    -- The Stored Procedure
    CREATE OR REPLACE PROCEDURE testme (param1 varchar2 :='Default1' , param2 varchar2 := 'Default2', param3 varchar2 := 'Default3') AS
    BEGIN
    INSERT INTO param_test(param_1, param_2, param_3, col_id) VALUES (param1, param2, param3, test_seq.nextval);
    END;
    C++ Source code
    // Prepare the procedure invocation statement.
    retcode = SQLPrepare(hstmt, (SQLCHAR*)"{call testme(?, ?)}", SQL_NTS);
    if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
    // Populate record 1 of ipd.
    strcpy((char*)szQuote, "test2");
    SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, 30, 0, szQuote, 0, &cbValue);
    // Get ipd handle and set the SQL_DESC_NAMED and SQL_DESC_UNNAMED fields
    // for record #1.
    //retcode = SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hIpd);
    retcode = SQLGetStmtAttr(hstmt, SQL_ATTR_IMP_PARAM_DESC, &hIpd1, 0, 0);
    retcode = SQLSetDescField(hIpd1, 1, SQL_DESC_NAME, "param2", SQL_NTS);
    retcode = SQLSetDescField(hIpd1, 1, SQL_DESC_UNNAMED, SQL_NAMED, 0);
    // Populate record 1 of ipd.
    strcpy((char*)szQuote2, "test3");
    SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, 30, 0, szQuote2, 0, &cbValue);
    // Get ipd handle and set the SQL_DESC_NAMED and SQL_DESC_UNNAMED fields
    // for record #2.
    //retcode = SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hIpd);
    retcode = SQLGetStmtAttr(hstmt, SQL_ATTR_IMP_PARAM_DESC, &hIpd2, 0, 0);
    retcode = SQLSetDescField(hIpd2, 2, SQL_DESC_NAME, "param3", SQL_NTS);
    retcode = SQLSetDescField(hIpd2, 2, SQL_DESC_UNNAMED, SQL_NAMED, 0);
    // Assuming that szQuote has been appropriately initialized,
    // execute.
    retcode = SQLExecute(hstmt);
    if (!SQL_SUCCEEDED(retcode))
    ExplainErrors(hstmt);
    }

  • A data-binding issue with a combo box.

    Hi,
    Iu2019m having a data-binding issue with a combo box.  The field it is bound to is an integer.  The valid values in the combo box are 1, 2, and 3.  If I add a record when it is set to 1 or 2, the value gets stored correctly.  If I add a record when it is set to 3, it is stored as 1.  However, I can bring up the record just added on the form, change it to 3, and click u201CUpdateu201D and it is saved correctly as 3.  If I change it so that the valid values are 4, 5, and 6, it saves a 1 regardless of what is selected in the combo box.  It looks like the combo box is correctly bound for updates but not for adds.  The table is a master type UDO.  Any ideas?  Iu2019m somewhat committed to the field being an integer.  I'm using 2007A PL47.
    Thanks,
    Mike
    Edited by: Mike Angelastro on Jul 1, 2009 2:43 PM

    I tried a few things on my own.  The result is that I decided that it was not a good idea to use a combo box bound to an integer (numeric) field.  I donu2019t think the SDK can handle it.  The reason it was an integer field in the first place is that before I changed it to a combo box it was a group of two option buttons.  Option buttons use an integer (numeric) field.  This worked just fine until I added a third option; the SDK didnu2019t handle the third option correctly when adding records.  I thought that using a combo box instead would fix that.  I was wrong; the problem remained.  So I decided to use a character (alphanumeric) field instead.  This works just fine.
    So here is my advice:  Never use option buttons if they need to be bound to the database; a combo box will actually work better when bound to the database.  But use a character (alphanumeric) field.
    Edited by: Mike Angelastro on Jul 5, 2009 9:15 PM

  • [svn:cairngorm3:] 17187: Fixed binding issue on the source property of the contact's picture

    Revision: 17187
    Revision: 17187
    Author:   [email protected]
    Date:     2010-08-04 13:44:35 -0700 (Wed, 04 Aug 2010)
    Log Message:
    Fixed binding issue on the source property of the contact's picture
    Modified Paths:
        cairngorm3/trunk/samples/insync/insync-modularExtended-contacts/src/insync/contacts/prese ntation/ContactForm.mxml

    Revision: 17187
    Revision: 17187
    Author:   [email protected]
    Date:     2010-08-04 13:44:35 -0700 (Wed, 04 Aug 2010)
    Log Message:
    Fixed binding issue on the source property of the contact's picture
    Modified Paths:
        cairngorm3/trunk/samples/insync/insync-modularExtended-contacts/src/insync/contacts/prese ntation/ContactForm.mxml

Maybe you are looking for