P_ISHIERCELL parameter in iterator

Hi Experts,
I wish to know something more about the parameter P_ISHIERCELL of the iterator's method called  IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
Thanks and Regards.
Laura

I found out the following way:
1.)Report
1.1)SQL-Query:
select * from <owner>.<tablename> where UPPER(column) like '%'||UPPER(NVL(:searchtext,'abczyx123098'))||'%'
(Note: bind variable is :searchtext).
1.2)in "before displaying page"-section in "additional plsql" add the following:
if length(get_value('p_mainsearch')) >= 3 then
portal30.wwv_name_value.replace_value(
l_arg_names, l_arg_values, p_reference_path||'.searchtext,
portal30.wwv_standard_util.string_to_table2(get_value('p_mainsearch')));
end if;
1.3) publish as portlet
2.) Integrate the report-portlet into a new tab on search page. Run basic search.
Change to the tab with the portlet.
For me it is solved.
Joerg.

Similar Messages

  • What is an elegant way to get parameters?

    Is there an elegant way to get parameters?
    I set the id for a parameter on the jsf page and then I can find the parameter by iterating through the parameter map searching the strings until I find the keypair that I need then I grab the value that was submitted on the form.
    For example, I set id=gpaNbr but the string in the parameter map is id0:gpaNbr --- it's got that little "id0:" thingy prepended to the string.
    Can someone suggest a less clumsy technique?
    Thanks,
    Al Malin

    Sorry, forgot to mention it's for JSFs with 10.1.3 dp.

  • Data and diagnostics cannot be collected: Value cannot be null

    I'm trying to run manual test cases in MTM 2012. Normally it is associated with our company TFS, but for a project we are required to associate it to the client's TFS.
    Every time a test case is run I get the following error:
    Right after the messages MTM is stalled and unable to otherwise conduct any testing with.
    I assumed it was because an extra empty iteration was being created when I was saving the test case, hence the 'Value cannot be null; Parameter name: assemblyName' message. However it seems to be typical of MTM i.e. a seemingly blank iteration is being created
    right below a parameter's iteration.
    I can run the tests from the TFS web testing application but would prefer to run the tests from MTM.

    Hi Donal,
    What’s the client’s TFS mean? Do you have two TFS?
     What’s the version of the TFS?
    If so, please try to connect to your company’s TFS, then do the manual tests and check the result.
    If it works fine, I think there are something wrong in your client’s TFS, please repair or re-install it.
    If it throw that error, I think there are something wrong in your MTM, please repair or re-install your VS.
    Thanks
    Best Regards
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • "Could not create variable iterator" on creating ADF Parameter Form

    I've got a managed bean with a method;
    public String cmdLogin_action(String userName, String passWord) {
    // Add event code here...
    return "success";
    I've created a data control, but whenever I try to drag it onto a page and select "Create ADF Parameter Form", I get the dialog to specify bindings between parameters and elements in the form, then when I press OK I get a dialog entitled "Could not create widget" with the message "Could not create variable iterator".
    Anyone know what's wrong?

    Hi,
    actually why do you use ADF binding for this at all? You already have the POJO managed by ADF and the textfield binding to this is
    #{managedBeanName.username) for a String username with getter and setters in it. Why do you want to add a JSF lifecycle managed POJO to a ADF lifecycle managed binding that would provide no additional functionality to you, except that the two lifecycles my interfere with each other (though they are linked together).
    Note that the pageDef file needs to create variables for all the arguments in a method, which then is referenced by attribute bindings.
    Frank                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Two commands in the report using the same parameter - fail under Java

    I have a report that contains 2 SQL commands.
    Both of these commands use one parameter X of type Number in their 'WHERE' clause.
    When i'm viewing the report in CR 2008, i'm asked for a value of this parameter and all data is filled in the report - OK
    The problem occurs when the same report is printed through Crystal Java Runtime:
    Report is printed without data! - it's empty.
    What we noticed in the debug information thrown by the Crystal libraries is that parameter value is set only in one of these commands:
    Original statement 1:
    select a.something
    from ANM_T a
    where a.anmid = {?PARAMETER01Id}
    Original statement 2:
    SELECT * from ANM_T a
    WHERE  a.anmid={?PARAMETER01Id}
    OUTCOME of Statement 1:
    select a.something
    from ANM_T a
    where a.anmid = 0
    OUTCOME of Statement 2:
    SELECT * from ANM_T a
    WHERE  a.anmid=9825
    In above example we may see that crystal set the value only in the second statement - first one got 0 - i suspect its some default value.
    Parameter in the Java code is set in the right way. In case of using only one statement it works. If we use two separate parameters (whose values are equal ) it also works.
    // we have also the loop over the parameters
    ParameterFieldController paramFieldController =
                    report.getDataDefController().getParameterFieldController();
    paramFieldController.setCurrentValue( "", paramName, paramValue );
    What is strange for me is that Crystal Reports enables to use the same parameter in two commands but if you edit one of them you may change the type of this parameter for a command ( for example from Number to String) but the parameter type in the second command remains unchanged ( it's strange because in my opinion it is the same parameter). In the Field Explorer under the Parameter Fields i still see one parameter of type used in the second command.

    Hello all,
    We have prepared some sample code to illustrate the issue.
    We have modified the sample application (Link: [http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/c07fec3e-3e11-2c10-1991-8c0fb0b82b75]) to that it also changes the parameter value. Parameter is used in two commands saved in report.
    The code changing the parameters value looks like this:
    private static void changeParameters(ReportClientDocument reportClientDoc) throws ReportSDKException {
              DataDefController dataDefController = reportClientDoc.getDataDefController();
            Fields fields = dataDefController.getDataDefinition().getParameterFields();
            for( int i = 0; i < fields.size(); i++ ){
                Field field = (Field)fields.getField( i );
                if( field.getKind() == FieldKind.parameterField ){
                            setParameter( ((ParameterField)field).getName(), "9825" , reportClientDoc);          
    private static void setParameter( String paramName, String paramValue, ReportClientDocument document ) throws ReportSDKException {
         ParameterFieldController paramFieldController =
                    document.getDataDefController().getParameterFieldController();
         paramFieldController.setCurrentValue( "", paramName, paramValue );
    We have tried the following codes to change the connection info used in commands:
    Attempt 1
              Tables tables = databaseController.getDatabase().getTables();
              //Set the datasource for all main report tables.
              for (int i = 0; i < tables.size(); i++) {
                   ITable table = tables.getTable(i);
                   //Keep existing name and alias.
                   table.setName(table.getName());
                   table.setAlias(table.getAlias());
                   //Change connection information properties.
                   IConnectionInfo connectionInfo = table.getConnectionInfo();
                   //Set new table connection property attributes.
                   connectionInfo.setAttributes(propertyBag);
                   //Set database username and password.
                   //NOTE: Even if these the username and password properties don't change when switching databases, the
                   //database password is *not* saved in the report and must be set at runtime if the database is secured. 
                   connectionInfo.setUserName(DBUSERNAME);
                   connectionInfo.setPassword(DBPASSWORD);
                   connectionInfo.setKind(ConnectionInfoKind.SQL);
                   table.setConnectionInfo(connectionInfo);
                   //Update old table in the report with the new table.
                   databaseController.setTableLocation(table, tables.getTable(i));
                   //databaseController.setTableLocation(tables.getTable(i), table);
    Attempt 2
             newConnectionInfo.setAttributes(propertyBag);
             connectionInfo.setUserName(DBUSERNAME);
             connectionInfo.setPassword(DBPASSWORD);
             //preserve subreport links
             SubreportController src = doc.getSubreportController();
             Map<String, SubreportLinks> linkMapper = new HashMap<String,SubreportLinks>();
             for(String subreportName : src.getSubreportNames()){
                 linkMapper.put(subreportName,
                     (SubreportLinks) src.getSubreportLinks(subreportName).clone(true));
             //If this connection needed parameters, we would use this field. 
             Fields<IParameterField> pFields = doc.getDataDefController().getDataDefinition().getParameterFields();
             replaceConnectionInfos(doc.getDatabaseController(), newConnectionInfo, pFields);
             IStrings strs = src.getSubreportNames();
             Iterator<String> it = strs.iterator();
             while (it.hasNext()) {
               String name = it.next();
               ISubreportClientDocument subreport = src.getSubreport(name);
               pFields = subreport.getDataDefController().getDataDefinition().getParameterFields();
               replaceConnectionInfos(subreport.getDatabaseController(), newConnectionInfo, pFields);
             //reconnect subreport links since when using replaceConnection links are erased
             for(String subreportName : src.getSubreportNames())
               src.setSubreportLinks(subreportName, linkMapper.get(subreportName));
    private static void replaceConnectionInfos(DatabaseController aDc, IConnectionInfo aNewConnInfo, Fields<IParameterField> aParameterField) throws ReportSDKException {
             ConnectionInfos cis = aDc.getConnectionInfos(null);
             for (IConnectionInfo oldConnInfo : cis)
               aDc.replaceConnection(oldConnInfo, aNewConnInfo, aParameterField, DBOptions._useDefault
                   + DBOptions._doNotVerifyDB);
    In both cases, the observed problem occurred. In one query the parameter was set properly, while on the other it was set to 0 (or empty string in case of string parameters). What is more, no data appeared on the print.
    Do you happen to know the reason of this issue?How can we fix the problem?
    Best regards
    Mateusz Błaż

  • Problem with setting oracle type parameter in viewobject query

    Hi There,
    I am facing a problem with JDev1013. I have a view that has JDBC positional parameters that are supposed to be in parameters for function like:
    SELECT x.day, x.special_exact_period_only
    FROM (
      SELECT x.day, x.special_exact_period_only
      FROM (
        SELECT
          x.day,
          rb.special_exact_period_only
      FROM TABLE (
        RentabilityPkg.findMarkerSlots(
          'start',
          ? /* dchannel */,
          NULL,
          ? /* resorts */,
          'special',
          NULL,
          ? /* code */,
          NULL,
          TRUNC(SYSDATE),
          TRUNC(SYSDATE + 365 * 2),
          NULL
      ) x
        JOIN resourcebase rb USING (rentabilitymanager_id)
        UNION
        SELECT
          x.day,
          rb.special_exact_period_only
        FROM TABLE (
          RentabilityPkg.findMarkerSlots(
            'start',
            ? /* dchannel */,
            NULL,
            ? /* resorts */,
            'composition',
            NULL,
            ? /* code */,
            NULL,
            TRUNC(SYSDATE),
            TRUNC(SYSDATE + 365 * 2),
            NULL
        ) x
        JOIN resourcebase rb USING (rentabilitymanager_id)
      )x
      ORDER BY x.day
    ) x
    WHERE ROWNUM <= 30now the JDBC positional parameters take our custom defined list type defined as:
    CREATE TYPE NumberList AS TABLE OF NUMBER;
    we are setting the parameter in the views with the help of oracle.sql.ARRAY class like:
       * Set parameters.
      public void setParams(Integer dchannelId, Integer[] resorts, String specialCode)
        try {
              System.out.println(this.getClass() + ".setParams()");
              ARRAY arrParam1 = ((NWSApplicationModule)getApplicationModule()).toSQLNumberList(Arrays.asList(resorts));
              ARRAY arrParam2 = ((NWSApplicationModule)getApplicationModule()).toSQLNumberList(Arrays.asList(resorts));
              System.out.println("arrParam1 - " + arrParam1);
              System.out.println("arrParam1 - " + arrParam1);
              System.out.println(this.getClass() + " ARRAY - " + arrParam1.getArray());
              System.out.println(this.getClass() + " -- " + arrParam1.length());
              System.out.println("arrParam2 - " + arrParam2);
              System.out.println("arrParam2 - " + arrParam2);
              System.out.println(this.getClass() + " ARRAY - " + arrParam2.getArray());
              System.out.println(this.getClass() + " -- " + arrParam2.length());
              Object[] params =
                   { dchannelId,
                        arrParam1,
                        specialCode,
                        dchannelId,
                        arrParam2,
                        specialCode
              setWhereClauseParams(params);
              System.out.println("DONE WITH " + this.getClass() + ".setParams()");
        catch(Exception ex)
              ex.printStackTrace(System.out);
      }the toSQLNumberList() method is defined in our App module baseclass as follows:
      public ARRAY toSQLNumberList(Collection coll)
           debug("toSQLNumberList()");
           DBTransaction txn = (DBTransaction)getTransaction();
           debug("txn - " + txn + " : " + txn.getClass());
           return NWSUtil.toSQLNumberList(coll, getConnection(txn));
      public static ARRAY toSQLNumberList(Collection c, Connection connection)
        //printTrace();
        debug("toSQLNumberList()");
        try
          ArrayDescriptor numberList = ArrayDescriptor.createDescriptor("NUMBERLIST", connection);
          NUMBER[] elements = new NUMBER[c == null ? 0 : c.size()];
          if (elements.length > 0 )
            Iterator iter = c.iterator();
            for (int i = 0; iter.hasNext(); i++)
              elements[i] = new NUMBER(iter.next().toString());
          return new ARRAY(numberList, connection, elements);
        catch (Exception ex)
          ex.printStackTrace();
          return null;
      protected Connection getConnection(DBTransaction dbTransaction)
        //return null;
        debug("Inside getConnection()");
        CallableStatement s = null;
        try
           * Getting Conenction in BC4J is dirty but its better
           * as otherwise we might end up coding with connections
           * and the Transaction Integrety will be
          s = dbTransaction.createCallableStatement("BEGIN NULL; END;", 0);
          debug("DOING s.getConnection()...");
          Connection conn = s.getConnection();
          debug("DONE WITH  s.getConnection()...");
          /*try
                throw new Exception("TEST");
           catch (Exception ex)
                ex.printStackTrace(System.out);
          debug("conn CLASS - " + conn.getClass());
          return conn;
        catch (Exception ex)
          ex.printStackTrace();
          return null;
        finally
          try { s.close(); }
          catch (Exception ex) {}
      }Whenever we try setting the parameters in view using setParams() and use this view to set the model of a java control it thorws the following exception :
    [2006-10-10 12:34:48,797 AWT-EventQueue-0 ERROR] JBO-28302: Piggyback write error
    oracle.jbo.PiggybackException: JBO-28302: Piggyback write error
         at oracle.jbo.common.PiggybackOutput.getPiggybackStream(PiggybackOutput.java:185)
         at oracle.jbo.common.JboServiceMessage.marshalRefs(JboServiceMessage.java:267)
         at oracle.jbo.server.remote.PiggybackManager.marshalServiceMessage(PiggybackManager.java:343)
         at oracle.jbo.server.remote.PiggybackManager.marshalServiceMessage(PiggybackManager.java:316)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2283)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteAMReservation_StatefulSessionBeanWrapper906.doMessage(RemoteAMReservation_StatefulSessionBeanWrapper906.java:286)
         at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
         at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
         at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
         at oracle.jbo.common.SvcMsgResponseValues.writeObject(SvcMsgResponseValues.java:116)
         at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
         at oracle.jbo.common.PiggybackOutput.getPiggybackStream(PiggybackOutput.java:173)
         at oracle.jbo.common.JboServiceMessage.marshalRefs(JboServiceMessage.java:267)
         at oracle.jbo.server.remote.PiggybackManager.marshalServiceMessage(PiggybackManager.java:343)
         at oracle.jbo.server.remote.PiggybackManager.marshalServiceMessage(PiggybackManager.java:316)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2283)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteAMReservation_StatefulSessionBeanWrapper906.doMessage(RemoteAMReservation_StatefulSessionBeanWrapper906.java:286)
         at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)This is a typical interaction between 2 server-side components (view-object and app module). Now the question is why is this exception thrown? Any answers?
    This application is one that we have migrated from 904 to 1013 and are trying to get it running in 3-tier.
    Regards,
    Anupam

    Sorry I missed out some semicolons, the script follws:
    -- The following TABLE was created to simulate the issue
    CREATE TABLE TEST_OBJECT
         ASSET_ID NUMBER,
         OBJECT_ID NUMBER,
         NAME VARCHAR2(50)
    INSERT INTO TEST_OBJECT VALUES(1,1,'AAA');
    INSERT INTO TEST_OBJECT VALUES(2,2,'BBB');
    INSERT INTO TEST_OBJECT VALUES(3,3,'CCC');
    COMMIT;
    SELECT * FROM TEST_OBJECT;
    -- The following TYPES was created to simulate the issue
    CREATE OR REPLACE
    TYPE DUTYRESULTOBJECTTAB AS TABLE OF DUTYRESULTOBJECT;
    CREATE OR REPLACE
    type DutyResultObject as object
    ( ASSET_ID number,
      OBJECT_ID number,
      NAME varchar2(150)
    -- The following PACKAGE N FUNCTION was created to simulate the issue
    CREATE OR REPLACE PACKAGE TESTOBJECTPKG
    IS
         FUNCTION OBJECTSEARCH(P_RESOURCE IN NUMBERLIST) RETURN DUTYRESULTOBJECTTAB;
    END;
    CREATE OR REPLACE PACKAGE BODY TESTOBJECTPKG
    IS
         FUNCTION OBJECTSEARCH(P_RESOURCE IN NUMBERLIST) RETURN DUTYRESULTOBJECTTAB
         IS
           BULKDUTYRESULTOBJECTTAB DUTYRESULTOBJECTTAB;
         BEGIN
           SELECT DUTYRESULTOBJECT(ASSET_ID, OBJECT_ID, NAME)
           BULK COLLECT INTO BULKDUTYRESULTOBJECTTAB
           FROM TEST_OBJECT;
           RETURN BULKDUTYRESULTOBJECTTAB;
         END;
    END;
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • CHECK for duplicate inside a cursor and pass a ouptut parameter in sql server 2008

    Hi All,
    I am inserting a value into a table, Before inserting i am checking that record already exists or not in the target table, If its existsing i am making an entry into errorlog table and set the output parameter to 'errorlog' . This is inside the cursor, as
    il be passing multiple values. Next is I have separate query to get the new record which is not in the target table. Using EXCEPT i get the new record and i insert into a main table. after insertion i set output as 'success'. 
    Here while executing the procedure i pass a duplicate value and a new value. As it is in cursor,first it will insert into errorlog and set output parameter as 'errorlog' .Next it will insert a new record into main table and set output parameter as 'Success'.
    So on completion of the execution of the procedure i get output as success.
    But i should get as errorlog. I should get success only on no errors in the procedure. How i can i achieve this? Please help me.
    Below is my code
    IF NOT EXISTS(SELECT Beginmilepost,BeginTrackName,Endmilepost,EndTrackName
    FROM SSDB_Segment WHERE BeginMilepost>=@BegMP AND EndMilepost<=@EndMP AND SearchID = @SearchID AND Reference = 'Range')
    BEGIN
                     Declare C_Max1 Cursor FOR
    (SELECT Beginmilepost,BeginTrackName,Endmilepost,EndTrackName FROM SSDB_Segment WHERE BeginMilepost = @BegMP AND EndMilepost = @EndMP AND  BeginTrackName = @BegtrkName 
    AND EndTrackName = @EndTrkName  AND SearchID = @SearchID)
      Open C_Max1
      FETCH FROM C_MAX1 INTO @BeginMilepost,@BTrackName,@EndMilepost,@ETrackName
    WHILE(@@FETCH_STATUS=0)
    BEGIN
    IF OBJECT_ID ('tempdb..#temp') IS NOT NULL
    BEGIN
          DROP TABLE #temp
    END--IF
    Select BeginLatitude,BeginLongitude,BeginTrackName,BeginMilepost,BeginMilepostPrefix,BeginMilepostSuffix,EndLatitude,EndLongitude,EndTrackName,EndMilepost,TrainType into #temp
    FROM
    SELECT BeginLatitude= case when @BegLat = 0 THEN NULL ELSE @BegLat end ,BeginLongitude= case when @BegLong=0 THEN NULL ELSE @BEgLong end ,@BTrackName AS BeginTrackName,ROUND(@BeginMilepost ,3) AS BeginMilepost,
    BeginMilepostPrefix= CASE WHEN @BegPrefix = 'null' THEN NULL ELSE @BegPrefix END,BeginMilepostSuffix= CASE WHEN @BegSuffix  = 'null' THEN NULL ELSE @BegSuffix  END,
    EndLatitude=case when @EndLat =0 then NULL else @EndLat end,EndLongitude=case when @Endlong = 0 THEN NULL ELSE @Endlong END,@ETrackName AS EndTrackName,ROUND(@EndMilepost ,3) AS EndMilepost,@TrainType AS TrainType 
    UNION ALL
    select BeginLatitude,BeginLongitude,BeginTrackName,ROUND(BeginMilepost,3) AS BeginMilepost,BeginMilepostPrefix,BeginMilepostSuffix, EndLatitude,EndLongitude,EndTrackName,ROUND(EndMilepost,3) AS EndMilepost,TrainType from SSDB_MaximumPermissibleSpeed)data
    group by  BeginLatitude,BeginLongitude,BeginTrackName,BeginMilepost,EndLatitude,EndLongitude,EndTrackName,EndMilepost,BeginMilepostPrefix,BeginMilepostSuffix,TrainType
    having COUNT(*)>1
    SET @COUNT= (select count(*) from #temp )
    Print @COUNT
    IF @COUNT>=1
    BEGIN
     INSERT INTO ErrorLog_Asset (
                                        ErrorCode,
                                        ErrorMessage,
                                        TableName,
                                        MilepostPrefix,
                                        Milepost
    SELECT
                                     '1',
                                     'Already exists at BeginMp '+ CAST(@BeginMilepost  as varchar) +',EndMp '+ CAST(@EndMilepost as varchar) +' ,Beginlat
    '+CAST(@BegLat   as varchar)
                                     +' ,Endlat '+CAST(@EndLat   as varchar)+', BeginTrackName '+@BTrackName  +' and EndTrackName '+@ETrackName
                                     'MaximumPermissibleSpeed',
                                      CASE WHEN @BegPrefix = 'null' THEN NULL
    ELSE @BegPrefix END ,
    @BeginMilepost  
    SET @output = 'Errorlog'
    END
     IF OBJECT_ID ('tempdb..#Max') IS NOT NULL
    BEGIN
     DROP TABLE #Max
    END--IF
     Select BeginLatitude,BeginLongitude,BeginTrackName,BeginMilepost,BeginMilepostPrefix,BeginMilepostSuffix,EndLatitude,EndLongitude,EndTrackName,EndMilepost,TrainType into #Max from
           (SELECT BeginLatitude= case when @BegLat = 0 THEN NULL ELSE @BegLat end ,BeginLongitude= case when @BegLong=0 THEN NULL ELSE @BEgLong end ,@BTrackName AS BeginTrackName,ROUND(@BeginMilepost ,3)
    AS BeginMilepost,
                  BeginMilepostPrefix= CASE WHEN @BegPrefix = 'null' THEN NULL ELSE @BegPrefix END,BeginMilepostSuffix= CASE WHEN @BegSuffix  = 'null' THEN NULL ELSE @BegSuffix  END,
                  EndLatitude=case when @EndLat =0 then NULL else @EndLat end,EndLongitude=case when @Endlong = 0 THEN NULL ELSE @Endlong END,@ETrackName AS EndTrackName,ROUND(@EndMilepost ,3) AS EndMilepost,@TrainType AS TrainType 
    except
                 select BeginLatitude,BeginLongitude,BeginTrackName,ROUND(BeginMilepost,3) AS BeginMilepost,BeginMilepostPrefix,BeginMilepostSuffix, EndLatitude,EndLongitude,EndTrackName,ROUND(EndMilepost,3) AS EndMilepost,TrainType
    from SSDB_MaximumPermissibleSpeed)data
     Declare C_Max2 Cursor FOR
     Select BeginMilepost,BeginTrackName,EndMilepost,EndTrackName from #Max 
      Open C_Max2
      FETCH FROM C_Max2 INTO  @BeginMP,@BeginTrackName,@EnMP,@EnTrackName
    WHILE(@@FETCH_STATUS=0)
    BEGIN
       IF (Select COUNT(*) from tbl_Trackname )>=1
       BEGIN
     IF (@TrainType IN (SELECT TrainType  FROM SSDB_TrainType )AND (@Speed <>0) AND @BeginMP IS NOT NULL AND @BeginTrackName IS NOT NULL  AND @EnMP IS NOT NULL
     AND @Direction IN (SELECT Direction FROM SSDB_Direction) AND @EnTrackName IS NOT NULL )
     BEGIN-------------
     SET @ID = (Select MAX(MaximumpermissibleSpeedID) from SSDB_MaximumPermissibleSpeed)
    IF @COUNT =0
       BEGIN
                          INSERT INTO SSDB_MaximumPermissibleSpeed
    BeginMilepostPrefix,
    BeginMilepostSuffix,
    BeginMilepost,
    BeginTrackName,
    BeginLatitude,
    BeginLongitude,
    BeginElevation,
    EndMilepostPrefix,
    EndMilepostSuffix,
    EndMilepost,
    EndTrackName,
    EndLatitude,
    EndLongitude,
    EndElevation,
    Direction,
    Speed,
    TrainType,
    Description,
    InsertUser,
    S_ID
                                                     SELECT
      CASE WHEN @BegPrefix = 'null' THEN NULL
      ELSE @BegPrefix END,
                          CASE WHEN @BegSuffix = 'null' THEN NULL
      ELSE @BegSuffix END,
      @BeginMP ,
      @BeginTrackName  ,
      case WHEN @BegLat = 0 THEN NULL
      ELSE @BegLat END,
      CASE WHEN @BegLong=0 THEN NULL
      ELSE @BegLong END ,
      CASE WHEN @BegEle = 0 THEN NULL
      ELSE @BegEle END ,
      CASE WHEN @EndPrefix = 'null' THEN NULL
      ELSE @EndPrefix END,
                          CASE WHEN @EndSuffix = 'null' THEN NULL
      ELSE @EndSuffix END,
      @EnMP ,
      @EnTrackName  ,
      case WHEN @EndLat = 0 THEN NULL
      ELSE @EndLat END,
      CASE WHEN @EndLong=0 THEN NULL
      ELSE @EndLong END ,
      CASE WHEN @EndEle = 0 THEN NULL
      ELSE @EndEle END ,
      @Direction ,
      @Speed ,
      @TrainType ,
      CASE WHEN @Description ='null' THEN NULL
      ELSE @Description END ,
      @InsertUser ,
      @UID     
    INSERT INTO SSDB_MaxSpeed_History
                       MSID,
    BeginMilepostPrefix,
    BeginMilepostSuffix,
    BeginMilepost,
    BeginTrackName,
    BeginLatitude,
    BeginLongitude,
    BeginElevation,
    EndMilepostPrefix,
    EndMilepostSuffix,
    EndMilepost,
    EndTrackName,
    EndLatitude,
    EndLongitude,
    EndElevation,
    Direction,
    Speed,
    TrainType,
    Description,
    S_ID,
    NOTES ,
    [Action] ,
    InsertUser
                                 SELECT 
                          (Select MaximumPermissibleSpeedID from SSDB_MaximumpermissibleSpeed WHERE MaximumPermissibleSpeedID > @ID),
                          CASE WHEN @BegPrefix = 'null' THEN NULL
      ELSE @BegPrefix END,
                          CASE WHEN @BegSuffix = 'null' THEN NULL
      ELSE @BegSuffix END,
      @BeginMP ,
      @BeginTrackName  ,
      case WHEN @BegLat = 0 THEN NULL
      ELSE @BegLat END,
      CASE WHEN @BegLong=0 THEN NULL
      ELSE @BegLong END ,
      CASE WHEN @BegEle = 0 THEN NULL
      ELSE @BegEle END ,
      CASE WHEN @EndPrefix = 'null' THEN NULL
      ELSE @EndPrefix END,
                          CASE WHEN @EndSuffix = 'null' THEN NULL
      ELSE @EndSuffix END,
      @EnMP ,
      @EnTrackName  ,
      case WHEN @EndLat = 0 THEN NULL
      ELSE @EndLat END,
      CASE WHEN @EndLong=0 THEN NULL
      ELSE @EndLong END ,
      CASE WHEN @EndEle = 0 THEN NULL
      ELSE @EndEle END ,
      @Direction ,
      @Speed ,
      @TrainType ,
      CASE WHEN @Description ='null' THEN NULL
      ELSE @Description END ,
      @UID,
      NULL,
      'INSERT',
      @InsertUser 
    set @output='Success'
    --IF ((@COUNT >=1) AND (@COUNT =0))
    --BEGIN
    --  SET @output = 'ErrorLog'
    --END
    --IF (@COUNT = 0)
    -- BEGIN
    --SET @output ='Success'
    --END
    --END
    END
    END------------------------> 
    Deepa

    Hi Deepa,
    If I understand your question correctly, you would like the @Output parameter to contain the value "Success" only if all rows were successful. As soon as one row was found to be a duplicate, the value of @Output at the end of execution should be "ErrorLog".
    Currently, you modify the value of @Output in each iteration of the cursor, so at the end of execution you're left with the last value.
    In order to change that to work the way you want it, you need to set the value of @Output in the beginning of execution (before entering the cursor) to "Success", and as soon as there is a duplicate row, you should modify the value to "ErrorLog". This way,
    if all rows are successful, the value of @Output will be "Success" at the end of execution. On the other hand, if there is even a single duplicate row, the value of @Output will be "ErrorLog" at the end of execution.
    I hope this helps...
    Guy Glantser
    SQL Server Consultant & Instructor
    Madeira - SQL Server Services
    http://www.madeirasql.com

  • Method of getting values from parameter ID to a form

    Hi,
       Is it possible to get the value of a parameter ID from a FORM? If so, can you please give me the code to do it.
    Thanks
    Lilan

    User, please tell us your jdev version!
    Not sure I understand your use case correctly. However it sounds like you use a master VO as a table and select one row to show the details from a different VO.
    In this case I outlined a solution here: Using diferent VOs for Master Detail Navigation (the Declatative Way) | JDev &amp;amp; ADF Goodies
    Navigation on the detail will not work as there is only one row (the selected one) in the iterator.
    Timo

  • JRC for Crystal Reports for Eclipse V2.0 Parameter Problems

    Scenario:
    I have a report that displays the Function Group Name for a certain individual and all the Functions included in that Function Group. The following are the tables involved:
    USER, FUNC_GROUP (contains description of the group) and FUNC_GROUP_LIST (the actual functions in the FUNC_GROUP).
    The SQL command for the main report is: select id, name, description from FUNC_GROUP, USER where FUNC_GROUP.id = USER.default_func_group_id
    The sub-report which lists the functions for the Function Group has the following SQL command: select id, name from FUNC where func_group_id = <main report's FUNC_GROUP.id>
    The problem is my current code still flags missingParameterValueError error whenever I changed the DB location and set the parameters.
    Code used for setting of db connection:
    private void setDBConnection(ReportClientDocument doc) throws ReportSDKException {
        IConnectionInfo newConnectionInfo = new ConnectionInfo();
        newConnectionInfo.setAttributes(new PropertyBag(connectionProperty));
        newConnectionInfo.setUserName(getLoginname());
        newConnectionInfo.setPassword(getPassword());
        //preserve subreport links
        SubreportController src = doc.getSubreportController();
        Map<String, SubreportLinks> linkMapper = new HashMap<String,SubreportLinks>();
        for(String subreportName : src.getSubreportNames()){
            linkMapper.put(subreportName,
                (SubreportLinks) src.getSubreportLinks(subreportName).clone(true));
        //If this connection needed parameters, we would use this field. 
        Fields<IParameterField> pFields = doc.getDataDefController().getDataDefinition().getParameterFields();
        replaceConnectionInfos(doc.getDatabaseController(), newConnectionInfo, pFields);
        IStrings strs = src.getSubreportNames();
        Iterator<String> it = strs.iterator();
        while (it.hasNext()) {
          String name = it.next();
          ISubreportClientDocument subreport = src.getSubreport(name);
          pFields = subreport.getDataDefController().getDataDefinition().getParameterFields();
          replaceConnectionInfos(subreport.getDatabaseController(), newConnectionInfo, pFields);
        //reconnect subreport links since when using replaceConnection links are erased
        for(String subreportName : src.getSubreportNames())
          src.setSubreportLinks(subreportName, linkMapper.get(subreportName));
    Edited by: Rizza Lynn Ponce on Jun 2, 2009 11:56 AM

    >
    Ted Ueda wrote:
    > Do you look at the report links you're saving before the connection changes, to see if it's being saved, and added back?  It'll be interesting what type of link it is.
    I've run the program in debug mode and inspected the following:
    src.getSubreportLinks(subreportName).getSubreportLink(0).getSubreportFieldName()
    src.getSubreportLinks(subreportName).getSubreportLink(0).getMainReportFieldName()
    src.getSubreportLinks(subreportName).getSubreportLink(0).getLinkedParameterName()
    before the change in connection and after the change in connection in both main and subreport and after adding back the links. The values monitored did not change.
    Am I looking at the correct things? Or is there another value I need to monitor?
    >
    > Is it possibly to a stored proc parameter that is no longer there in the subreport after the database change?
    I am not using any stored procs, I just formulated an SQL for retrieval in both main and subreport.
    >
    > If so, you'd need to redefine the link before applying.
    >
    > Sincerely,
    >
    > Ted Ueda
    What do you mean redefine?
    Additional info:
    The current template I'm using accepts the value from main report (FUNC_GROUP.id) which is in turn used as a parameter in the SQL command in the subreport. This throws an error when exporting via JRC.
    However, I tried some modifications in the SQL command in the subreport. I've included the Function Group ID in the select clause (select id, name, func_group_id from FUNC) instead of using it in the where clause. Then in the linking of the main and the subreport, I chose filter data in subreport by func_group_id matching FUNC_GROUP.id in main report. Exporting in JRC this report worked well and deliver the same data as the original template. The problem is I think it takes longer because all data in FUNC table is retrieved. And also as a framework developer, I prefer not limiting the developers regarding the style on how they connect main and subreport in CRW (I'd personally say I'm more fond of using the original template as I think the modified template retrieves unneeded data).

  • Crystal Report Viewer 11.5 Java SDK - How to set sub report parameter value

    Good day!
    I have a report with 3 sub-reports in the detail section. Main report has two parameters and each sub-report has one parameter in turn. We have our own JSP to receive parameter values from the user. I am using the following code to do the parameter value setting later into the report. Parameter value setting works for main report, but not for the sub-report.
    I get an Error, for the first sub-report, from the viewer saying:
    The parameter 'parametername' does not allow null values
    On this article: [article link|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap%28bd1lbizjptawmq==%29/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313337333233323331%7D.do]
    It says to set the report name of the parameter field to the name of the sub report. On this aspect, assuming this tip/solution works, I would like to read the names of the sub-reports and their parameter names. I do not want to hard-code them into our application.
    Here is my current code:
    sdk.occa.report.data.Fields parameterFields = new Fields();
    I have a HashMap of <parameterName, parameterValue>
    Iterate through the map
    report.data.ParameterField aParameterField = new ParameterField();
    aParameterField.setReportName(""); //main report
    report.data.Values theValues = new Values();
    ParameterFieldDiscreteValue aParameterFieldDiscreteValue = new ParameterFieldDiscreteValue();
    aParameterFieldDiscreteValue.setValue (aValue);
    theValues.add(aParameterFieldDiscreteValue);
    aParameterField.setName(parameterName)
    aParameterField.setCurrentValues(theValues);
    parameterFields.add(aParameterField);
    viewer.setParameterFields(parameterFields);
    Please look at the line:
    aParameterField.setReportName(""); //main report
    Here's where I would like to say
    if (parameter is subreport's parameter) then setReportName(subreport name);
    Thx

    It was little difficult to navigate down the objects to find the sub reports and their parameters. I am attaching the code:
    May be there are other ways to do the same.
    public String getReportNameForParameter (String parameterName, ReportClientDocument reportClientDoc)
            String result = "";
            boolean found = false;
            try {
                SubreportController src = reportClientDoc.getSubreportController();
                DataDefController ddc = reportClientDoc.getDataDefController();
                IDataDefinition idd = ddc.getDataDefinition();
                Fields fs = idd.getParameterFields();
                Iterator fiter = fs.iterator();
                while (fiter.hasNext()) {
                    IField ifld = (IField) fiter.next();
                    if (parameterName.equals(ifld.getName())) {
                        found = true;
                    //System.out.println ("\t Field Name/Description/HeadingText: " + ifld.getName() + "/" + ifld.getDescription() + "/" + ifld.getHeadingText());
                if (!found) {
                    IStrings reportNames = src.getSubreportNames();
                    //System.out.println ("  Sub Reports If Any ...");
                    if (reportNames != null) {
                        Iterator iter = reportNames.iterator();
                        while (iter.hasNext()) {
                            String repName = (String) iter.next();
                            //System.out.println ("\t Sub Report Name " + repName);
                            ISubreportClientDocument srcd = src.getSubreport(repName);
                            ddc = srcd.getDataDefController();
                            idd = ddc.getDataDefinition();
                            fs = idd.getParameterFields();
                            fiter = fs.iterator();
                            while (fiter.hasNext()) {
                                IField ifld = (IField) fiter.next();
                                if (parameterName.equals(ifld.getName())) {
                                    result = repName;
                                    break;
                                //System.out.println ("\t\t Field Name/Description/HeadingText: " + ifld.getName() + "/" + ifld.getDescription() + "/" + ifld.getHeadingText());
            //System.out.println ("********************************************************** ");
            catch (Exception exc) {
                System.out.println ("Error/Exception while trying to find the report name for parameter [" + parameterName + "]");
                System.out.println ("*******************************************************************************************");
                exc.printStackTrace();
            return result;

  • How to get the value of a parameter/field in a ADF Read-Only Form

    Hi,
    My requirement is as follows. Could anyone shed some light on this issue.
    I am showing the records from db table using ADF Read-Only Form ( which uses ViewObject created for the table). Now I want to capture(get) the value of a field in this form and then have to invoke an action based on the value in this field. I mean to say the next page depends the value of a field in this form.
    Please suggest how can I achieve this functionality?
    Thanks in advance.
    ~Sivaji

    That's indeed what Sivaji needs.
    In the page definition you can add a value to the parameters of a certain method. Like RJundi mentioned, point to the attribute of the current row.
    Example:
    The value of the read only textfield will be something like this:
    #{bindings.EmployeeName.inputValue}points to an attribute value in the pageDef of the page:
        <attributeValues id="EmployeeName" IterBinding="AllEmployees">
          <AttrNames>
            <Item Value="EmployeeName"/>
          </AttrNames>
        </attributeValues>The attribute value has also an iterator binding defined in the page def:
        <iterator id="AllEmployees" RangeSize="10"
                  Binds="AllEmployees" DataControl="MyService"/>If you want to 'pass' the attribute of the current row to the service, you can create a methodaction (eg: public void printEmpName(String name)) in the page def or you can drop the method from the datacontrol on to the page. After dropping the method, a screen will appear asking to fill in a value for the parameter ('name' in this example). Fill in '#{bindings.EmployeeName.inputValue}' if you want to pass the EmployeeName of the current row.
    Hope it helps,
    Koen Verhulst

  • [HELP] using multiple value parameter in c:import tag

    I need to pass a multi-value parameter to a included page. e.g.
    http://myhost/MyContext/dir1/page1.jsp?abc=value1&abc=value2/dir1/page1.jsp includes /dir2/page2.jsp, and would like to pass this multi-value parameter over, but change the name to xyz, some what like
    <c:import url="/dir2/page2.jsp?xyz=value1&xyz=value2"/>The problem is that the number of values is not fix number, so I have to write some logic to iterate thru its parameter values. But the <c:import> tag body allows only simple listed <c:param> tags, it doesn't allow other logic/condition/iteration.
    <!-- gives java.io.IOException: javax.servlet.jsp.JspException: The taglib validator rejected the page: "Illegal child tag in "c_rt:import" tag: "c:forEach" tag at runtime -->
    <c:import url="/dir2/page2.jsp">
    <c:forEach var="xyz" items="${paramValues.abc}">
    <c:param name="xyz" value="${xyz}"/>
    </c:forEach>
    </c:import>{code}
    I also tried <c:url> tag. The good news is that it supports jsp logic in body:
    {code}<c:url var="url" value="/dir2/page2.jsp">
    <c:forEach var="xyz" items="${paramValues.abc}">
    <c:param name="xyz" value="${xyz}"/>
    </c:forEach>
    </c:url>
    <c:out value="${url}"/>{code}but it prefixes the url with the current context:
    {code}/MyContext/dir2/page2.jsp?xyz=value1&xyz=value2{code}
    Now I run into a dead end. It seems the only way out is to use <% %> scriptlet to do my own url composite, which is pretty similar to <c:url> but avoid the context part.
    Any suggestion?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    out.println("<html>");
    out.println("<head>");
    out.println("<script language=\"JavaScript\">");
    out.println("function altSubmit() {");
    out.println("document.MyForm.action = \"Second.html\";");
    out.println("document.MyForm.submit();");
    out.println("}");
    out.println("</script>");
    out.println("</head>");
    out.println("<body>");
    My personal suggestion is to use follow the MVC (Model View Control) pattern where in you can write all your "html" part in a JSP.
    Model -> Bean
    View -> JSP
    Control -> Servlet

  • How to assign the default value to search parameter

    Hi Experts,
    I am using search view , In this I have 5 parameter lets say Transaction Type, Partner No. etc... Now I want to assign a default value to transaction type ( lets say TA) . User should be able to see this default value in the transaction type field before pressing search button.
    How can I do it?
    My second problem is: I have configured this search view using configuration tool but I want to assign only one value to transaction type (i.e. user should not be able to add new row in the search criteria for the transaction type by using + sign)  but in rest 4 fields he can add new row and search based on that.
    Note: I am using only "Is" criteria .
    Any pointer will be helpful for me
    Thanks and regards,
    Sandeep

    Hi Sandeep,
    For the default search values, here is a solution. You have to redefine the method GET_VALUE1 of the context node
    For example if it is the BP search (component BP_HEAD_SEARCH) context node is your enhanced class: ZL_BP_HEAD__MAINSEARCH_CN00
    METHOD get_value1.
      CALL METHOD super->get_value1
        EXPORTING
          attribute_path = attribute_path
          iterator       = iterator
        RECEIVING
          value          = value.
      TRY.
    *     Delegate operation to selection parameter
          DATA: current TYPE REF TO if_bol_bo_property_access.
          IF iterator IS BOUND.
            current = iterator->get_current( ).
          ELSE.
            current = me->parameter_collection->get_current( ).
          ENDIF.
          IF current->get_property_as_string( iv_attr_name = 'ATTR_NAME' ) EQ 'XXX'.
            IF value IS INITIAL.
              value = 'Your default value'.
            ENDIF.
          ENDIF.
        CATCH cx_root.
      ENDTRY.
    ENDMETHOD.
    where XXX is the name of the field.
    Default value will then appear in your search field, but you are still able to modify it if you want...
    Regards,
    Fabian

  • Passing a parameter from one class to another class in the same package

    Hi.
    I am trying to pass a parameter from one class to another class with in a package.And i am Getting the variable as null every time.In the code there is two classes.
    i. BugWatcherAction.java
    ii.BugWatcherRefreshAction.Java.
    We have implemented caching in the front-end level.But according to the business logic we need to clear the cache and again have to access the database after some actions are happened.There are another class file called BugwatcherPortletContent.java.
    So, we are dealing with three java files.The database interaction is taken care by the portletContent.java file.Below I am giving the code for the perticular function in the bugwatcherPortletContent.java:
    ==============================================================
    public Object loadContent() throws Exception {
    Hashtable htStore = new Hashtable();
    JetspeedRunData rundata = this.getInputData();
    String pId = this.getPorletId();
    PortalLogger.logDebug(" in the portlet content: "+pId);
    pId1=pId;//done by sraha
    htStore.put("PortletId", pId);
    htStore.put("BW_HOME_URL",CommonUtil.getMessage("BW.Home.Url"));
    htStore.put("BW_BUGVIEW_URL",CommonUtil.getMessage("BW.BugView.Url"));
    HttpServletRequest request = rundata.getRequest();
    PortalLogger.logDebug(
    "BugWatcherPortletContent:: build normal context");
    HttpSession session = null;
    int bugProfileId = 0;
    Hashtable bugProfiles = null;
    Hashtable bugData = null;
    boolean fetchProfiles = false;
    try {
    session = request.getSession(true);
    // Attempting to get the profiles from the session.
    //If the profiles are not present in the session, then they would have to be
    // obtained from the database.
    bugProfiles = (Hashtable) session.getAttribute("Profiles");
    //Getting the selected bug profile id.
    String bugProfileIdObj = request.getParameter("bugProfile" + pId);
    // Getting the logged in user
    String userId = request.getRemoteUser();
    if (bugProfiles == null) {
    fetchProfiles = true;
    if (bugProfileIdObj == null) {
    // setting the bugprofile id as -1 indicates "all profiles" is selected
    bugProfileIdObj =(String) session.getAttribute("bugProfileId" + pId);
    if (bugProfileIdObj == null) {
    bugProfileId = -1;
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    session.setAttribute(
    ("bugProfileId" + pId),
    Integer.toString(bugProfileId));
    //fetching the bug list
    bugData =BugWatcherAPI.getbugList(userId, bugProfileId, fetchProfiles);
    PortalLogger.logDebug("BugWatcherPortletContent:: got bug data");
    if (bugData != null) {
    Hashtable htProfiles = (Hashtable) bugData.get("Profiles");
    } else {
    htStore.put("NoProfiles", "Y");
    } catch (CodedPortalException e) {
    htStore.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    PortalLogger.logException
    ("BugWatcherPortletContent:: CodedPortalException!!",e);
    } catch (Exception e) {
    PortalLogger.logException(
    "BugWatcherPortletContent::Generic Exception!!",e);
    htStore.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.GET_BUGLIST_FAILED));
    if (fetchProfiles) {
    bugProfiles = (Hashtable) bugData.get("Profiles");
    session.setAttribute("Profiles", bugProfiles);
    // putting the stuff in the context
    htStore.put("Profiles", bugProfiles);
    htStore.put("SelectedProfile", new Integer(bugProfileId));
    htStore.put("bugs", (ArrayList) bugData.get("Bugs"));
    return htStore;
    =============================================================
    And I am trying to call this function as it can capable of fetching the data from the database by "getbugProfiles".
    In the new class bugWatcherRefreshAction.java I have coded a part of code which actually clears the caching.Below I am giving the required part of the code:
    =============================================================
    public void doPerform(RunData rundata, Context context,String str) throws Exception {
    JetspeedRunData data = (JetspeedRunData) rundata;
    HttpServletRequest request = null;
    //PortletConfig pc = portlet.getPortletConfig();
    //String userId = request.getRemoteUser();
    /*String userId = ((JetspeedUser)rundata.getUser()).getUserName();//sraha on 1/4/05
    String pId = request.getParameter("PortletId");
    PortalLogger.logDebug("just after pId " +pId);  */
    //Calling the variable holding the value of portlet id from BugWatcherAction.java
    //We are getting the portlet id here , through a variable from BugWatcherAction.java
    /*BugWatcherPortletContent bgAct = new BugWatcherPortletContent();
    String portletID = bgAct.pId1;
    PortalLogger.logDebug("got the portlet ID in bugwatcherRefreshAction:---sraha"+portletID);*/
    // updating the bug groups
    Hashtable result = new Hashtable();
    try {
    request = data.getRequest();
    String userId = ((JetspeedUser)data.getUser()).getUserName();//sraha on 1/4/05
    //String pId = (String)request.getParameter("portletId");
    //String pId = pc.getPorletId();
    PortalLogger.logDebug("just after pId " +pId);
    PortalLogger.logDebug("after getting the pId-----sraha");
    result =BugWatcherAPI.getbugList(profileId, userId);
    PortalLogger.logDebug("select the new bug groups:: select is done ");
    context.put("SelectedbugGroups", profileId);
    //start clearing the cache
    ContentCacheContext cacheContext = getCacheContext(rundata);
    PortalLogger.logDebug("listBugWatcher Caching - removing markup content - before removecontent");
    // remove the markup content from cache.
    PortletContentCache.removeContent(cacheContext);
    PortalLogger.logDebug("listBugWatcher Caching-removing markup content - after removecontent");
    //remove the backend content from cache
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(((JetspeedUser)data.getUser()).getUserName()));
    PortalLogger.logDebug("listBugWatcher Caching User: " +((JetspeedUser)data.getUser()).getUserName());
    PortalLogger.logDebug("listBugWatcher Caching pId: " +pId);
    if (pdata != null)
    // User's data found in cache!
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null");
    pdata.removeObject(PortletCacheHelper.getUserPortletHandle(((JetspeedUser)data.getUser()).getUserName(),pId));
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null- after removeObject");
    PortalLogger.logDebug("listBugWatcher Caching -finish calling the remove content code");
    //end clearing the cache
    // after clearing the caching calling the data from the database taking a fn from the portletContent.java
    PortalLogger.logDebug("after clearing cache---sraha");
    BugWatcherPortletContent bugwatchportcont = new BugWatcherPortletContent();
    Hashtable httable= new Hashtable();
    httable=(Hashtable)bugwatchportcont.loadContent();
    PortalLogger.logDebug("after making the type casting-----sraha");
    Set storeKeySet = httable.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, httable.get(paramName));
    PortalLogger.logDebug("after calling the databs data from hashtable---sraha");
    } catch (CodedPortalException e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    catch (Exception e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.EXCEPTION_CODE));
    try {
    ((JetspeedRunData) data).setCustomized(null);
    if (((JetspeedRunData) data).getCustomized() == null)
    ActionLoader.getInstance().exec(data,"controls.EndCustomize");
    catch (Exception e)
    PortalLogger.logException("bugwatcherRefreshAction", e);
    ===============================================================
    In the bugwatcher Action there is another function called PostLoadContent.java
    here though i have found the portlet Id but unable to fetch that in the bugWatcherRefreshAction.java . I am also giving the code of that function under the bugWatcherAction.Java
    ================================================
    // Get the PortletData object from intermediate store.
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(
    //rundata.getRequest().getRemoteUser()));
    ((JetspeedUser)rundata.getUser()).getUserName()));
    pId1 = (String)portlet.getID();
    PortalLogger.logDebug("in the bugwatcher action:"+pId1);
    try {
    Hashtable htStore = null;
    // if PortletData is available in store, get current portlet's data from it.
    if (pdata != null) {
    htStore =(Hashtable) pdata.getObject(     PortletCacheHelper.getUserPortletHandle(
    ((JetspeedUser)rundata.getUser()).getUserName(),portlet.getID()));
    //Loop through the hashtable and put its elements in context
    Set storeKeySet = htStore.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, htStore.get(paramName));
    bugwatcherRefreshAction bRefAc = new bugwatcherRefreshAction();
    bRefAc.doPerform(pdata,context,pId1);
    =============================================================
    So this is the total scenario for the fetching the data , after clearing the cache and display that in the portal.I am unable to do that.Presently it is still fetching the data from the cache and it is not going to the database.Even the portlet Id is returning as null.
    I am unable to implement that thing.
    If you have any insight about this thing, that would be great .As it is very urgent a promt response will highly appreciated.Please send me any pointers or any issues for this I am unable to do that.
    Please let me know as early as possible.
    Thanks and regards,
    Santanu Raha.

    Have you run it in a debugger? That will show you exactly what is happening and why.

  • Invoking Stored Procedure with OUT Parameter

    I am calling a stored procedure that has a "out" parameter of PL/SQL type (table of varchar2) through toplink API. My procedure executes, performs the updates successfully, but I can not obtain the value of the out parameter. Is the approach followed below incorrect? I could not figure out by looking into examples provided in the documentation:
    http://download.oracle.com/docs/cd/B25221_04/web.1013/b25386/building_and_using_application_services009.htm#BCFEFAHC
    Java function is given below:
    public List removeFromAutoupdSched( List srNumbers, String userName)
    if (srNumbers == null || srNumbers.size() == 0)
    return null;
    List result = null;
    try
    //Example Stored procedure call with an output parameter
    DatabaseLogin login = m_dbSess.getLogin();
    Connection conn = (Connection) (java.sql.Connection)login.connectToDatasource(null);
    oracle.sql.ArrayDescriptor arrDesc = new oracle.sql.ArrayDescriptor("AUTOUPD_SRLIST_T", conn);
    oracle.sql.ARRAY srARR = new oracle.sql.ARRAY(arrDesc, conn, srNumbers.toArray());
    StoredProcedureCall procCall = new StoredProcedureCall();
    procCall.setProcedureName("SEW_AUTOUPD.PURGE_AUTOUPD_SCHEDULE");
    procCall.addNamedArgumentValue("excludeSRlist", srARR);
    procCall.addNamedArgumentValue("exclude_by", userName);
    procCall.addNamedOutputArgument(
    "excludeSR_srlist_status",
    "excludeSR_srlist_status",
    OracleTypes.ARRAY,
    "AUTOUPD_SRLIST_ERRS_T"
    ValueReadQuery vq = new ValueReadQuery();
    vq.setCall(procCall);
    oracle.sql.ARRAY srResultARR = (oracle.sql.ARRAY)m_dbSess.executeQuery(vq);
    if (srResultARR != null)
    String[] msgs = (String[])srResultARR.getArray();
    if (msgs.length > 0)
    result = Arrays.asList(msgs);
    Iterator iter = result.iterator();
    while (iter.hasNext())
    System.out.println("msg = " + iter.next());
    return result;
    catch (Exception exc)
    throw new RuntimeException(exc);
    PL/SQL Type
    create or replace TYPE autoupd_srlist_errs_t IS TABLE OF VARCHAR2(150);
    Sample procedure called by toplink:
    PROCEDURE purge_autoupd_schedule(
    excludeSRlist autoupd_srlist_t,
    exclude_by VARCHAR2,
    excludeSR_srlist_status OUT NOCOPY autoupd_srlist_errs_t)
    IS
    pkg sew_log.pkg_name%TYPE default upper('sew_autoupd');
    prc sew_log.prc_name%TYPE default upper('purge_autoupd_schedule(excludeSRlist, exclude_by)');
    srno NUMBER;
    -- cnt NUMBER := 0;
    exclude_status VARCHAR2(150);
    err_prefix VARCHAR2(50) := 'Unable to exclude from autoupdate, ';
    BEGIN
    FOR i IN excludeSRlist.FIRST..excludeSRlist.LAST
    LOOP
    BEGIN
    srno := excludeSRlist(i);
    -- Update actn_taken column in autoupd_schedule before doing delete.
    UPDATE autoupd_schedule SET actn_taken='Removed by engineer', UPD_TIME=systimestamp
    WHERE sr_no = srno and engr_itsid = exclude_by;
    -- Add SR to exclusion list.
    INSERT INTO autoupd_exclude(sr_no, exclude_by, exclude_time) VALUES (srno, exclude_by, systimestamp);
    exclude_status := 'Item ' || i || ' - SR ' || srno || ' - ' || 'Excluded from autoupdate.';
    excludeSR_srlist_status(i) := exclude_status;
    EXCEPTION
    WHEN others THEN
    -- Add SR to excludeSR_fail if previous steps occurred okay.
    -- cnt := cnt +1;
    exclude_status := 'Item ' || i || ' - SR ' || srno || ' - ' || err_prefix || substr(sqlerrm,12);
    excludeSR_srlist_status(i) := exclude_status;
    END;
    END LOOP;
    EXCEPTION
    WHEN others THEN
    sew_logger.log(
    code => substr(sqlerrm,1,9),
    msg => substr(sqlerrm,12),
    pkg => pkg,
    prc => prc
    END;
    Any help is appreciated.

    What happens if you run the stored procedure through pure jdbc (without TopLink)?
    I tried a simple example that worked for me:
    //defined type in the db
    CREATE TYPE "TEST"."VAR_LIST" AS  TABLE OF VARCHAR2(150)
    //defined stored procedure in the db
    CREATE OR REPLACE  PROCEDURE "TEST"."VAR_LIST_IN_OUT"  (
    VARS_IN VAR_LIST,
    VARS_OUT OUT NOCOPY VAR_LIST
    as
    begin
      VARS_OUT := VAR_LIST();
      FOR i IN VARS_IN.FIRST..VARS_IN.LAST LOOP
        VARS_OUT.EXTEND;
        VARS_OUT(i) := CONCAT(VARS_IN(i), '_BLAH');
      END LOOP;
    end;
    // Java code
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("VAR_LIST_IN_OUT");
    Connection conn = (Connection) ((oracle.toplink.internal.sessions.AbstractSession)getSession()).getAccessor().getConnection();
    oracle.sql.ArrayDescriptor arrDesc = new oracle.sql.ArrayDescriptor("VAR_LIST", conn);
    oracle.sql.ARRAY srARR = new oracle.sql.ARRAY(arrDesc, conn, new String[]{"A1", "A2", "A3"});
    call.addNamedArgumentValue("VARS_IN", srARR);
    call.addNamedOutputArgument("VARS_OUT", "VARS_OUT", Types.ARRAY, "VAR_LIST");
    ValueReadQuery query = new ValueReadQuery();
    query.setCall(call);
    Object result = getSession().executeQuery(query);
    Object[] array = (Object[])((java.sql.Array)result).getArray();
    for(int i=0; i<array.length; i++) {
        System.out.println(array);
    // System.out:
    [TopLink Finest]: 2008.04.25 15:37:16.687--DatabaseSessionImpl(3491657)--Thread(Thread[main,5,main])--Execute query ValueReadQuery()
    [TopLink Fine]: 2008.04.25 15:37:16.703--DatabaseSessionImpl(3491657)--Connection(29118152)--Thread(Thread[main,5,main])--BEGIN VAR_LIST_IN_OUT(VARS_IN=>?, VARS_OUT=>?); END;
         bind => [oracle.sql.ARRAY@323274, => VARS_OUT] (There is no English translation for this message.)
    A1_BLAH
    A2_BLAH
    A3_BLAH
    My stored procedure didn't work (on Oracle 9 db) without output collection initialization: VARS_OUT := VAR_LIST(); and extending: VARS_OUT.EXTEND.

Maybe you are looking for

  • Oracle Connectivity in JSP using Tomcat 4

    Dear friends, After installing and configuring the Tomcat 4 I am able to run JSP and Servlats. But I am unable to connect to Oracle database (oracle 8i) using thin driver. Sample code is : <html> <head><title>Test JSP-JDBC</title></head><body> <%@ pa

  • JDeveloper 9.0.2 crash on Linux

    Hi Just Downloaded JDeveloper 9.0.2 for my Linux box (Debian 2.2R0 gcc 2.95.4) and after unziping JDevXXX.zip in /usr/local/JDEV9 and configuring jdev.conf to point to JAVA_HOME /usr/local/jbuilder6/jdk1.3.1 After ./jdev when main window shows JDevel

  • Item renderer issue

    Hi, I have a comboBox as item renderer in my datagrid (comboBox item renderer code bellow). 1. How can I remove the first blank item? My comboBox arrayCollection doesn't have 0 item. 2. If I come back to the cell that it was already selected with a v

  • Labview 2013 executable works only on develoment machine?

    Hi all I created an executable so as to distribute my test software but it only runs on the development machine. I have successfully distributed my executables before with labview 2012 on target machines by simply creating the .exe in project explore

  • ISE iPEP + 3rd party device VPN bridge or route mode

    Dear All, I would like to get some advice from the community regarding my idea. We would like to integrate ISE iPEP with a 3rd party VPN device using bridge mode. However i can only find documents describing the following scenarios, - routed mode wit