Need help with disabling fields or hiding rows based on previous field

Hi,
I have a report in a region.
The report has five columns:
Animal type_ Health Issues* Angel Grant Requested?* Granted?* Grant Response Date*
Dog Fleas Yes Yes 02/04/2009
Cat Fleas No
The first time the screen is displayed only the Animal type_ Health Issues* Angel Grant Requested?* columns will appear.
The user will make a selection for 'Angel Grant Requested' from the LOV ('YES', 'NO') and then click on the 'Submit' button.
When the screen returns 'Angel Grant Requested?' will be grayed out so the user cannot change the selection. The user will make a selection for 'Granted?' using LOV ('YES, 'NO') and for 'Grant Response Date' using the calendar.
{color:#ff0000}{color:#0000ff}Here is what I want to do...
If the user selects 'NO' for 'Angel Grant Requested?' then I would like to do one of the following (which ever one is easiest to do) when the screen returns:
1. Disable (gray out) the 'Granted?' and 'Grant Response Date' fields on the screen for the rows that have 'NO' for 'Angel Grant Requested?'
so that the user cannot make any selection, AND update the HEALTH_ISSUES table to
set grant_granted = 'N/A'
grant_response_date = sysdate
WHERE animal_issue_type_id = AI_ID;
2. Do not display the rows that have 'NO' for 'Angel Grant Requested?'
{color}
Can you please provide code samples to do this?
{color:#ff0000}*I tried to use javascript to gray out the columns, the problem I have is with the hidden f02 column (Angel Grant Requested) that I created on the report so that javascript could read the value. columns are being disabled as desired but the database table is not updating properly...*
{color:#ff0000}*For the rows where the user selected 'YES' for 'Angel Grant Requested?' we need to update the table with the 'Granted?' and 'Grant Response Date' values. These values are somehow being put on the row where the user selected 'NO' for 'Angel Grant Requested?'.*
This happens in the UPDATE_ISSUES PL/SQL after When :P6_DSP_REQUESTED = 'DSPGRANTED'{color}
Below is the Javascript function that is in HTML HEADER:_
</script>
<script language="JavaScript1.1" type="text/javascript">
function checkAngelGrant()
var col2=document.forms[0].f02; /* angel grant requested */
var col3=document.forms[0].f03; /* angel grant granted */
var col4=document.forms[0].f04; /* grant response date */
for (i=0;i<col2.length;i++)
var col2Check = col2+.value; /* read the hidden angel grant requested field */+
+/* checks the hidden angel grant requested field+
if no then we need to disable the angel grant granted field and the angel response date field.
if (col2Check == 'NO')
+{+
col3.disabled=true; /* angel grant granted (Yes No) */
col4.disabled=true; /* angel response date
Below is the UPDATEISSUES PL/SQL process that is run on After Submit:_*
DECLARE
ai_id NUMBER;
vgrant_requested VARCHAR2(3);
vgrant_grnted VARCHAR2(3);
vgrant_respdate DATE;
f01 = Animal Issue Type ID
f02 = grant requested ('YES','NO')
F03 = grant granted ('YES','NO')
F04 = grant response date
P6_DSP_REQUESTED = DSPGRANTED display region with grant_granted and grant_respdate
P6_DSP_REQUESTED = DSPREQUESTED display region with grant_requested only
P6_DSP_REQUESTED = BIFNOCHG cannot change any of the fields that have already been set
BEGIN
IF :P6_DSP_BEQUESTED = 'DSPREQUESTED' then -- Allow setting of grant_requested value only
FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
ai_id := HTMLDB_APPLICATION.G_F01(i); -- animal_issue_type_id This is hidden
vgrant_requested := HTMLDB_APPLICATION.G_F02(i); -- grant_requested (YES or NO)
UPDATE HEALTH_ISSUE_TYPES
SET grant_requested = vgrant_requested
WHERE animal_issue_type_id = AI_ID;
COMMIT;
END LOOP;
elsif :P6_DSP_REQUESTED = 'DSPGRANTED' then -- grant_granted and grant_response_date
FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
ai_id := HTMLDB_APPLICATION.G_F01(i); -- animal_issue_type_id This is hidden
vgrant_grnted := HTMLDB_APPLICATION.G_F02(i); -- grant_granted (YES or NO)
vgrant_respdate := to_date(HTMLDB_APPLICATION.G_F03(i),'MM/DD/YYYY');
UPDATE HEALTH_ISSUE_TYPES
SET grant_granted = vgrant_grnted,
grant_response_date = vgrant_respdate
WHERE animal_issue_type_id = AI_ID;
COMMIT;
END LOOP;
end if;
END;

It's actually three reports that get run during different stages of the screen.
When the user first enters the screen the data is populated from the REQUESTED REPORT sql:
SELECT hit.animal_issue_type_id, at.animal_type_desc, it.issue_type_desc, hit.grant_requested
FROM health_issue_types hit, animal_types at,issue_types it
WHERE hit.animal_type_id = at.animal_type_id
AND hit.issue_type_id = it.issue_type_id
AND hit.file_no = :P6_FILE_NO;
The user will make a selection from the LOV select list (Yes, No) for the grant_requested field and then click on the Submit button.
{color:#ff0000}*If the user selects 'NO' for this field then I want to disable the grant_granted and grant_response_date fields when the screen is populated from the ISSUES REPORT sql. If this cannot be easily done then I would like to hide the entire row when 'NO' has been selected for the grant_requested field.*{color}
When the screen returns the data is populated from the ISSUES REPORT sql:
ISSUES REPORT
SELECT hit.animal_issue_type_id, at.animal_type_desc, it.issue_type_desc, hit.grant_requested,
hit.grant_granted, hit.grant_response_date
FROM health_issue_types hit, animal_types at,issue_types it
WHERE hit.animal_type_id = at.animal_type_id
AND hit.issue_type_id = it.issue_type_id
AND hit.file_no = :P6_FILE_NO;
At this point the grant_requested field will no longer be available for user modification. The user will make a selection from the LOV select list (Yes, No) for the grant_granted, and the grant_response_date fields and then click on the Submit button again.
When the screen returns the data is populated from the ANIMAL DISPLAY ONLY REPORT sql:
ANIMAL DISPLAY ONLY REPORT
SELECT hit.animal_issue_type_id, at.animal_type_desc, it.issue_type_desc, hit.grant_requested,
hit.grant_granted, hit.grant_response_date
FROM health_issue_types hit, animal_types at, issue_types it
WHERE hit.animal_type_id = at.animal_type_id
AND hit.issue_type_id = it.issue_type_id
AND hit.file_no = :P6_FILE_NO;
At this point the grant_requested, grant_granted, and grant_response_date fields will no longer be available for user modification.
{color:#0000ff}Thank you for taking the time to look at my problem.{color}

Similar Messages

  • Beginner needs help with CMR field problem

    Hello,
    I have two ejbs, one called EstablishmentEJB and another called VisitorCommentsEJB. The relationship is of one EstablishmentEJB instance to many VisitorCommentsEJB instances.
    Here are the definitions for the tables:
    CREATE TABLE establishments (
      DB_ESTABLISHMENT_ID int(11) NOT NULL default '0',
      DB_POSTCODE varchar(100) NOT NULL default '',
      DB_ESTABLISHMENT_NAME varchar(255) NOT NULL default '',
      PRIMARY KEY  (DB_ESTABLISHMENT_ID)
    ) TYPE=InnoDB;
    CREATE TABLE visitors_comments (
      DB_VISITOR_COMMENT_ID int(11) NOT NULL auto_increment,
      DB_ESTABLISHMENT_ID int(11) NOT NULL default '0',
      DB_COMMENT varchar(255) NOT NULL default '',
      PRIMARY KEY  (DB_VISITOR_COMMENT_ID)
    ) TYPE=InnoDB;Here are the xml DDs:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    -->
    <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
               http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
               version="2.1">
         <description>test guide</description>
         <display-name>test guide</display-name>
         <enterprise-beans>
              <!--===========Establishment================ -->
              <entity>
                   <ejb-name>EstablishmentEJB</ejb-name>
                   <home>com.softwareag.test_guide.establishmentEJB.PGEstablishmentHome</home>
                   <remote>com.softwareag.test_guide.establishmentEJB.PGEstablishment</remote>
                   <local-home>com.softwareag.test_guide.establishmentEJB.PGEstablishmentLocalHome</local-home>
                   <local>com.softwareag.test_guide.establishmentEJB.PGEstablishmentLocal</local>
                   <ejb-class>com.softwareag.test_guide.establishmentEJB.PGEstablishmentBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Establishment</abstract-schema-name>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>name</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
              </entity>
              <!--===========Grade================ -->
              <entity>
                   <ejb-name>GradeEJB</ejb-name>
                   <home>com.softwareag.test_guide.gradeEJB.PGGradeHome</home>
                   <remote>com.softwareag.test_guide.gradeEJB.PGGrade</remote>
                   <local-home>com.softwareag.test_guide.gradeEJB.PGGradeLocalHome</local-home>
                   <local>com.softwareag.test_guide.gradeEJB.PGGradeLocal</local>
                   <ejb-class>com.softwareag.test_guide.gradeEJB.PGGradeBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Grade</abstract-schema-name>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>grade</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
              </entity>
              <!--===========VisitorsComment================ -->
              <entity>
                   <ejb-name>VisitorCommentEJB</ejb-name>
                   <home>com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentHome</home>
                   <remote>com.softwareag.test_guide.visitorCommentEJB.PGVisitorComment</remote>
                   <local-home>com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentLocalHome</local-home>
                   <local>com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentLocal</local>
                   <ejb-class>com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>VisitorsComment</abstract-schema-name>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>comment</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
              </entity>
              <!--===========Country================ -->
              <entity>
                   <ejb-name>CountryEJB</ejb-name>
                   <home>com.softwareag.test_guide.countryEJB.PGCountryHome</home>
                   <remote>com.softwareag.test_guide.countryEJB.PGCountry</remote>
                   <local-home>com.softwareag.test_guide.countryEJB.PGCountryLocalHome</local-home>
                   <local>com.softwareag.test_guide.countryEJB.PGCountryLocal</local>
                   <ejb-class>com.softwareag.test_guide.countryEJB.PGCountryBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Country</abstract-schema-name>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>countryName</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
              </entity>
              <!--===========Category================ -->
              <entity>
                   <ejb-name>CategoryEJB</ejb-name>
                   <home>com.softwareag.test_guide.categoryEJB.PGCategoryHome</home>
                   <remote>com.softwareag.test_guide.categoryEJB.PGCategory</remote>
                   <local-home>com.softwareag.test_guide.categoryEJB.PGCategoryLocalHome</local-home>
                   <local>com.softwareag.test_guide.categoryEJB.PGCategoryLocal</local>
                   <ejb-class>com.softwareag.test_guide.categoryEJB.PGCategoryBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Category</abstract-schema-name>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>category</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
              </entity>
              <!--===========SearchEngineValueListHandler================ -->
              <session>
                   <ejb-name>PGSearchEngineValueListHandlerEJB</ejb-name>
                   <home>com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandlerHome</home>
                   <remote>com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandler</remote>
                   <local-home>com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandlerLocalHome</local-home>
                   <local>com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandlerLocal</local>
                   <ejb-class>com.softwareag.test_guide.searchEngineEJB.PGSearchEngineValueListHandlerBean</ejb-class>
                   <session-type>Stateful</session-type>
                   <transaction-type>Container</transaction-type>
                    <resource-ref>
                   <res-ref-name>jdbc/test_guia</res-ref-name>
                   <res-type>javax.sql.DataSource</res-type>
                   <res-auth>Application</res-auth>
                   </resource-ref>
              </session>
              <!--===========SessionFacade================ -->
              <session>
                   <ejb-name>PGSessionFacadeEJB</ejb-name>
                   <home>com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeHome</home>
                   <remote>com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacade</remote>
                   <local-home>com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeLocalHome</local-home>
                   <local>com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeLocal</local>
                   <ejb-class>com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <resource-ref>
                   <res-ref-name>jdbc/test_guia</res-ref-name>
                   <res-type>javax.sql.DataSource</res-type>
                   <res-auth>Application</res-auth>
                   </resource-ref>
              </session>
         </enterprise-beans>
         <relationships>
              <!--===========Establishments-VisitorComments================-->
              <ejb-relation>
                   <ejb-relation-name>Establishment-VisitorComment</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Establishment-has-many-comments</ejb-relationship-role-name>
                        <multiplicity>One</multiplicity>
                        <relationship-role-source>
                             <ejb-name>EstablishmentEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>visitorComments</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Comment-belongs-to-Establishment</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>VisitorCommentEJB</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
              </ejb-relation>
              <!--===========Establishments-Grades================-->
              <ejb-relation>
                   <ejb-relation-name>Establishment-Grade</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Establishment-has-many-grades</ejb-relationship-role-name>
                        <multiplicity>One</multiplicity>
                        <relationship-role-source>
                             <ejb-name>EstablishmentEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>grades</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Grade-belongs-to-Establishment</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>GradeEJB</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
              </ejb-relation>
              <!--===========Establishments-Countries================-->
              <ejb-relation>
                   <ejb-relation-name>Country-Establishment</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Country-has-many-establishments</ejb-relationship-role-name>
                        <!--========== One or Many here?? ==========-->
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>CountryEJB</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Establishment-has-many-countries</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>EstablishmentEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>countries</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
              </ejb-relation>
              <!--===========Establishments-Categories ================-->
              <ejb-relation>
                   <ejb-relation-name>Establishment-Category</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Establishment-has-many-categories</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>EstablishmentEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>categories</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>Category-has-many-establishments</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>CategoryEJB</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
              </ejb-relation>
         </relationships>
    </ejb-jar>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <jonas-ejb-jar xmlns="http://www.objectweb.org/jonas/ns"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.objectweb.org/jonas/ns
                http://www.objectweb.org/jonas/ns/jonas-ejb-jar_4_0.xsd" >
    <!--
    <!DOCTYPE jonas-ejb-jar PUBLIC "-//ObjectWeb//DTD JOnAS 3.2//EN" "http://www.objectweb.org/jonas/dtds/jonas-ejb-jar_3_2.dtd">
    <jonas-ejb-jar>
    -->
    <!-- ===============SearchEngineValueListHandler=======================-->
      <jonas-session>
        <ejb-name>PGSearchEngineValueListHandlerEJB</ejb-name>
        <jndi-name>PGSearchEngineValueListHandlerEJBHome</jndi-name>
        <jonas-resource>
          <res-ref-name>jdbc/test_guia</res-ref-name>
          <jndi-name>test_guia</jndi-name>
        </jonas-resource>
      </jonas-session>
      <!-- ===============SessionFacade=======================-->
      <jonas-session>
        <ejb-name>PGSessionFacadeEJB</ejb-name>
        <jndi-name>PGSessionFacadeEJBHome</jndi-name>
         <jonas-resource>
          <res-ref-name>jdbc/test_guia</res-ref-name>
          <jndi-name>test_guia</jndi-name>
        </jonas-resource>
      </jonas-session>
    <!-- ===============Establishment=======================-->
      <jonas-entity>
        <ejb-name>EstablishmentEJB</ejb-name>
        <jndi-name>PGEstablishmentHome</jndi-name>
             <cleanup>none</cleanup>
         <jdbc-mapping>
          <jndi-name>test_guia</jndi-name>
          <jdbc-table-name>ESTABLISHMENTS</jdbc-table-name>
          <cmp-field-jdbc-mapping>
         <field-name>id</field-name>
         <jdbc-field-name>DB_ESTABLISHMENT_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
          <cmp-field-jdbc-mapping>
         <field-name>name</field-name>
    <jdbc-field-name>DB_ESTABLISHMENT_NAME</jdbc-field-name>
          </cmp-field-jdbc-mapping>
        </jdbc-mapping>
    </jonas-entity>
      <!-- ===============Grade=======================-->
        <jonas-entity>
        <ejb-name>GradeEJB</ejb-name>
        <jndi-name>PGgradeHome</jndi-name>
         <cleanup>none</cleanup>
         <jdbc-mapping>
          <jndi-name>test_guia</jndi-name>
          <jdbc-table-name>GRADES</jdbc-table-name>
          <cmp-field-jdbc-mapping>
         <field-name>id</field-name>
         <jdbc-field-name>DB_GRADE_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
          <cmp-field-jdbc-mapping>
         <field-name>grade</field-name>
         <jdbc-field-name>DB_GRADE</jdbc-field-name>
          </cmp-field-jdbc-mapping>
        <!--
         <cmp-field-jdbc-mapping>
         <field-name>establishment_id</field-name>
         <jdbc-field-name>DB_ESTABLISHMENT_ID</jdbc-field-name>
        </cmp-field-jdbc-mapping>
         -->
        </jdbc-mapping>
      </jonas-entity>
      <!-- ===============Visitor�s comments=======================-->
        <jonas-entity>
        <ejb-name>VisitorCommentEJB</ejb-name>
        <jndi-name>PGVisitorCommentHome</jndi-name>
         <cleanup>none</cleanup>
         <jdbc-mapping>
          <jndi-name>test_guia</jndi-name>
          <jdbc-table-name>VISITORS_COMMENTS</jdbc-table-name>
          <cmp-field-jdbc-mapping>
         <field-name>id</field-name>
         <jdbc-field-name>DB_VISITOR_COMMENT_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
          <cmp-field-jdbc-mapping>
         <field-name>comment</field-name>
         <jdbc-field-name>DB_COMMENT</jdbc-field-name>
          </cmp-field-jdbc-mapping>
            <!--
           <cmp-field-jdbc-mapping>
         <field-name>establishment_id</field-name>
         <jdbc-field-name>DB_ESTABLISHMENT_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
         -->
        </jdbc-mapping>
      </jonas-entity>
        <!-- ===============Countries=======================-->
        <jonas-entity>
        <ejb-name>CountryEJB</ejb-name>
        <jndi-name>PGcountryHome</jndi-name>
              <cleanup>none</cleanup>
        <jdbc-mapping>
          <jndi-name>test_guia</jndi-name>
          <jdbc-table-name>COUNTRIES</jdbc-table-name>
          <cmp-field-jdbc-mapping>
         <field-name>id</field-name>
         <jdbc-field-name>DB_COUNTRY_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
          <cmp-field-jdbc-mapping>
         <field-name>countryName</field-name>
         <jdbc-field-name>DB_COUNTRY_NAME_FR</jdbc-field-name>
          </cmp-field-jdbc-mapping>
        </jdbc-mapping>
      </jonas-entity>
      <!-- ===============Categories=======================-->
        <jonas-entity>
        <ejb-name>CategoryEJB</ejb-name>
        <jndi-name>PGcategoryHome</jndi-name>
        <cleanup>none</cleanup>
         <jdbc-mapping>
          <jndi-name>test_guia</jndi-name>
          <jdbc-table-name>CATEGORIES</jdbc-table-name>
          <cmp-field-jdbc-mapping>
         <field-name>id</field-name>
         <jdbc-field-name>DB_CATEGORY_ID</jdbc-field-name>
          </cmp-field-jdbc-mapping>
          <cmp-field-jdbc-mapping>
         <field-name>category</field-name>
         <jdbc-field-name>DB_CATEGORY_NAME_FR</jdbc-field-name>
          </cmp-field-jdbc-mapping>
        </jdbc-mapping>
      </jonas-entity>
      <!--===========Establishments-VisitorComments================-->
      <jonas-ejb-relation>
          <ejb-relation-name>Establishment-VisitorComment</ejb-relation-name>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Comment-belongs-to-Establishment</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_ESTABLISHMENT_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
        </jonas-ejb-relation>
         <!--===========Establishments-Grades================-->
           <jonas-ejb-relation>
          <ejb-relation-name>Establishment-Grade</ejb-relation-name>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Grade-belongs-to-Establishment</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_ESTABLISHMENT_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
        </jonas-ejb-relation>
         <!--===========Establishments-Countries================-->
          <jonas-ejb-relation>
          <ejb-relation-name>Country-Establishment</ejb-relation-name>
          <jdbc-table-name>COUNTRIES_ESTABLISHMENTS</jdbc-table-name>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Country-has-many-establishments</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_ESTABLISHMENT_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Establishment-has-many-countries</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_COUNTRY_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
        </jonas-ejb-relation>
         <!--===========Establishments-Categories ================-->
          <jonas-ejb-relation>
          <ejb-relation-name>Establishment-Category</ejb-relation-name>
          <jdbc-table-name>ESTABLISHMENTS_CATEGORIES</jdbc-table-name>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Establishment-has-many-categories</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_CATEGORY_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
          <jonas-ejb-relationship-role>
            <ejb-relationship-role-name>Category-has-many-establishments</ejb-relationship-role-name>
            <foreign-key-jdbc-mapping>
              <foreign-key-jdbc-name>DB_ESTABLISHMENT_ID</foreign-key-jdbc-name>
            </foreign-key-jdbc-mapping>
          </jonas-ejb-relationship-role>
        </jonas-ejb-relation>
    </jonas-ejb-jar>Here are the two classes for the beans
    package com.softwareag.test_guide.establishmentEJB;
    import java.util.Collection;
    import java.util.Iterator;
    import javax.ejb.CreateException;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import javax.ejb.RemoveException;
    import com.softwareag.test_guide.ejb.util.PGServiceLocator;
    import com.softwareag.test_guide.ejb.util.PGServiceLocatorException;
    import com.softwareag.test_guide.gradeEJB.PGGradeLocal;
    import com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentLocal;
    import com.softwareag.test_guide.visitorCommentEJB.PGVisitorCommentLocalHome;
    * @author Julien Martin
    public abstract class PGEstablishmentBean implements EntityBean {
         public Integer ejbCreate(
              Integer id,
              String name,
              Collection visitorComments,
              Collection grades,
              Collection countries,
              Collection categories)
              throws CreateException {
              setId(id);
              setName(name);
              setVisitorComments(visitorComments);
              setGrades(grades);
              return null;
         public void ejbPostCreate(
              Integer id,
              String name,
              Collection visitorComments,
              Collection grades,
              Collection countries,
              Collection categories) {
              setCountries(countries);
              setCategories(categories);
         //Business methods
         public int getAverageGrade() {
              Collection grades = this.getGrades();
              if (grades.size() == 0) {
                   return 0;
              } else {
                   Iterator iterator = grades.iterator();
                   int total = 0;
                   while (iterator.hasNext()) {
                        PGGradeLocal pGGradeLocal = (PGGradeLocal) iterator.next();
                        Integer amount = pGGradeLocal.getGrade();
                        total = total + amount.intValue();
                   float average = total / grades.size();
                   int roundedAverage = Math.round(average);
                   return roundedAverage;
         public void addComment(Integer id, String comment) {
              try {
                   PGVisitorCommentLocalHome pGcommentHome =
                        (PGVisitorCommentLocalHome) PGServiceLocator.getInstance().getLocalHome("PGVisitorCommentHome_L");
                   PGVisitorCommentLocal pGcomment = pGcommentHome.create(id, comment);
                   Collection pGcomments = this.getVisitorComments();
                   pGcomments.add(pGcomment);
              } catch (PGServiceLocatorException e) {
                   e.printStackTrace();
              } catch (CreateException e) {
                   e.printStackTrace();
         //Persistence fields
         public abstract Integer getId();
         public abstract void setId(Integer id);
         public abstract String getName();
         public abstract void setName(String name);
         //Relation fields
         public abstract Collection getVisitorComments();
         public abstract void setVisitorComments(Collection visitorComments);
         public abstract Collection getGrades();
         public abstract void setGrades(Collection grades);
         public abstract Collection getCountries();
         public abstract void setCountries(Collection countries);
         public abstract Collection getCategories();
         public abstract void setCategories(Collection categories);
         //Callback methods
         public void setEntityContext(EntityContext ec) {
         public void unsetEntityContext() {
         public void ejbLoad() {
         public void ejbStore() {
         public void ejbActivate() {
         public void ejbPassivate() {
         public void ejbRemove() throws RemoveException {
    package com.softwareag.test_guide.visitorCommentEJB;
    import javax.ejb.CreateException;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import javax.ejb.RemoveException;
    * @author Julien Martin
    public abstract class PGVisitorCommentBean implements EntityBean {
         public Integer ejbCreate(Integer id, String comment)throws CreateException {
              setId(id);
              setComment(comment);
              return null;
         public void ejbPostCreate(Integer id, String comment) {}
         //Persistence fields
         public abstract Integer getId();
         public abstract void setId(Integer id);
         public abstract String getComment();
         public abstract void setComment(String comment);
    //     public abstract Integer getEstablishment_id();
    //     public abstract void setEstablishment_id(Integer establishment_id);
         //Callback methods
         public void setEntityContext(EntityContext ec) {}
         public void unsetEntityContext() {}
         public void ejbLoad() {}
         public void ejbStore() {}
         public void ejbActivate() {}
         public void ejbPassivate() {}
         public void ejbRemove() throws RemoveException  {}
    }I get the following error from MYSQL:
    22:57:10,203 : JOnASVisitorCommentEJBBean.ejbPostCreate : Failed to create bean:
    java.sql.SQLException: General error,  message from server: "Column 'DB_ESTABLISHMENT_ID' cannot be null"
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1626)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:886)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:945)
            at com.mysql.jdbc.Connection.execSQL(Connection.java:1844)
            at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1602)
            at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1488)
            at jorm.rdb.mysql.VisitorsCommentBinding.insertVISITORS_COMMENTSTable(VisitorsCommentBinding.java:558)
            at jorm.rdb.mysql.VisitorsCommentBinding.write(VisitorsCommentBinding.java:147)
            at com.softwareag.test_guide.visitorCommentEJB.JOnASVisitorCommentEJBBean.ejbPostCreate(JOnASVisitorCommentEJBBean.java:283)
            at com.softwareag.test_guide.visitorCommentEJB.JOnASVisitorCommentEJBLocalHome.create(JOnASVisitorCommentEJBLocalHome.java:76)
            at com.softwareag.test_guide.establishmentEJB.PGEstablishmentBean.addComment(PGEstablishmentBean.java:71)
            at com.softwareag.test_guide.establishmentEJB.JOnASEstablishmentEJBLocal.addComment(JOnASEstablishmentEJBLocal.java:170)
            at com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeBean.addComment(PGSessionFacadeBean.java:80)
            at com.softwareag.test_guide.sessionFacadeEJB.JOnASPGSessionFacadeEJBLocal.addComment(JOnASPGSessionFacadeEJBLocal.java:168)
            at com.softwareag.test_guide.web.temp.PGBusinessDelegate.addComment(PGBusinessDelegate.java:93)
            at com.softwareag.test_guide.web.temp.PGCommentsManagedBean.addCommentAction(PGCommentsManagedBean.java:13)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
            at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
            at javax.faces.component.UICommand.broadcast(UICommand.java:312)
            at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
            at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
            at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
            at sun.reflect.GeneratedMethodAccessor208.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:241)
            at java.security.AccessController.doPrivileged(Native Method)
            at javax.security.auth.Subject.doAsPrivileged(Subject.java:499)
            at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:263)
            at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
            at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
            at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:140)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:136)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
            at java.lang.Thread.run(Thread.java:536)
    22:57:10,203 : JFactory.postInvoke : system exception in business method:
    javax.ejb.EJBException: Failed to create bean: General error,  message from server: "Column 'DB_ESTABLISHMENT_ID' cannot be null"
            at com.softwareag.test_guide.visitorCommentEJB.JOnASVisitorCommentEJBBean.ejbPostCreate(JOnASVisitorCommentEJBBean.java:288)
            at com.softwareag.test_guide.visitorCommentEJB.JOnASVisitorCommentEJBLocalHome.create(JOnASVisitorCommentEJBLocalHome.java:76)
            at com.softwareag.test_guide.establishmentEJB.PGEstablishmentBean.addComment(PGEstablishmentBean.java:71)
            at com.softwareag.test_guide.establishmentEJB.JOnASEstablishmentEJBLocal.addComment(JOnASEstablishmentEJBLocal.java:170)
            at com.softwareag.test_guide.sessionFacadeEJB.PGSessionFacadeBean.addComment(PGSessionFacadeBean.java:80)
            at com.softwareag.test_guide.sessionFacadeEJB.JOnASPGSessionFacadeEJBLocal.addComment(JOnASPGSessionFacadeEJBLocal.java:168)
            at com.softwareag.test_guide.web.temp.PGBusinessDelegate.addComment(PGBusinessDelegate.java:93)
            at com.softwareag.test_guide.web.temp.PGCommentsManagedBean.addCommentAction(PGComments                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

    Thanks all for replying,
    The error occurs when I run the client and not at deploy time. Here is the client code:
         public void addComment(Integer primaryKey, String comment) {
              System.out.println("primaryKey------>" + primaryKey);
              try {
                   PGEstablishmentLocalHome establishmentHome = (PGEstablishmentLocalHome) PGServiceLocator.getInstance().getLocalHome("PGEstablishmentHome_L");
                   PGEstablishmentLocal establishmentLocal = establishmentHome.findByPrimaryKey(primaryKey);
                   establishmentLocal.addComment(primaryKey,comment);
              } catch (PGServiceLocatorException e) {
                   e.printStackTrace();
              } catch (FinderException e) {
                   e.printStackTrace();
    u haven't defined the PK entry in the Establishment EJB Bean in DDYes look in the standard DD.
    What's more I need both DD as I would with most ejb containers.
    The field DB_ESTABLISHMENT_ID is required and I cannot set it to NULL.
    Any other help greatly appreciated.
    Julien Martin.

  • Need help with a field to increment points

    There is a business need to add points for some of our accounts. Example is that if an account is a training account, we need to add 5 points. If the same account has a special program tied to it, it gets another 3 points, so on and so forth..
    I need to know what kind of a field I can set up for this to capture the points. It seems the field will need to be a calculated field. However, how can I store the matrix?
    Then, we need to run a report to show points by account.
    I'm really in need of help here .. not sure how to address this business need.
    Thanks,
    Anita

    Hi !
    If you only need a report showing your accounts ordered by points, you'll have to build your report and use the CASE WHEN ... THEN ... ELSE ... END function. If you have for example 3 checkboxes when :
    the 1st brings 3 points
    the 2nd brings 7 points
    the 3rd brings 12 points
    You'll have in your report something like :
    Column 1 : Account Name
    Column 2 : Checkbox1 (CASE WHEN checkbox1 = 'Y' THEN 3 ELSE 0 END)
    Column 3 : Checkbox2 (CASE WHEN checkbox2 = 'Y' THEN 7 ELSE 0 END)
    Column 4 : Checkbox3 (CASE WHEN checkbox3 = 'Y' THEN 12 ELSE 0 END)
    Column 5 : Total (Column 2 + Column 3 + Column 4)
    You can easily do the same with picklist values :
    CASE WHEN pick1 = 'val1' THEN 3
    WHEN pick1 ='val2' THEN 8
    ELSE 0 END
    And if you need to display a score on the account detail page, I'll suggest to create a web applet displaying a report calculating the score the same way than above, but with the AccountId as parameter.
    Hope this will help, feel free to ask more !
    Max

  • Need help with string field formula

    Post Author: dshallah
    CA Forum: Formula
    What I am trying to accomplish:
    The report has item numbers and each item number has the
    potential to be associated with up to three u2018binsu2019. So the fields are u2018item
    numberu2019, u2018bin1, u2018bin2u2019 and u2018bin3u2019.
    I tried to write a u2018if thenu2019 statement that would only show
    records that had a value of less than 1 in each u2018binu2019 field. When I try to
    write the statement I get a message that says u2018A string is required hereu2019 and
    it highlights the number 1 in my statement. I have a feeling itu2019s because the u2018binu2019
    fields are string fields and not number fieldsu2026? So I am not sure the proper
    procedure to correct this. Thus help is needed and appreciated.
    Here is what I wrote:
    if {IC_LOC_HIST.BIN_NAME_1} < 1 then
    {IC_LOC_HIST.BIN_NAME_1}
    What is correct way to write a statement that will show me
    the zero values in each column of bin fields?
    Thanks!

    Post Author: bettername
    CA Forum: Formula
    You must have a non-numeric value in there somewhere - up in the top left of the formula editor window, it'll show you the variables you've passed to the formula, which should help track down what's going on.
    You could try and check that the value is a number first by using something like:
    if isnull({IC_LOC_HIST.BIN_NAME_1}) = false and isnumeric({IC_LOC_HIST.BIN_NAME_1}) = false and then "Error - Should be a Number!"
    else
    if isnumeric({IC_LOC_HIST.BIN_NAME_1}) = true and tonumber({IC_LOC_HIST.BIN_NAME_1})<1 then {IC_LOC_HIST.BIN_NAME_1})

  • Need help with inner join and distinct rows

    Hey Guys,
    i have
    1) BaseEnv Table 
    2) Link Table
    3) BaseData Table
    Link table has three columns Id,BaseEnvId,BaseDataId 
    the BaseEnvID is unique in the table where as BaseDataId can be repeated i.e multile rows of BaseEnv Table can point to same BaseData  table row
    Now i want to do  BaseEnvTable inner join Link Table inner join BaseData Table and select 5 columsn ; Name,SyncName,Version,PPO,DOM  from the BaseData table.. the problem is that after i do the inner join I get duplciate records..
    i want to eliminate the duplicate records , can any one help me here

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. Now we have to guess and type, guess and type, etc. because of your bad manners. 
    CREATE TABLE Base_Env
    (base_env_id CHAR(10) NOT NULL PRIMARY KEY,
    Think about the name Base_Data; do you have lots of tables without data? Silly, unh? 
    CREATE TABLE Base_Data
    (base_data_id CHAR(10) NOT NULL PRIMARY KEY,
    Your Links table is wrong in concept and implementation. The term “link” refers to a pointer chain structure used in network databases and makes no sense in RDBMS. There is no generic, magic, universal “id” in RDBMS! People that do this are called “id-iots”
    in SQL slang. 
    We can model a particular relationship in a table by referencing the keys in other tables. But we need to know if the relationship is 1:1, 1:m, or n:m. This is the membership of the relationship. Your narrative implies this: 
    CREATE TABLE Links
    (base_env_id CHAR(10) NOT NULL UNIQUE
       REFERENCES Base_Env (base_env_id),
     base_data_id CHAR(10) NOT NULL
       REFERENCES Base_Data (base_data_id));
    >> The base_env_id is unique in the table where as base_data_id can be repeated I.e multiple rows of Base_Env Table can point [sic] to same Base_Data table row. <<
    Again, RDBMS has no pointers! We have referenced an referencing tables. This is a fundamental concept. 
    That narrative you posted has no ON clauses! And the narrative is also wrong. There is no generic “name”, etc. What tables were used in your non-query? Replace the ?? in this skeleton: 
    SELECT ??.something_name, ??.sync_name, ??.something_version, 
           ??.ppo, ??.dom
    FROM Base_Env AS E, Links AS L, Base_Data AS D
    WHERE ?????????;
    >> I want to eliminate the duplicate records [sic], can any one help me here?<<
    Where is the sample data? Where is the results? Please read a book on RDBMS so you can post correct SQL and try again. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Need help with parameter fields and report selection.

    Hi all:
    I hope some one can help me with the problem I am having with my parameter field and record selection.
    First, can anyone explain to me why my parameter field CustStart, which is dynamic and is based on the field Customer in the table CustMaster.  There are over 1800 records in the CustMaster table but the drop down list only shows maybe about half of them and there is no way to scroll down to the last customer record.  What am I doing wrong?
    Second, is there any way to base a parameter field on a formula field on my report?  On my report I have created a field Cust that is the customer name and number joined together in one field.  I would very much llike to use this formula in my record selection and in my parameter field.  Can it be done?
    All help is greatly appreciated
    Thanks,
    FatMan

    Hi,
    You can use the following for changin increasing the LOV.
    Crystal Reports XI BusinessObjects Enterprise XI
    For performance reasons, in Crystal Reports XI Release 1 and Release 2 the maximum number of values that are returned for a list of values is set to 1000. If you have a cascading List of Values (for example Country > Region > City), the lowest level (in this case City) will only display a maximum of 1000 values. This means that the higher-level prompts may display far fewer values than you expect. The list of values provides the data for the dynamic parameter list.
    How can you modify the maximum number of values available in a dynamic parameter list?
    Resolution
    To increase the maximum number of values available in a dynamic parameter list, you must add a registry key.
    CAUTION     The following resolution involves editing the registry. Using the Registry Editor incorrectly can cause serious problems that may require you to reinstall the Microsoft Windows operating system. Use the Registry Editor at your own risk. For information on how to edit the registry key, view the 'Changing Keys and Values' online Help topic in the Registry Editor (Regedit.exe).
    It is strongly recommended that you make a backup copy of the registry files (System.dat and User.dat on Win9x computers) before you edit the registry.
    Crystal Reports XI Release 1
    1.     Create a registry key HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports\DatabaseOptions\LOV.
    NOTE     Alternatively, you can create the registry key HKEY_CURRENT_USER\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports\DatabaseOptions\LOV and that key will override the settings of the HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports\DatabaseOptions\LOV key.
    2.     Add a string value "MaxRowsetRecords" and set the value to the maximum number of values that you desire for your report. For example, a value of 2000 will return up to 2000 values in the lowest level of a cascading parameter. NOTE: The value 0 (Unlimited) will not work with BusinessObjects Enterprise XI or Crystal Reports Server XI, you must specify another value.
    NOTE     The higher the number of values is, the longer it will take the Enter Values dialog box to populate with values.
    3.      After making changes to the registry, restart the affected service or application as required.
    Crystal Reports XI Release 2
    1.     Create a registry key HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.5\Crystal Reports\DatabaseOptions\LOV.
    NOTE     Alternatively, you can create the registry key HKEY_CURRENT_USER\SOFTWARE\Business Objects\Suite 11.5\Crystal Reports\DatabaseOptions\LOV and that key will override the settings of the HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.5\Crystal Reports\DatabaseOptions\LOV key.
    2.     Add a string value "MaxRowsetRecords" and set the value to the maximum number of values that you desire for your report. For example, a value of 2000 will return up to 2000 values in the lowest level of a cascading parameter. 
    NOTE     The value 0 (Unlimited) will not work with BusinessObjects Enterprise XI or Crystal Reports Server XI, you must specify another value.
    3.     After making changes to the registry, restart the affected service or application as required.
    I hope this helps you.
    Regards,
    Prashant

  • Need help with calculated fields in Adobe Interactive Forms

    Hi Gurus,
    I have an Adobe Interactive form in which i have radio buttons. Upon selecting any of the radio buttons, value in text box should be changed( Calculqated filedS). How i can achieve this?
    Regards,
    Srini
    Moderator message: wrong forum, please post again in Adobe Interactive Forms, but always try yourself before asking.
    Edited by: Thomas Zloch on Jul 13, 2010 11:58 AM

    Hi Tapan
    No, it's working ,with  one remark.
    I've done a mistake, in the final formula. The logic remain the same! ;)
     The calculation values for second column ( COL2 ) are 1,2,3 and not 0,1,2 as I wrote  before and as for COL1 are so the formula is
    =3*if(COL1="ABC",0,IF(COL1="DEF",1,2)+if(COL2="RST",1,IF(COL2="YYZ",2,3)
    and not
    =3*if(COL1="ABC",0,IF(COL1="DEF",1,2)+if(COL2="RST",0,IF(COL2="YYZ",1,2)
    I created also a real example  for you, with 2 dif calculation ways . First I created 2 calc_columns for COL1 and COL2 ( CALC_COL1+CALC_COL and after I added both these 2 column , and second way is to calculate directly) .
    Check this image
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • SQL Help -- Need help with pivoting the columns to rows

    I have a requierement to split the columns into multiple rows. For example:
    EMP_DEPT
    rowid empid1 ename1 dept1 empid2 ename2 dep2 empid2 ename2      dep3 empid4 ename4 dept4
    100001 1 'SCOTT' 10 2 'DAVE' 20 3 'MILLER'     10 4 SMITH 20
    100002 1 'SCOTT' 10 2 'DAVE' 20 3 'MILLER'     20      
    Note: EMP_DEPT may not always have all the 4 employee info populated for example in row 2 only 3 employees info is there
    I need to convert it and insert into EMPLOYEE table as follows:
    EMPLOYEE
    empid ename dept
    1 SCOTT 10
    2 DAVE 20
    3 MILLER 10
    4 SMITH 20
    1 SCOTT 10
    2 DAVE 20
    3 MILLER 20
    Thanks
    Kev

    Frank Thank You for your response.
    I am on oracle 10gR2.
    Posting some sample DDL and data here as requested:
    CREATE TABLE EMP
      PK          NUMBER(10),
      EMP_NAME1   VARCHAR2(100 BYTE),
      EMP_ID1     NUMBER(10),
      EMP_NAME2   VARCHAR2(100 BYTE),
      EMP_ID2     NUMBER(10),
      DEPT_NAME1  VARCHAR2(200 BYTE),
      DEPT_ID1    NUMBER(10),
      DEPT_NAME2  VARCHAR2(200 BYTE),
      DEPT_ID2    NUMBER(10)
    CREATE TABLE EMP_DEPT
    ( PK NUMBER(10),
    ENTY_TYPE VARCHAR2(100),
    ENTY_NAME VARCHAR2(100),
    ENTY_ID NUMBER(10)
    Insert into EMP
       (PK, EMP_NAME1, EMP_ID1, EMP_NAME2, EMP_ID2, DEPT_NAME1, DEPT_ID1, DEPT_NAME2, DEPT_ID2)
    Values
       (1, 'SCOTT', 10001, 'FRANK', 10002,
        'MARKETING', 10, 'ACCOUNTING', 20);
    Insert into EMP
       (PK, EMP_NAME1, EMP_ID1, EMP_NAME2, EMP_ID2, DEPT_NAME1, DEPT_ID1)
    Values
       (2, 'SCOTT1', 10003, 'FRANK1', 10004,
        'MARKETING1', 30);
    COMMIT;
    SELECT
    FROM
    EMP;
    PK     EMP_NAME1     EMP_ID1     EMP_NAME2     EMP_ID2          DEPT_NAME1     DEPT_ID1     DEPT_NAME2     DEPT_ID2
    1     SCOTT          10001     FRANK          10002          MARKETING     10          ACCOUNTING     20
    2     SCOTT1          10003     FRANK1          10004          MARKETING1     30               My requirement is to:
    SELECT from emp and INSERT INTO EMP_DEPT so that columns are broken into rows as follows
    PK ENTY_TYPE, ENTY_NAME    ENTY_ID
    1  EMPLOYEE   SCOTT        10001
    2  EMPLOYEE   FRANK        10002
    3  DEPARTMENT MARKETING    10
    4  DEPARTMENT ACCOUNTING   20    
    5  EMPLOYEE   SCOTT1       10003
    6  EMPLOYEE   FRANK1       10004
    7  DEPARTMENT MARKETING1   30          Thanks
    Kevin
    Edited by: user10210466 on Dec 8, 2010 1:37 PM

  • Need help with disabling the output excution command

    hey guys
    i'm doing an assignment in which user can input multiple lines. I'm using the scanner class. The problem i'm facing is that when user gives their input in multiple lines then it displays the asking input line even though it doesn't ask for new input because the pervious input stored in the memory. Please help me to disable it somehow. I understand the logic and everything but i can't find a way to disable that line. Here's my code:
    print("Please enter words to be converted into Swedish Chef or \"END\" to stop");
            inputText = input.nextLine();
            while (!inputText.equals ("END")  ) {
                // separate the text and punctuations
                removePunctuations();
                // translate all the input text
                for (int i = 0; i < inputWOP.length; i++ ) {
                   translateText(inputWOP);
    // display the translated text inculding all the punctuations
    printTranslatedText();
    System.out.println();
    /** the problem is on this line, logically it make sense that
    * this will be displayed until "END" isn't entered
    * but i want this line not to excute if there's multiple line input
    print("Please enter words to be converted into Swedish Chef or \"END\" to stop");
    inputText = input.nextLine();
    Please help me to solve this problem, thanks in advance!

    salubad,
    Do you really understand your logic? This is a classic while !EOF loop gone wrong... Examine your own code I'm sure you'll get it.
    /** the problem is on this line, //YEP
    logically it make sense that
    * this will be displayed until "END"
    isn't entered //DOES IT REALLY?
    * but i want this line not to excute if
    there's multiple line input //yep, just make it so.
    rint("Please enter words to be converted into Swedish
    Chef or \"END\" to stop");
    inputText = input.nextLine();
    Keith.

  • Need help with Time Field

    Hi everyone,
    I'm new to LiveCycle Designer and so far I'm loving it! I have a question on the time field.
    I want the user to enter a time such as 8pm or 830pm and field to automatically display the time as 8:00 PM or 8:30 PM. I have not been able to achieve this.
    If I use anything in the validation area, then I am forcing the user to enter the time in that format (so 8pm fails). If I don't put anything in the validation area, the system doesn't change the time (and it remains displayed as 8pm).
    What am I doing wrong? Any help would be greatly appreciated!
    Jose

    I figured it out.
    Thanks!

  • Need help with disabled ipod

    my son forgot his password need to fix it before christmas please!!!!!

    It will need to be restored. http://support.apple.com/kb/ht1212

  • Need help with required fields for my online form

    Hi, I've been mucking around with my online form for a while
    and I just can't see what the problem is in the code.
    I am trying to make all but two of the form items to be
    required upon form validation. However, it doesn't work, nothing is
    required now.
    I'm using these two ways of doing it (natemail.php is my form
    handler).
    <form action="../NateMail.php" method="post"
    enctype="application/x-www-form-urlencoded" id="Man Meets Woman
    Long Form Opt-in"
    onsubmit="MM_validateFormMM_validateForm("date","first_name","last_name","alias","address ","city","prov_state","postal","country","phone","email","birthdate","Sex","marital_status ","other_forums","methods_known","want_learn","coaching","invite_friends","about_myself"," terms_conditions");return
    document.MM_returnValue">
    ...is one way and the other is:
    <input name="require" type="hidden" id="require"
    value="date,first_name,last_name,alias,address,city,prov_state,postal,country,phone,email ,birthdate,Sex,marital_status,other_forums,methods_known,want_learn,coaching,invite_friend s,about_myself,terms_conditions"
    />
    The page is
    http://www.vancouversocialboard.com/register.html
    Can anyone tell me my error and tell me the proper way to do
    this?
    Thank you!

    > (never did figure out what the 'MM_validateForm code was
    supposed to be)
    It's a call to a Dreamweaver javascript function that
    validates your form.
    The function definition should be in the head of the page.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "audio90" <[email protected]> wrote in
    message
    news:ghsljj$4ll$[email protected]..
    >
    quote:
    Originally posted by:
    Newsgroup User
    > On first glance, the problem seems to be that both the
    onsubmit event
    > and the JavaScript function inside are encapsulated with
    double quotes.
    > Try wrapping the onsubmit attribute/event in single
    quotes instead, like:
    >
    >
    >
    onsubmit='MM_validateFormMM_validateForm("date","first_name","last_name","alias"
    >
    ,"address","city","prov_state","postal","country","phone","email","birthdate","S
    >
    ex","marital_status","other_forums","methods_known","want_learn","coaching","inv
    > ite_friends","about_myself","terms_conditions");return
    > document.MM_returnValue'
    >
    >
    > [snip]
    >
    >
    >
    > No, it didn't work. But I solved it to be acceptable. I
    removed the
    > 'MM_validateForm and used the Natemail action. My
    mistake there was that I
    > put
    > "require" rather than "required". It comes up with a
    different screen when
    > form
    > items are missing, rather than a pop up video, but good
    enough.
    >
    > thanks
    >
    > (never did figure out what the 'MM_validateForm code was
    supposed to be)
    >
    >
    >

  • Need help with configuring setup cost as variable based on quantity

    Hello,
    I am brand new to PP and my client has inquiry as to how they can make the setup costs variable based on the production quantity. They already have the machine and labor working correctly, so I compared the formulas for machine and labor time with that of the formula for setup time and they are not the same (in fact, setup time does not have any formula). Do I simply need to create a formula for this or are there multiple other steps? If anyone can give instruction on how to set this up it would be of great help.
    Thanks,
    MH

    Check in the Work Center, tab Costing where Setup Time should have a formula using operation quantity / base quantity as ratio.
    Setup time should be included as parameter in the standard value key.
    The formula in the Capacity Tab would have only effect on the capacity evaluation, but no costs impact.
    Edited by: Dario on Feb 2, 2011 7:04 PM

  • Need help with DM software install - installer thinks I have previous installati​on, but I don't

    This is really frustrating me, but I recently uninstalled v4.3 and have been struggling to re-install ANY version of the DM onto my XP Pro machine.  I have followed every bit of advice I can find including clean un-install / install, change the TEMP environment variable, unzip the installer and store locally, but I still can't figure this out.
    I've been studying the installer log file, and I think this might be a clue:
    InstallShield 14:12:58: Registering Msi Server...
    MSI (c) (4C!DC) [14:12:58:742]: Note: 1: 2732 2: 0
    InstallShield 14:12:58: Invoking script function RIM_CheckForDesktopDowngrade
    RIM: Found existing DesktopMgr.exe at: C:\Program Files\Research In Motion\BlackBerry\DesktopMgr.exe
    RIM: Failed to retrieve version info from: C:\Program Files\Research In Motion\BlackBerry\DesktopMgr.exe
    InstallShield 14:12:58: CallScriptFunctionFromMsiCA() ends
    MSI (c) (4C!DC) [14:12:58:774]: Leaked MSIHANDLE (55) of type 790531 for thread 3804
    MSI (c) (4C!DC) [14:12:58:774]: Leaked MSIHANDLE (54) of type 790531 for thread 3804
    Action ended 14:12:58: RIM_CheckForDesktopDowngrade. Return value 3.
    MSI (c) (4C:40) [14:12:58:789]: Doing action: SetupCompleteError
    Action 14:12:58: SetupCompleteError.
    Action start 14:12:58: SetupCompleteError.
    Info 2898.For Tahoma8 textstyle, the system created a 'Tahoma' font, in 0 character set.
    Info 2898.For TahomaBold10 textstyle, the system created a 'Tahoma' font, in 0 character set.
    Action 14:12:58: SetupCompleteError. Dialog created
    It seems to think that I have a previous version installed in my Program Files, but no such executable exists (as I mentioned earlier, I have followed the clean install procedures more than once
    Any ideas?
    Message Edited by tbarcelo on 05-19-2009 02:21 PM
    Solved!
    Go to Solution.

    Hi and Welcome to the Forums!
    You say you followed the instructions for a clean install -- but what about a clean un-install? Those instructions are here...
    http://www.blackberry.com/btsc/microsites/search.d​o?cmd=displayKC&docType=kc&externalId=KB02206&slic​...
     Edit -- oh...and reboots...lots of them...one between each step...after an uninstall...after an install...etc.
    Message Edited by sdgardne on 05-19-2009 11:09 AM
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Need help with Pivoting rows to columns

    Hi,
    I need help with pivoting rows to columns. I know there are other posts regarding this, but my requirement is more complex and harder. So, please give me a solution for this.
    There are two tables say Table 1 and Table 2.
    Table1
    name address email identifier
    x e g 1
    f s d 2
    h e n 3
    k l b 4
    Table2
    identifier TRno zno bzid
    1 T11 z11 b11
    1 T12 z12 b12
    1 T13 z13 b13
    2 T21 z21 b21
    2 T22 z22 b22
    As you can see the identifier is the column that we use to map the two tables. The output should be like below
    output
    name address email identifier TRno1 zno1 bzid1 TRno2 zno2 bzid2 TRno3 zno3 bzid3
    x e g 1 T11 z11 b11 T12 z12 b12 T13 z13 b13
    f s d 2 T21 z21 b21 t22 z22 b22
    Also we do not know exactly how many TRno's, zno's, etc each value in the identifier will have. There may be only 1 TRNO, zno and bzid, or there may be four.
    All the values must be in separate columns, and not be just comma delimitted. There are also other conditions that i have to add to restrict the data.
    So, can you please tell me what is should use to get the data in the required format? We are using Oracle 10g. Please let me know if u need any more information

    Something like this ?
    SCOTT@orcl> ed
    Wrote file afiedt.buf
      1  select a.name,
      2  a.address,
      3  a.email,
      4  b.* from (
      5  select distinct identifier
      6  ,max(trno1) trno1
      7  ,max(zno1) zno1
      8  ,max(bzid1) bzid1
      9  ,max(trno2) trno2
    10  ,max(zno2) zno2
    11  ,max(bzid2) bzid2
    12  ,max(trno3) trno3
    13  ,max(zno3) zno3
    14  ,max(bzid3) bzid3
    15  ,max(trno4) trno4
    16  ,max(zno4) zno4
    17  ,max(bzid4) bzid4
    18  from (select identifier
    19  ,decode(rn,1,trno,null) trno1
    20  ,decode(rn,1,zno,null) zno1
    21  ,decode(rn,1,bzid,null) bzid1
    22  ,decode(rn,2,trno,null) trno2
    23  ,decode(rn,2,zno,null) zno2
    24  ,decode(rn,2,bzid,null) bzid2
    25  ,decode(rn,3,trno,null) trno3
    26  ,decode(rn,3,zno,null) zno3
    27  ,decode(rn,3,bzid,null) bzid3
    28  ,decode(rn,4,trno,null) trno4
    29  ,decode(rn,4,zno,null) zno4
    30  ,decode(rn,4,bzid,null) bzid4
    31  from (select identifier,
    32  trno,bzid,zno,
    33  dense_rank() over(partition by identifier order by trno,rownum) rn
    34  from table2)
    35  order by identifier)
    36  group by identifier) b,table1 a
    37* where a.identifier=b.identifier
    SCOTT@orcl> /
    NAME       ADDRESS    EMAIL      IDENTIFIER TRNO1      ZNO1       BZID1      TRNO2      ZNO2       BZID2      TRNO3      ZNO3       BZID3      TRNO4      ZNO4       BZID4
    x          e          g          1          T11        z11        b11        T12        z12        b12        T13        z13        b13
    f          s          d          2          T21        z21        b21        T22        z22        b22
    SCOTT@orcl> select * from table1;
    NAME       ADDRESS    EMAIL      IDENTIFIER
    x          e          g          1
    f          s          d          2
    h          e          n          3
    k          l          b          4
    SCOTT@orcl> select * from table2;
    IDENTIFIER TRNO       ZNO        BZID
    1          T11        z11        b11
    1          T12        z12        b12
    1          T13        z13        b13
    2          T21        z21        b21
    2          T22        z22        b22
    SCOTT@orcl>Regards
    Girish Sharma

Maybe you are looking for

  • Can't connect via Ethernet

    I have an iMac G5 iSight and have been using Airport successfully to connect to the Internet via a DW6000 satellite modem. Since I have now retired and will no longer be using a Powerbook, I decided to stop using Airport and attempted to connect via

  • Bridge CS6:  Output to Web or PDF - insufficient disk space..

    I have recently installed the CS6 cloud version of Bridge, but now get this error when trying to produce (or refresh) a contact sheet using Output to Web or PDF - There is insufficient disk space to complete this operation The error occurs no matter

  • Should I buy a Macbook Air or a Macbook pro? HELP!

    Hey everyone! I'm a highschool graduate starting college this fall for a music business major and I finally gathered enough money to purchase myself a macbook. I've never had a macbook before so I don't know much about them, other than that many peop

  • Easiest way to transfer all Business Documents to another instance

    We have to transfer all appraisal documents to another SAP instance. We know how to transfer all other parts except attachments (such as Excel sheets) of appraisal documents. These attachments are stored in Business Document Service (BC-SRV-BDS) with

  • Formula Variables in 'Condition' Screen

    Hi I have 'Date1' as a characteristic. I want to apply for condition on this 'Date1' characterstic. So i created a 'formula variable by using replacement path' for this 'Date1' characteristic . And i included this 'formula variable' in an NewFormula