FOR LOOP cursor that updates table A based on a value in table B

Hi,
I need a FOR LOOP cursor that scans and updates all pro-rata column in table EMPLOYEE(child) based on what pay classification all employees are on in the CLASSIFICATION(parent) table.
DECLARE
BEGIN
IF employee.emp_type = 'FT' THEN
UPDATE employee
SET employee.pro_rata = ((classification.yearly_pay/52)*52)
WHERE employee.empid = v_empid AND classification.class_id = employee.class_id;
END IF;
IF employee.emp_type = 'PT1' THEN
UPDATE employee
SET employee.pro_rata = ((classification.yearly_pay/39)*52)
WHERE employee.empid = v_empid AND classification.class_id = employee.class_id;
END IF;
IF employee.emp_type = 'PT2' THEN
UPDATE employee
SET employee.pro_rata = ((classification.yearly_pay/21)*52)
WHERE employee.empid = v_empid AND classification.class_id = employee.class_id;
END IF;
END;
How do I create a cursor that cuts across these two table
See tables and data
CREATE TABLE CLASSIFICATION(
CLASS_ID VARCHAR2(6) NOT NULL,
CLASS_TYPE VARCHAR2(10),
DESCRIPTION VARCHAR2(30) NOT NULL,
YEARLY_PAY NUMBER(8),
HOURLY_RATE NUMBER,
WEEKDAY_OVER_TIME NUMBER,
WEEKEND_OVER_TIME NUMBER,
CONSTRAINT PK_CLASS_ID PRIMARY KEY (CLASS_ID));
INSERT INTO CLASSIFICATION VALUES('PR1','PERMANENT','MANAGER',45000,'','',NULL);
INSERT INTO CLASSIFICATION VALUES('PR2','PERMANENT','ADMIN ASSISTANT',22000,'',1.5,NULL);
INSERT INTO CLASSIFICATION VALUES('PR3','PERMANENT','CONTROLLER',32000,'',1.5,NULL);
INSERT INTO CLASSIFICATION VALUES('PR4','PERMANENT','CASH OFFICER',22000,'',1.5,NULL);
INSERT INTO CLASSIFICATION VALUES('PR5','PERMANENT','CLEANERS',16000,'',1.5,NULL);
INSERT INTO CLASSIFICATION VALUES('PR6','PERMANENT','ADMIN OFFICER',22000,'',1.5,NULL);
INSERT INTO CLASSIFICATION VALUES('PR7','PERMANENT','WAREHOUSE ATTENDANT',20000,'',1.5,NULL);
INSERT INTO CLASSIFICATION VALUES('PR8','PERMANENT','WINDOWS DRESSER',22000,'',1.5,NULL);
INSERT INTO CLASSIFICATION VALUES('PR9','PERMANENT','DIRECTOR',60000,'','',NULL);
INSERT INTO CLASSIFICATION VALUES('PR10','PERMANENT','DEPUTY DIRECTOR',52000,'','',NULL);
INSERT INTO CLASSIFICATION VALUES('PR11','PERMANENT','SALES ASSISTANT',21000,'',1.5,NULL);
INSERT INTO CLASSIFICATION VALUES('TEMP2','TEMP STAFF','ADMIN ASSISTANT','',16.50,'',NULL);
INSERT INTO CLASSIFICATION VALUES('TEMP3','TEMP STAFF','CONTROLLER','',29.00,'',NULL);
INSERT INTO CLASSIFICATION VALUES('TEMP4','TEMP STAFF','CASH OFFICER','',19.00,'',NULL);
INSERT INTO CLASSIFICATION VALUES('TEMP5','TEMP STAFF','CLEANERS','',10.00,'',NULL);
INSERT INTO CLASSIFICATION VALUES('TEMP6','TEMP STAFF','ADMIN OFFICER','',20.00,'',NULL);
INSERT INTO CLASSIFICATION VALUES('TEMP7','TEMP STAFF','WAREHOUSE ATTENDANT','',18.00,'',NULL);
INSERT INTO CLASSIFICATION VALUES('TEMP8','TEMP STAFF','WINDOWS DRESSER','',18.50,'',NULL);
INSERT INTO CLASSIFICATION VALUES('TEMP11','TEMP STAFF','SALES ASSISTANT','',16.00,'',NULL);
CREATE TABLE EMPLOYEE(
EMPID NUMBER(5) NOT NULL,
SURNAME VARCHAR2(30) NOT NULL,
FNAME VARCHAR2(30) NOT NULL,
GENDER CHAR(1) NOT NULL,
DOB DATE NOT NULL,
EMP_TYPE VARCHAR2(20) NOT NULL,
ANNUAL_WEEKS_REQD NUMBER(2),
PRO_RATA_WAGES NUMBER(7,2),
HOLIDAY_ENTLMENT NUMBER(2),
SICK_LEAVE_ENTLMENT NUMBER(2),
HIRE_DATE DATE NOT NULL,
END_DATE DATE,
ACCNO NUMBER(8) NOT NULL,
BANKNAME VARCHAR2(20) NOT NULL,
BRANCH VARCHAR2(20) NOT NULL,
ACCOUNTNAME VARCHAR2(20),
CLASS_ID VARCHAR2(6),
CONSTRAINT CK_HIRE_END CHECK (HIRE_DATE < END_DATE),
CONSTRAINT CK_HIRE_DOB CHECK (HIRE_DATE >= ADD_MONTHS(DOB, 12 * 18)),
CONSTRAINT CK_EMP_TYPE CHECK (EMP_TYPE IN ('FT','PT1','PT2','PT3','HOURLY')),
CONSTRAINT CK_EMP_GENDER CHECK (GENDER IN ('M','F')),
CONSTRAINT FK_EMP_CLASS FOREIGN KEY (CLASS_ID) REFERENCES CLASSIFICATION(CLASS_ID),
CONSTRAINT PK_EMP PRIMARY KEY (EMPID));
CREATE SEQUENCE SEQ_EMPID START WITH 1;
INSERT INTO EMPLOYEE VALUES(
SEQ_EMPID.NEXTVAL,'RICHARD','BRANDON','M','25-DEC-1966','FT',52,22000.00,28,14,'10-JAN-2005',NULL,90823227,'NATWEST','BROMLEY','DEPOSIT','PR2');
INSERT INTO EMPLOYEE VALUES(
SEQ_EMPID.NEXTVAL,'BOYCE','CODD','M','15-JAN-1972','PT1','','','','','12-JAN-2005',NULL,72444091,'LLOYDS','KENT','CURRENT','PR8');
INSERT INTO EMPLOYEE VALUES(
SEQ_EMPID.NEXTVAL,'ALHAJA','BROWN','F','20-MAY-1970','HOURLY','','','','','21-JUN-2000',NULL,09081900,'ABBEY','ESSEX','CURRENT','TEMP2');
INSERT INTO EMPLOYEE VALUES(
SEQ_EMPID.NEXTVAL,'RON','ATKINSON','M','10-AUG-1955','PT3','','','','','12-JAN-2005','26-MAR-2006',01009921,'HALIFAX','KENT','SAVINGS','PR6');
INSERT INTO EMPLOYEE VALUES(
SEQ_EMPID.NEXTVAL,'CHAMPI','KANE','F','01-JAN-1965','PT2','','','','','12-JAN-2004',NULL,98120989,'HSBC','ILFORD','CURRENT','PR4');
INSERT INTO EMPLOYEE VALUES(
SEQ_EMPID.NEXTVAL,'NED','VED','M','15-JAN-1980','HOURLY','','','','','29-DEC-2005',NULL,90812300,'WOOLWICH','LEWISHAM','CURRENT','TEMP6');
INSERT INTO EMPLOYEE VALUES(
SEQ_EMPID.NEXTVAL,'JILL','SANDER','F','22-MAR-1971','FT','','','','','30-NOV-2003',NULL,23230099,'BARCLAYS','PENGE','DEPOSIT','PR1');
Any contribution would be appreciated
many thanks
Cube60

Hi,
I have triede this cursor procedure but I get an compilation error.
See first post for tables and data..
Can someone help me out please.
SQL> CREATE OR REPLACE PROCEDURE update_employee(
2 p_empid employee.empid%type,
3 p_emp_type employee.emp_type%type)
4 IS
5 CURSOR c1 is
6 select e.empid, e.emp_type, c.yearly_pay from employee e, classification c where
7 c.class_id = e.class_id;
8 BEGIN
9 OPEN c1
10 LOOP
11 FETCH c1 INTO p_empid, p_emp_type;
12 exit when c1%notfound;
13
14 IF v_emp_type ='PT1' THEN
15 UPDATE employee SET annual_weeks_reqd = 39, pro_rata_wages = ((v_yearly_pay/52)*39), holiday_en
tlment=21, sick_leave_entlment = 10.5 WHERE c.class_id = e.class_id;
16 END IF;
17 END;
18 /
Warning: Procedure created with compilation errors.
SQL> SHOW ERR;
Errors for PROCEDURE UPDATE_EMPLOYEE:
LINE/COL ERROR
10/1 PLS-00103: Encountered the symbol "LOOP" when expecting one of
the following:
. ( % ; for
The symbol "; was inserted before "LOOP" to continue.
Many thanks

Similar Messages

  • Process having dynamic subqery in for loop cursor

    I created a process that puts all retrieved rows into a collection. Users can select on quite a few columns, say unit, last_name, shift, etc. When the query is built based on users' inputs, I can't get it working using a For Loop Cursor (code 3.). But I tried and found out that sample 1 is working while sample 2 is not.
    Can anyone please help? give advices or point to the right direction?
    Thanks very much in advance!!!
    DC
    sample 1, works:
    begin
    :P8_TEST_CURSOR := '';
    for c in ( select ename from emp ) loop
    :P8_TEST_CURSOR := :P8_TEST_CURSOR || ', ' || c.ename;
    end loop;
    end;
    sample 2, does not work:
    declare
    q varchar2(2000) := 'select ename from emp';
    begin
    :P8_TEST_CURSOR := '';
    for c in q loop
    :P8_TEST_CURSOR := :P8_TEST_CURSOR || ', ' || c.ename;
    end loop;
    end;
    code 3, my actually pursuing code, sorry it's long:
    declare
    q varchar2(2000);
    v_unit_id cpd_units.id%TYPE;
    begin
    q := 'select distinct e.user_id
    , nvl(to_char(law_common.get_star_no(e.id)), ''-'') star_no
    , nvl(e.last_nme, ''-'') last_name
    , nvl(e.first_nme, ''-'') first_name
    , nvl(e.MIDDLE_INITIAL, ''-'') middle_initial
    , e.employee_no
    , nvl(to_char(e.employee_position_cd), ''-'')
    , nvl(w.uod_cd, e.cpd_unit_assigned_no) unit
    , nvl(w.watch_cd, ''-'')
    from cpd_employees e, dpv2wtch w
    where e.status_i = ''Y''
    and nvl(e.resignation_date, sysdate) >= sysdate
    and e.employee_position_cd in (''9112'', ''9152'', ''9153'', ''9155'', ''9161'', ''9164'')
    and e.user_id is not null
    and w.ssn_no(+) = e.ssn
    and e.user_id not in (select c001
    from htmldb_collections
    where collection_name = ''ACTIVITY''
    if :P300_STAR_NO is not NULL then
    q := q || ' and e.id = law_common.get_employee_id(:P300_STAR_NO)';
    --q := q || ' and law_common.get_star_no(e.id) = :P300_STAR_NO';
    end if;
    if :P300_EMPLOYEE_NO is not NULL then
    q := q || ' and e.employee_no = :P300_EMPLOYEE_NO';
    end if;
    if :P300_USER_ID is not NULL then
    q := q || ' and e.user_id = :P300_USER_ID';
    end if;
    if :P300_LAST_NAME is not NULL then
    q := q || ' and upper(e.last_nme) like ''' || upper(:P300_LAST_NAME) || '%''';
    end if;
    if :P300_FIRST_NAME is not NULL then
    q := q || ' and upper(e.first_nme) like ''' || upper(:P300_FIRST_NAME) || '%''';
    end if;
    if :P300_EMPLOYEE_POSITION_CD is not NULL then
    q := q || ' and e.employee_position_cd = :P300_EMPLOYEE_POSITION_CD';
    end if;
    if :P300_UNIT is not NULL then
    q := q || ' and nvl(w.uod_cd, e.cpd_unit_assigned_no) = :P300_UNIT';
    end if;
    if :P300_WATCH_CD <> 'NULL' then
    q := q || ' and w.watch_cd = :P300_WATCH_CD';
    end if;
    --htp.p('Limit Unit '||:P0_LIMIT_UNIT);
    /* authorization of editing OWN, UNIT, or ALL recs */
    if substr(:P0_PERMISSION, 1, 5) = 'QUERY' then
    q := q || ' and e.user_id = v(''FLOW_USER'')';
    elsif substr(:P0_PERMISSION, -4, 4) = 'UNIT' then
    q := q || ' and coalesce(w.uod_cd, e.cpd_unit_assigned_no)= :P0_LIMIT_UNIT ';
    end if;
    htp.p('q: ' || q);
    cursor q_c is q;
    for c in ( q_c ) loop /* HOW CAN BE DYNAMIC ???? */
    l_seq_id := htmldb_collection.add_member(
    p_collection_name => 'OFFICER_ACTIVITY'
    , p_c001 => c.user_id
    , p_c002 => c.star_no
    , p_c003 => c.last_name
    , p_c004 => c.first_name
    , p_c005 => c.middle_initial
    , p_c006 => c.employee_no
    , p_c007 => c.employee_position_cd
    , p_c008 => c.unit
    , p_c009 => c.watch_cd
    , p_c050 => :P0_APP_USER
    end loop;
    end;

    Come back to solve my need. I get the working test process:
    declare
    type ty_cursor is ref cursor;
    my_cursor ty_cursor;
    my_rec emp%rowtype;
    l_num number := 7900;
    q varchar2(2000) ;
    l_using varchar2(200) := null;
    begin
    :P8_TEST_CURSOR := '';
    q := 'select * from emp';
    if :P8_ENAME is not null then
    q := q || ' where ename like :P8_ENAME';
    l_using := ':P8_ENAME';
    end if;
    if l_using is not null then
    open my_cursor for q using :P8_ENAME; --l_using;
    else
    open my_cursor for q;
    end if;
    loop
    fetch my_cursor into my_rec;
    exit when my_cursor%notfound;
    :P8_TEST_CURSOR := :P8_TEST_CURSOR || ', ' || my_rec.empno;
    end loop;
    end;
    But I need
    open my_cursor for q using l_using;
    to be working since my application has several searchable columns for users and I have to put users' input search into l_using. It does NOT work: q got 'select * from emp where ename like :P8_ENAME' and l_using got ':P8_ENAME' at "open ...." statement.
    How can I get this cursor opened dynamically?
    Thanks again!
    DC

  • How to get last Record ior Total rows in For Loop Cursor ?

    Hi Friends
    I would like to know , the last record in for loop cursor, i have the code in following format
    cursor c1 is
    select * from emp;
    begin
    for r1 in c1 loop
    v_total_rec := ? ( i would like to know total rows in the cursor , say for example if cursor has 10 rows, i want10 into this variable )
    v_count := v_count +1;
    dbms_output.put_line(r1.emp_name);
    end loop;
    end;
    Hope i am clear
    Any suggestions?
    Thanks
    Ravi

    Even though cursor loops are generally a Bad Idea ^tm^ as Dan says, here's an example of how you can get the information you wanted within the query itself...
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    cursor c1 is
      3      select emp.*
      4            ,count(*) over (order by empno) as cnt
      5            ,count(*) over () as total_cnt
      6      from emp
      7      order by empno;
      8  begin
      9    for r1 in c1 loop
    10      dbms_output.put_line(r1.ename||' - row: '||r1.cnt||' of '||r1.total_cnt);
    11    end loop;
    12* end;
    SQL> /
    SMITH - row: 1 of 14
    ALLEN - row: 2 of 14
    WARD - row: 3 of 14
    JONES - row: 4 of 14
    MARTIN - row: 5 of 14
    BLAKE - row: 6 of 14
    CLARK - row: 7 of 14
    SCOTT - row: 8 of 14
    KING - row: 9 of 14
    TURNER - row: 10 of 14
    ADAMS - row: 11 of 14
    JAMES - row: 12 of 14
    FORD - row: 13 of 14
    MILLER - row: 14 of 14
    PL/SQL procedure successfully completed.
    SQL>

  • How do I look for a date that corresponds to a particular Week Number in a table?

    Hello,
    I have a table (Table A) that looks like this (I am only including the first 5 months to keep image size down):
    The numbers in the table are dates, with custom formatting to just show the day.
    I have another table with all of the Week Numbers for a given year in the first column and a second column in which I would like a formula to count the numbers of dates in Table A that correspond to the Week Number in the first column (i.e. the number of dates that falls within that week).
    The following statement works for testing single cells:
    =COUNTIF(WEEKNUM(Table A :: $Session 1 $January,2),A1)
    But it would seem that I can only use this with single cells and not the table as a whole.
    Could someone help with a solution to this?
    Thanks,
    Nick

    Thanks Jerry.  If I have understood you correctly I would need to calculate the week numbers of the dates in Table A in Table A itself, like this:
    Then I would use the COUNTIF function to test the array of week numbers in Table A.  If this is correct, I am not sure how to construct an array that includes just the cells with week numbers. I presume I could do this either manually or based on the value in the first column of Table A (i.e. just testing the five columns to the right of each "Week No" row), but I'm not sure.
    Nick

  • For loop don't updates

    Hi,
    First I'm new at labview ,
    I'm trying to read 8 checkboxs vals and for each checkbox I'm queuing a single val witch will be a test.
    I have a problem with my for loop it simply won't update and staying at 0 val ( only one iteration ) 
    vi is attached , can any one give me some help ?
    Kobi Kalif
    Software Engineer
    Solved!
    Go to Solution.
    Attachments:
    InitToQ.vi ‏47 KB

    I cant look at the code right now, dont have LV currently, but it sounds like you're either not looping at all, or not doing what you should inside the loop (but outside).
    Could you post a .jpg/png? (usually we ask for the vi's instad )
    /Y 
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Looking for a program that updates my external HD

    I have all my music on a seperate external HD. I looking for a program that will update the drive when i purchase or add music to my main Mac. Ideally it will happen automatically when i attach the drive to my Mac. thanks

    We would have been better able to provide advice if you'd said that up front.
    Here are some additional sync utilities:
    syncOtunes
    TuneRanger
    SuperSync
    Syncopation

  • UpdateXML : How to update EmployeeName tag based on EmployeeID value

    Hi All,
    My XMLType (EMP_DOCUMENT) field in a table stores the following simple XML structure:
    <DEPARTMENT>
         <DEPARTMENT_ID>1</DEPARTMENT_ID>
         <DEPARTMENT_NAME>Finance</DEPARTMENT_NAME>
         <EMPLOYEE>
              <EMPLOYEE_ID>1</EMPLOYEE_ID>
              <FIRST_NAME>ABC</FIRST_NAME>
              <EMAIL>ABC</EMAIL>
    </EMPLOYEE>
         <EMPLOYEE>
              <EMPLOYEE_ID>2</EMPLOYEE_ID>
              <FIRST_NAME>xyz</FIRST_NAME>
              <EMAIL>xyz</EMAIL>
    </EMPLOYEE>
         <EMPLOYEE>
              <EMPLOYEE_ID>3</EMPLOYEE_ID>
              <FIRST_NAME>zzzz</FIRST_NAME>
              <EMAIL>zzz</EMAIL>
    </EMPLOYEE>
         <EMPLOYEE>
              <EMPLOYEE_ID>4</EMPLOYEE_ID>
              <FIRST_NAME>yyyy</FIRST_NAME>
              <EMAIL>yyyy</EMAIL>
    </EMPLOYEE>
    </DEPARTMENT>
    Employee_ID is unique and Employee_Name is not unique.
    I have a requirement to update the Employee_Name tag where i have the Employee_ID and the value to be updated.I tried the following but it updates all Employee_Names instead of updating the record i want:
    UPDATE EMPLOYEE_DOCUMENTS p
    SET p.EMP_DOCUMENT = updateXML(p.EMP_DOCUMENT,
                   '/DEPARTMENT/EMPLOYEE/FIRST_NAME/text()',
              'Scott')
    WHERE DOCUMENT_ID = 1
    AND existsNode(p.EMP_DOCUMENT,'/DEPARTMENT/EMPLOYEE[EMPLOYEE_ID = 2')=1
    I can see that updateXML essentially acts as 'ReplaceXML' where one tag can be searched and replaced with the new value.But is it possible to UPDATE a tag based on other tag at the same level (like update the employee_name based on employee_id)
    Thanks,
    Srihari
    Edited by: srihari manian on Jul 15, 2009 7:19 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I believe this is what you are looking for
    WITH employee_documents AS
    (SELECT XMLTYPE('<DEPARTMENT>
    <DEPARTMENT_ID>1</DEPARTMENT_ID>
    <DEPARTMENT_NAME>Finance</DEPARTMENT_NAME>
    <EMPLOYEE>
    <EMPLOYEE_ID>1</EMPLOYEE_ID>
    <FIRST_NAME>ABC</FIRST_NAME>
    <EMAIL>ABC</EMAIL>
    </EMPLOYEE>
    <EMPLOYEE>
    <EMPLOYEE_ID>2</EMPLOYEE_ID>
    <FIRST_NAME>xyz</FIRST_NAME>
    <EMAIL>xyz</EMAIL>
    </EMPLOYEE>
    <EMPLOYEE>
    <EMPLOYEE_ID>3</EMPLOYEE_ID>
    <FIRST_NAME>zzzz</FIRST_NAME>
    <EMAIL>zzz</EMAIL>
    </EMPLOYEE>
    <EMPLOYEE>
    <EMPLOYEE_ID>4</EMPLOYEE_ID>
    <FIRST_NAME>yyyy</FIRST_NAME>
    <EMAIL>yyyy</EMAIL>
    </EMPLOYEE>
    </DEPARTMENT>') emp_document
      FROM DUAL
    SELECT updateXML(p.EMP_DOCUMENT,
    '/DEPARTMENT/EMPLOYEE[EMPLOYEE_ID = 2]/FIRST_NAME/text()',
    'Scott')
      FROM employee_documents pwhich just updates the name for employee id 2.

  • How to retrive new logical column based on flag values in table.

    Hi,
    i have two tables in rpd
    1.file table contains the coulmns------->date,file_count,record_count,cldm_stg,cmsa_stg,archive_stg
    2.rejection table columns---------> are same as above
    both have same common columns.my requirement is publish a dashboard like:
    date | land_files count |alnd_recordscount| target_files count|target_records count|Rejection filecount|rejection record count
    These report ineed retrive from those two tables.based on flag values.taget countcomes when all stg values set to ='y'
    i.e(cldm_stg='y' and cmsa_stg='y'and archive_stg='y') if not then it will be in rejection file.
    Please give solution how to achive my output.
    nQSError: 14026] Unable to navigate requested expression: Target_record:[DAggr(FILE_CONTROL.Target_record by [ FILE_CONTROL.FILE_NAME, REJECTED_FILES.FILE_NAME, REJECTED_FILES.NO_OF_ROWS, File_landing.NO_OF_ROWS, File_landing.FILE_LOAD_DATE] SB FILE_CONTROL)]. Please fix the metadata consistency warnings. (HY000)
    Edited by: user8767586 on Jan 12, 2010 4:29 AM

    Tanks for ypur reply .only two tables are there named as above.i taken file_control as a fact table.
    and i create one new tablecalled target in bmm layer taking logical source as file_control(fact table). and iset the where clause for the new table.and i create a new measure called target_file and target_records.in where clause my query is like
    dwbidb."".AUDIT_PROD.FILE_CONTROL.ARCHIVE_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.CMSA_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.LND_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.SCRIPT_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.STG_STATUS = 'Y'
    please tell me if this is right way to achive mt report. and tell me difference between fragmentation and whereclause.for my requrement i ahve to follow which method either fragmentation or whereclause.and in rpd there are no errors and warnings.but in answers i get a follwing error
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested expression: TARGET_FILECOUNT:[DAggr(TARGET.TARGET_FILECOUNT by [ TARGET.FILE_NAME] SB TARGET)]. Please fix the metadata consistency warnings. (HY000)
    SQL Issued: SELECT TARGET.FILE_LOAD_DATE saw_0, TARGET.TARGET_FILECOUNT saw_1, TARGET.TARGET_FILECOUNT saw_2 FROM AUDIT_PROD ORDER BY saw_0.
    Please tell me to achive my report.
    Regards
    Edited by: user8767586 on Jan 12, 2010 5:21 AM
    Edited by: user8767586 on Jan 12, 2010 5:21 AM
    Edited by: user8767586 on Jan 12, 2010 5:24 AM

  • Update a Checkbox based on the value of another Checkbox

    We have a business rule that needs to following to happen.
    If the "Commit" checkbox is checked then the "Forecast" checkbox needs to be checked.
    We would like to handle this through workflow. Here is what we have done so far
    Workflow Rule Condition: FieldValue('<bCommit_ITAG>') = 'Y'
    Action: Field to Update - Field Name* is set to Forecast
    Value is set to: [<Forecast>]='Y'
    Thanks for the help

    Brian,
    What you have written should work, try Value is set to: <Forecast>=Yes.
    This should also be created in the Administration section as its not web services but workflows, you'll get better responses.
    cheers
    Alex

  • Adobe Reader Stops Working in Win7.  Is there a fix for this, other that updating?

    On my multiple Win7 or Vista machines, I suddenly have experienced Adobe Reader not working.  I have tried to install the latest updates and have even uninstalled and reinstalled it.  Nothing helps the situation.  Does anyone have a fix for this?  Thanks!!!!!!!!!!!

    Some things to try...
    Using Windows Explorer navigate to C:\Program Files (x86)\Adobe\Reader 11.0\Reader, then double-click on Eula.exe and accept the license agreement
    Can you open Adobe Reader by itself?  If so, try disabling Protected Mode [Edit | Preferences | Security (Enhanced)].
    If you cannot open Reader by itself, try to disable Protected Mode in the registry; download, unzip, then run the attached registry script
    It could even be a malware issue; see http://helpx.adobe.com/acrobat/kb/reader-core-dll-error.html

  • Updating the recoed based on the value of check box

    I have a form which has a check box for each record.
    I want to update the values of the checked records.
    Enclosing my code below:
    htp.htmlOpen;
    htp.headOpen;
    htp.title ('Out Details Form');
    htp.headClose;
    htp.bodyOpen;
    htp.header (1,'Out Details Form');
    htp.formOpen ('RSA.UPDATE_OUT_RECORDS');
    br_code := substr(PORTAL.wwctx_api.get_user(),1,2);
    product_code := upper(p_product_code);
    for each_rec IN ref_cursor (p_date,br_code,product_code)
    loop
    htp.p(each_rec.ref_no);
    htp.p(each_rec.name);
    htp.p('<input type = "hidden" name ="p_ref_no" value = '||each_rec.ref_no||'>');
    htp.p ('<input type = "checkbox" name = "p_cd" >');
    htp.p ('<br>');
    end loop;
    htp.p('<br>');
    htp.p ('Courier Name');
    htp.p('<input type = "text" name ="p_courier">');
    htp.p('Courier Number');
    htp.p('<input type = "text" name ="p_courier_no">');
    htp.p('Destination Branch Code');
    htp.p ('<input type = "text" name ="p_branch">');
    htp.p('<br>');
    htp.formSubmit ('Submit');
    htp.bodyClose;
    htp.htmlClose;
    end;
    my update procedure is given below
    Create or Replace PROCEDURE RSA.UPDATE_OUT_RECORDS
    p_ref_no IN PORTAL.wwv_utl_api_types.vc_arr,
    p_cd IN PORTAL.wwv_utl_api_types.vc_arr,
    p_courier IN VARCHAR2,
    p_courier_no IN VARCHAR2,
    p_branch IN VARCHAR2,
    submit IN VARCHAR2
    as
    begin
    for i in 1..p_ref_no.count loop
    htp.p(p_ref_no(i));
    update RS_MIMO_TRANSACTIONS
    set RS_MIMO_TRANSACTION_TO_PLACE = p_branch,
    RS_MIMO_TRANSACTION_OUT_TIME = sysdate,
    RS_MIMO_TRANSACTION_COURIER_NO = p_courier_no,
    RS_MIMO_TRANSACTION_COUR_NAME = p_courier
    where RS_MIMO_TRANSACTION_REF_NO = p_ref_no(i);
    commit;
    end loop;
    exception
    when others then
    null;
    end;
    When I ran the above all the records are getting updated
    even if I have not clicked the check box.
    Please help me how to check the value of the checkbox in the UPDATE_OUT_RECORDS procedure and updating those records for which the check box is clicked.

    You can declare one more dummy variable in your procedure to be used as checkbox field in your form and with some javascript code you can set the value 'Y'(es) or 'N'(o) in the original variable which you can refer it in your update procedure to update values in the table. Here is the sample code how you can do this:
    declare
    lv_string varchar2(32767);
    li_ind integer;
    begin
    lv_string := '<SCRIPT LANGUAGE="JavaScript">
         function set_chkbx_value(row_num){
         SampleForm.p_yes_no[row_num].value = (SampleForm.p_dummy_chkbx[row_num].checked)?"Y":"N";
    </SCRIPT>';
    lv_string := lv_string ||'<BODY>
              <CENTER>
              <form name=SampleForm action="p_update_table" METHOD="POST" ENCTYPE="multipart/form-data">
              <div align="center">
                   <center><TABLE>
                   <TD align="center"><TABLE BORDER="1" CELLSPACING="2" CELLPADDING="0">
                   <BR><TR>
                   <TH><b><font STYLE="font-family:Tahoma; color:brown; font-size:9pt;">Name</font></b></TH>
                   <TH><b><font STYLE="font-family:Tahoma; color:brown; font-size:9pt;">Salary</font></b></TH></TR><TR>';
         For li_ind in 1..10 Loop     
         lv_string := lv_string ||'<TR><TD ALIGN=middle><INPUT TYPE=text SIZE="20" NAME="p_name" MAXLENGTH = "30" >
                             <INPUT TYPE=text SIZE="10" NAME="p_salary" MAXLENGTH = "30" >
                             <TD ALIGN=middle><INPUT TYPE=checkbox SIZE="1" NAME="p_dummy_chkbx" OnClick="set_chkbx_value('||(li_ind - 1)||')"></TD>
                             <INPUT TYPE="hidden" NAME="p_yes_no"></TR>';
         End Loop;
         lv_string := lv_string ||' </TABLE></CENTER>
              <h2 align="center">
              <INPUT TYPE="Submit" VALUE="SAVE">
              <input type="reset" value="RESET"><h2>
              </TABLE>
              </FORM>
              </BODY>';
    htp.p(lv_string);
    end;
    Create or Replace PROCEDURE p_update_table
    p_name IN PORTAL.wwv_utl_api_types.vc_arr,
    p_salary IN PORTAL.wwv_utl_api_types.vc_arr,
    p_dummy_chkbx IN PORTAL.wwv_utl_api_types.vc_arr,
    p_yes_no IN PORTAL.wwv_utl_api_types.vc_arr
    as
    begin
    for i in 1..p_name.count loop
    If p_yes_no(i) = 'Y' Then
    update emp
    set sal = p_salary(i)
    where ename = p_name(i);
    commit;
    end loop;
    exception
    when others then
    null;
    end;

  • Script to to update users attribute based on EmployeeID Value from CSV file

    Hello, 
    i am trying to build script that read the data from CSV file, the only data exist on this file is the EmployeeID.
    so i need to read the EmployeeID and for each employeeID exist in this sheet in need to disable that user and  change the Description to "Disabled based on the HR Request"
    below script is not working for me any help plz 
    $path = "D:\Private\sample-data.csv"
    $LIST=IMPORT-CSV $path
    $UseremployeeID = $USER.employeeID
    FOREACH ($Person in $LIST) {
    $UserID = Get-ADUser -Filter {employeeID -eq ($LIST.Row[1])}
    foreach ($USER in $UserID){
    Set-ADUser -Identity $User -Description "Disabled based on the HR Request" -Enabled $false

    I managed to know the reason
    you should add -properties EmployeeID  to your code
    <snip>
    Hi,
    That's not necessary. The filtering is done serverside, so you don't need to request that it be returned.
    Example:
    Get-ADUser -Filter "Title -eq 'Some Title In Your Company'"
    Title isn't a default property, but the command above works just fine.
    Don't retire TechNet! -
    (Don't give up yet - 12,575+ strong and growing)

  • Show new page table record based on parameter value in first page in ADF

    I have to show a selected record on a new page whose input query value is in first page. For example I choose to edit an order id  by selecting order id and then pressing Edit Record button then in new page selected order record should show. I am working in ADF JSF pages. I can pass parameter from one page to another by pageFlowScope. but how to display selected record on next page.

    any one to help. I want to use an input parameter on first page to edit the table on new page

  • Cursor to Update Multiple Records

    Hi all
    Oracle forms V6
    I am trying to use a cursor to update multiple rows associated with the change of a single value, the tables are related but not directly through the values I am trying to change. The form is multi-tab with a block per tab. On the first tab a value entered into a specific field is subsequerntly used in another multi-record tab when the time comes to fill this in, the value is automatically inserted, and this works fine.
    If there is multiple records in the second tab then the value from the parent record will be displayed in all records in the 2nd tab because it is automatically taken from the parent record.
    I am trying to use a for-loop cursor to update more than one row when the parent value is updated, at present it only updates one row, yet a message I put in cursor shows the different values being stepped through in the cursor. I don't have much experience in this area yet but it looks like the actual form cursor needs to be moved to the next record to update that as well, as you change to this tab you can see the first record being updated but not the second.
    Cursor is in the when validate item on the first tab/block.
    DECLARE     
    v_cvs_val VARCHAR2(100) := :b1.new_value;
    CURSOR c_cvs IS
         SELECT b2.pk, b2.oldValue
         FROM T1
         WHERE T1.pk = :b2.pk;
         --result set of cursor is all records relating to current parent record
         mcec_rec c_cvs%ROWTYPE; --declares record of cursor type
    BEGIN
         IF :system.record_status = 'CHANGED' AND :b2.pk IS NOT NULL THEN
         OPEN c_cvs;
         LOOP
         FETCH c_cvs INTO mcec_rec;
         :b2.oldValue := v_cvs_val;
         EXIT WHEN c_cvs%NOTFOUND;
         END LOOP;
         CLOSE c_cvs;
         END IF;
    END;
    Any suggestions as to where i'm going wrong would be very much appreciated.
    user605593

    Do I understand correctly? It looks like you have a parent-child relationship where one of the fields on the child table has to be updated when the parent record is changed, but ONLY if the record exists in the child datablock. You don't want to update the child records which exist on the database but not in the block.
    go_block(child);
    first_record;
    loop
      :child.item := :parent.item;
      exit when :system.last_record = 'TRUE';
      next_record;
    end loop;
    go_block(parent);The code has a go_block so cannot be called from a when-validate-item trigger. You could start a timer in that trigger and run the code when the timer expires. However, the when-validate-record trigger might be better as you will not be able to navigate to the child block if there is an invalid field in the parent (eg if a not-null field is blank).

  • Name of String var passed to a for loop?  Array question

    I have a series of String variables named q1String where 1 can be replaced by a value from 1 to 17.
    So I have a for loop:
    for (var i=1;i<18;i++){
    var question_caption_mc:Question_caption_mc = new Question_caption_mc;
    *question_caption_mc.caption_question_string.text=q+i+String;*
    The bold line is causing an error because q is being evaluated separately, i is being evaluated separately, and String is being evaluated separately.  I probably should use a different identifier in my variable definition than String but I was wondering how to properly pass the variable name into the for loop so that
    "question_caption_mc.caption_question_string.text" will equal the value of the variable q1String through q17String.  I know this is simple but I can't seem to figure out how to query this on a web search for a similar thread or solution.
    Can anyone help me solve this?
    Regards,
    -markerline

    Okay, I came up with something that produces the start of the result:
    for (var i=1;i<18;i++){
    var newQStringArray:Array = new Array("q",i,"String");
    var question_caption_mc:Question_caption_mc = new Question_caption_mc;
    var tempArray=newQStringArray;
    var tempString=tempArray.join("");
    question_caption_mc.caption_question_string.text=tempString;
    trace(tempString);
    the trace command comes up with all of the variable names.  However I would like
    question_caption_mc.caption_question_string.text
    to evaluate to the value of tempString or rather q1String through q17String.

Maybe you are looking for

  • Why do I keep getting signed out of iCloud on my iPhone/iPad?

    I keep getting signed out of my iCloud account on both my iPhone and my iPad for no reason. Randomly I keep getting asked for my password but it is entered then  I go back again and I am logged out. I am never logged out of iTunes. I have reset my ph

  • In HTTP log:  Store Critical: Unable to read index file for user/ uid

    All: Sun Java(tm) System Messaging Server 6.2-7.05 (built Sep 5 2006) libimta.so 6.2-7.05 (built 12:18:44, Sep 5 2006) We recently have started to see the following errors in our http logs: [01/Mar/2007:13:03:43 -0500] httpd[5174]: Store Critical: Un

  • Disk space required for business content activation

    Hi everyone, I'm looking for information about how much disk space is required for activation of differents parts of business content (or ultimately, ALL business content in NW04S). I'm also looking for that information on extractors side on R/3. Rea

  • Cluster & Call by reference ( Sorry for the re-posting)

    If this is set to 'true', then what happens when the bean is in a diffent           machine(Cluster)( Does it automatically passes object by 'value' or still           tries to pass the object by reference, in which it is going to be a empty         

  • Extending airport range

    Hi, I have my house wireless via an airport extreme base station and an airport express... all works fine. I now want to extend the wireless network down to my shed, it is some 150m from the house. As the extreme base station has a socket for an exte