Query for updating the records

I have the two tables....
CREATE TABLE temp_1
( ST_NM VARCHAR2(30),STATUS_ID VARCHAR2(1) NOT NULL ENABLE,ST_ID VARCHAR2(20) primary key,REJ_USER_NM varchar2(10))
sample Data :
insert into temp_1 values('S010054','R','ST9749109','TEST_1');
insert into temp_1 values('S010179','R','ST9749147','');
insert into temp_1 values('S010582','N','ST9749258','');
CREATE TABLE temp_2
( REJ_USER_NM VARCHAR2(20),ST_NM VARCHAR2(30),
STATUS_ID VARCHAR2(1) NOT NULL ENABLE,ST_ID VARCHAR2(20))
sample data:
insert into temp_2 values('','S010054','N','ST9749109');
insert into temp_2 values('','S010054','N','ST9749109');
insert into temp_2 values('TEST_1','S010054','N','ST9749109'');
insert into temp_2 values('','S010054','I','ST9749109');
insert into temp_2 values('','S010179','N','ST9749147');
insert into temp_2 values('TEST_2','S010179','N','ST9749147');
insert into temp_2 values('','S010179','N','ST9749147');
insert into temp_2 values('','S010179','N','ST9749147')
insert into temp_2 values('TEST_5','S010582','R','ST9749258');
insert into temp_2 values('TEST_5','S010582','N','ST9749258');
insert into temp_2 values('','S010582','N','ST9749258');
insert into temp_2 values('','S010582','N','ST9749258')
I want the UPDATE query based on below conditions to update the REJ_USER_NM in temp_1 table.
From temp_1 table ,STATUS_ID is 'R' and REJ_USER_NM is null and compare the set_id column value
with the temp_2 table,where REJ_USER_NM is not null and status id is 'N'. REJ_USER_NM column from
temp_2 table need to be update in the REJ_USER_NM column of temp_1 table.
After completion of updation,output is in below format; if i run below qry
====================================
select * from temp_1;
{S010054},{R},{ST9749109},{TEST_1}
{S010179},{R},{ST9749147},{TEST_2}
{S010582},{N},{ST9749258},{}
======================
Edited by: 849971 on May 2, 2011 8:25 PM

Why is that the row
{S010582},{N},{ST9749258},{}
is not updated to TEST_5 ?? Based on your rules and data. it must be updated to test_5. Are you missng any rules?
Try some thing like,
UPDATE temp_1
   SET REJ_USER_NM  =
          (SELECT REJ_USER_NM
             FROM temp_2
            WHERE     status_id = 'N'
                  AND temp_1.st_id = temp_2.st_id
                  AND temp_2.REJ_USER_NM IS NOT NULL)

Similar Messages

  • How to pass values for compound primary keys for updating the record in db.

    i have a entity bean in my ejb with two primary keys to it...eg. roleid,rolename...
    when iam retriving the record i use only one primary key ...so again to modify and update he same record which i retrived is a pbm..
    i cannot set the values for the compoundpk,,,
    but i can do the update for the bean with single primary key..
    i need to know how to pass the values/parameters for the coumpound primary key in my update method...
    thanx in advance...
    Arjun.G

    I istantiated a object for the pk class and assign the values for the primary key fields...
    Arjun.G

  • Query for deleting the minimum updated record.

    Hello Everybody,
    I have table USER_RECENT_PROJECTS which has SIX columns USER_NAME,PROJECT_ID,CREATED_BY,CREATED_ON,UPDATED_BY
    and UPDATED_ON.The purpose of having this table to get 5 recent PROJECTS
    on which user has worked on.
    I have trigger called RECENT_PRJ_TRIGG which IS FIRED when the data is inserted or updated on PROJECT table.After this trigger calls procedure PROC_USER_RECENT_PRJ and that procedure puts the data in this table.
    It is inserting the data upto 5 records when the six records comes it deleting the record which is least UPDATED_ON from the table USER_RECENT_PROJECTS but the problem is it is deleting
    the record from other user that i don't want.I want to delete the the record which is
    least UPDATED_ON from particular user.
    Please help me on this issue.
    Here is the trigger
    CREATE TRIGGER RECENT_PRJ_TRIGG
    AFTER INSERT OR UPDATE ON PROJECT
    FOR EACH ROW
    DECLARE
    NUMBER_OF_PROJECTS NUMBER:=0;
    EXISTING_PROJECT_ID NUMBER:=0;
    BEGIN
    SELECT COUNT(*) INTO NUMBER_OF_PROJECTS FROM USER_RECENT_PROJECTS WHERE USER_NAME=:NEW.UPDATED_BY;
    SELECT PROJECT_ID INTO EXISTING_PROJECT_ID FROM USER_RECENT_PROJECTS WHERE PROJECT_ID=:NEW.PROJECT_ID AND USER_NAME=:NEW.UPDATED_BY;
    NVLX.PROC_USER_RECENT_PRJ(NUMBER_OF_PROJECTS,:NEW.PROJECT_ID,EXISTING_PROJECT_ID,:NEW.UPDATED_BY,:NEW.CREATED_BY,:NEW.CREATED_ON);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NVLX.PROC_USER_RECENT_PRJ(NUMBER_OF_PROJECTS,:NEW.PROJECT_ID,0,:NEW.UPDATED_BY,:NEW.CREATED_BY,:NEW.CREATED_ON);
    END;
    And this is the procedure which is inserting the data
    CREATE OR REPLACE PROCEDURE PROC_USER_RECENT_PRJ (
                   NUMBER_OF_PROJECTS IN NUMBER,
                   NEW_PROJECT_ID IN PROJECT.PROJECT_ID%TYPE,
                   EXISTING_PROJECT_ID IN USER_RECENT_PROJECTS.PROJECT_ID%TYPE,
                   USER_NAME IN CONTENT_USER.USER_NAME%TYPE,
                        CREATED_BY IN PROJECT.CREATED_BY%TYPE,
                        CREATED_ON IN PROJECT.CREATED_ON%TYPE)
              IS
                                  MAX_RECENT_PROJECTS NUMBER := 5;
              BEGIN
                        IF NUMBER_OF_PROJECTS<=MAX_RECENT_PROJECTS AND EXISTING_PROJECT_ID=NEW_PROJECT_ID THEN
                             UPDATE USER_RECENT_PROJECTS SET USER_RECENT_PROJECTS.UPDATED_ON=SYSDATE,USER_RECENT_PROJECTS.UPDATED_BY=USER_NAME WHERE PROJECT_ID=EXISTING_PROJECT_ID
                             AND USER_RECENT_PROJECTS.USER_NAME=USER_NAME;
                        ELSE IF NUMBER_OF_PROJECTS<MAX_RECENT_PROJECTS AND EXISTING_PROJECT_ID!= NEW_PROJECT_ID THEN
                        INSERT INTO USER_RECENT_PROJECTS VALUES (USER_NAME,NEW_PROJECT_ID,CREATED_BY,CREATED_ON,USER_NAME,SYSDATE);
                        ELSE IF NUMBER_OF_PROJECTS=MAX_RECENT_PROJECTS AND EXISTING_PROJECT_ID!= NEW_PROJECT_ID THEN
                        DELETE FROM USER_RECENT_PROJECTS WHERE USER_RECENT_PROJECTS.PROJECT_ID IN(
                                       SELECT PROJECT_ID FROM USER_RECENT_PROJECTS
                                                 WHERE UPDATED_ON=(SELECT MIN(UPDATED_ON) FROM USER_RECENT_PROJECTS
                                  WHERE USER_RECENT_PROJECTS.USER_NAME=USER_NAME));
                   INSERT INTO USER_RECENT_PROJECTS VALUES (USER_NAME,NEW_PROJECT_ID,CREATED_BY,CREATED_ON,USER_NAME,SYSDATE);
                        END IF;
                        END IF;
                        END IF;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NVLX.PROC_USER_RECENT_PRJ(NUMBER_OF_PROJECTS,NEW_PROJECT_ID,0,USER_NAME,CREATED_BY,CREATED_ON);
    END PROC_USER_RECENT_PRJ;
    Please help me on this issue.
    Thanks in advance.....

    Thanks for your suggestion....
    I am using the trigger for populating the data in USER_RECENT_PROJECTS.This
    trigger is fired when data is INSERTED or UPDATED in PROJECT table.And that trigger will call the procedure PROC_USER_RECENT_PRJ.This is used
    to put data in USER_RECENT_PROJECTS table.I am getting the problem in procedure the problem is upto five records it is inserting the record when i go for insert sixth record it should delete least UPDATED_ON and insert new record.But it is deleting the record from other user that i don't want.I want to delete the record from the paarticular user.I am using this query for deleting the record..
                   DELETE FROM USER_RECENT_PROJECTS WHERE USER_RECENT_PROJECTS.PROJECT_ID=(
         SELECT PROJECT_ID FROM USER_RECENT_PROJECTS
                        WHERE UPDATED_ON=(SELECT MIN(UPDATED_ON) FROM USER_RECENT_PROJECTS WHERE USER_RECENT_PROJECTS.USER_NAME=USER_NAME)
                             AND USER_RECENT_PROJECTS.USER_NAME=USER_NAME
                   ) AND USER_RECENT_PROJECTS.USER_NAME=USER_NAME;
    when i fire this query individually it is deleting the proper record,but when i use it
    inside procedure it is creating the problem it is deleting the record from other user.
    Please suggest me other query for deletion.
    Thanks in advance.......

  • Why can't I select or update the Record using the PreparedStatement?

    the DB is oracle9i,here is the test table
    test
    id number;
    name char(10);
    intro char(10);
    I have insert a record in the table.
    Now I will select or update the record by using the PreparedStatement here is my code:
    sqlStr = "update test set intro = ? where name =?";
    PreparedStatement stmt = conn.prepareStatement(sqlStr);
    stmt.setString(1,"my name is irixwang");
    stmt.setString(2,"irixwang");
    int is = stmt.executeUpdate();
    if (is >=1 )
    System.out.println("ok");
    It will not work ,but where I change the update condiction as followed:
    sqlStr = "update test set intro = ? where id =?";
    PreparedStatement stmt = conn.prepareStatement(sqlStr);
    stmt.setString(1,"my name is irixwang");
    stmt.setInt(2,100);
    int is = stmt.executeUpdate();
    It works well,why?
    please help me!thk!!!!

    I doubt it works "well" in either case since you are inserting a string that is longer than 10 characters into a field that only holds 10 characters. But to your question....
    A char data type holds a fixed number of characters - in your case 10.
    Because it holds 10 characters it will never hold 9, regardless of what you think is in the field it will always have 10 characters in it. The value you are using for query for name is 9 characters. Since 9 characters, regardless of content, will never be equal to 10 characters there is no way that it will update.
    So your choice is to either use a varchar, which holds a variable number of characters, or to always use 10 characters for your query (pad it with spaces.)

  • Custome Process for update the date

    Hello Every one,
    I have a page with the check-box where the user can select a record and update the record by pressing on the button.
    I have three processes, and each of these process update one field ( which is a date field) of the page by pressing on the specific button. here are the three processes:
    declare
    begin
    for i in 1..apex_application.g_f01.count loop
    UPDATE  REC_RET_ADD_RECORD
    SET DATE_ADMIN_APPROVED=:P8_DATE_ADMIN_APPROVED
    WHERE REC_RET_ID = APEX_APPLICATION.G_F01(I);
    end loop;
    commit;
    end;
    Condition: When Admin button pressed (submit)
    The second process:
    declare
    begin
    for i in 1..apex_application.g_f01.count loop
    UPDATE REC_RET_ADD_RECORD
    SET DATE_COMMITTEE_APPROVED=:P8_DATE_COMMITTEE_APPROVED
    WHERE  REC_RET_ID = APEX_APPLICATION.G_F01(I);
    end loop;
    commit;
    end;
    Condition: When Committee button pressed (submit)
    The third process:
    declare
    begin
    for i in 1..apex_application.g_f01.count loop
    UPDATE REC_RET_ADD_RECORD
    SET DATE_OHS_APPROVED=:P8_DATE_OHS_APPROVED
    WHERE  REC_RET_ID = APEX_APPLICATION.G_F01(I);
    end loop;
    commit;
    end;
    Condition: When OHS button pressed (submit)
    Now the problem is, when the user selects the row and selects the date for Admin field and presses the Admin button, the system inserts the date but after that if the user wants to selects the same row and update the OHS date, the system will remove the date for Admin field and inserts the OHS date in OHS field and visa verse.
    I don't know why this is happening. Could you please help me. I appreciate it.

    Here is the report query:
    SELECT  apex_item.checkbox (1,
                               REC_RET_ID,
                               'onchange="spCheckChange(this);"',
                               :f_REC_RET_ID_list,
                              ) checkbox,
    "REC_RET_ID",
    "RET_SCHEDULE_NUM",
    "RET_COST_CENTER",
    "RET_TITLE",
    "RET_TITLE_DESC",
    "RET_PERIOD",
    "DATE_USER_INSERTED",
    "DATE_ADMIN_APPROVED",
    "DATE_COMMITTEE_APPROVED",
    "RC3_FORM_REQUIRE",
    "DATE_OHS_APPROVED",
    "DESTRUCTION_SUSPENDED",
    "DESTRUCTION_SUSPENDED_NOTE",
    "INACTIVE_DATE",
    "INACTIVE_DATE_APPROVED",
    "CREATION_DATE",
    "CREATED_BY",
    "LAST_UPDATE_DATE",
    "LAST_UPDATE_BY"
    from REC_RET_ADD_RECORD

  • Updating the  records  problem urgent

    Hi All,
    i have developed search page by using the query region. in that i have created update image icon to navigate update page to update the records. i have 4 search records, when i click the go button 4 records are come to the advance table. i will select any one of the row and select update icon to update the records by using the apply button in update page.when i click the apply button its navigate to the search page and showing only updated records row only. i did not get all 4 rows in advancetable.I re-query on the page, but I can’t get the other 3 rows back unless I close the page and come back in.
    here i am not facing any error, after update the records and come back to the main page i am not getting all records only updated row records Only 1 of the four rows only appear.
    can any one help me its urgent
    Thanks in advance.

    Hi Avajain, thanks for your reply.
    i have used below code for apply button.
    if (pageContext.getParameter("Apply") != null)
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("apply");
    OAException message = new OAException("POS","MODPOS_PROGRAM_UPDATED_CONF",
    null,OAException.CONFIRMATION,null);
    pageContext.putDialogMessage(message);
    pageContext.forwardImmediately("OA.jsp?page=/xxaam/oracle/apps/pos/program/webui/SupProgramPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    AMCODE
    public void apply()
    getTransaction().commit();
    Thanks

  • Windows Server 2008: Sysprep Error: Error [0x0f0073] SYSPRP RunExternalDlls:Not running DLLs; either the machine is in an invalid state or we couldn't update the recorded state, dwRet = 32[gle=0x00000020]

    I have a base template (which has never been sysprep'd) from which I create linked clones.  After the linked clone comes up, I run the following command:
    c:\windows\system32\sysprep\sysprep.exe /generalize /oobe /reboot /unattend:c:\windows\panther\unattend.xml
    This works fine for the first few linked clones, but after about 3-4 linked clones are running, I start to hit "A fatal error occurred while trying to sysprep the machine."
    ****c:\windows\panther\setuperr.log****
    2013-03-29 16:40:07, Error      [0x0f0073] SYSPRP RunExternalDlls:Not running DLLs; either the machine is in an invalid state or we couldn't update the recorded state, dwRet = 32[gle=0x00000020]
    2013-03-29 16:40:07, Error      [0x0f00a8] SYSPRP WinMain:Hit failure while processing sysprep cleanup providers; hr = 0x80070020[gle=0x00000020]
    ****c:\windows\panther\unattend.xml****
    <?xml version='1.0' encoding='utf-8'?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="oobeSystem">
            <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <InputLocale>en-US</InputLocale>
                <SystemLocale>en-US</SystemLocale>
                <UILanguage>en-US</UILanguage>
                <UILanguageFallback>en-US</UILanguageFallback>
                <UserLocale>en-US</UserLocale>
            </component>
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <AutoLogon>
                    <Enabled>true</Enabled>
                    <Username>Administrator</Username>
                    <Password>
                        <Value>ca$hc0w</Value>
                        <PlainText>true</PlainText>
                    </Password>
                </AutoLogon>
                <OOBE>
                    <HideEULAPage>true</HideEULAPage>
                    <NetworkLocation>Work</NetworkLocation>
                    <ProtectYourPC>3</ProtectYourPC>
                </OOBE>
                <UserAccounts>
                    <AdministratorPassword>
                        <Value>ca$hc0w</Value>
                        <PlainText>true</PlainText>
                    </AdministratorPassword>
                </UserAccounts>
                <TimeZone>Pacific Standard Time</TimeZone>
            </component>
        </settings>
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <ProductKey>7M67G-PC374-GR742-YH8V4-TCBY3</ProductKey>
                <ComputerName>*</ComputerName>
            </component>
        </settings>
    </unattend>
    ****c:\windows\panther\setupact.log****
    2013-03-29 16:40:07, Info       [0x0f004d] SYSPRP The time is now 2013-03-29 16:40:07
    2013-03-29 16:40:07, Info       [0x0f004e] SYSPRP Initialized SysPrep log at c:\windows\system32\sysprep\Panther
    2013-03-29 16:40:07, Info       [0x0f0054] SYSPRP ValidateUser:User has required privileges to sysprep machine
    2013-03-29 16:40:07, Info       [0x0f0056] SYSPRP ValidateVersion:OS version is okay
    2013-03-29 16:40:07, Info       [0x0f005e] SYSPRP ScreenSaver:Screen saver was already disabled, no need to disable it for sysprep
    2013-03-29 16:40:07, Info       [0x0f007e] SYSPRP FCreateTagFile:Tag file c:\windows\system32\sysprep\Sysprep_succeeded.tag does not already exist, no need to delete anything
    2013-03-29 16:40:07, Info       [0x0f005f] SYSPRP ParseCommands:Found supported command line option 'GENERALIZE'
    2013-03-29 16:40:07, Info       [0x0f005f] SYSPRP ParseCommands:Found supported command line option 'OOBE'
    2013-03-29 16:40:07, Info       [0x0f005f] SYSPRP ParseCommands:Found supported command line option 'REBOOT'
    2013-03-29 16:40:07, Info       [0x0f005f] SYSPRP ParseCommands:Found supported command line option 'UNATTEND'
    2013-03-29 16:40:07, Info       [0x0f004a] SYSPRP WaitThread:Entering spawned waiting thread
    2013-03-29 16:40:07, Info                         [sysprep.exe] UnattendFindAnswerFile: Looking at explicitly provided unattend file [c:\windows\panther\unattend.xml]...
    2013-03-29 16:40:07, Info                         [sysprep.exe] UnattendFindAnswerFile: [c:\windows\panther\unattend.xml] meets criteria
    for an explicitly provided unattend file.
    2013-03-29 16:40:07, Info                  SYSPRP SysprepSearchForUnattend: Using unattend file at [c:\windows\panther\unattend.xml].
    2013-03-29 16:40:07, Info                  SYSPRP SysprepSearchForUnattend: [generalize] pass in unattend file [c:\windows\panther\unattend.xml] either doesn't exist or passed
    validation
    2013-03-29 16:40:07, Info                  SYSPRP WinMain:Found unattend file at [c:\windows\panther\unattend.xml]; caching...
    2013-03-29 16:40:07, Info                  SYSPRP WinMain:Processing unattend file's 'generalize' pass...
    2013-03-29 16:40:07, Info                  SYSPRP Sysprep is running a generalize pass with the following unattend file: [%windir%\panther\unattend.xml]
    2013-03-29 16:40:07, Info                  SYSPRP RunUnattendGeneralizePass: Sysprep unattend generalize pass exits; hr = 0x0, hrResult = 0x0, bRebootRequired = 0x0
    2013-03-29 16:40:07, Info       [0x0f003f] SYSPRP WinMain:Processing 'cleanup' request.
    2013-03-29 16:40:07, Error      [0x0f0073] SYSPRP RunExternalDlls:Not running DLLs; either the machine is in an invalid state or we couldn't update the recorded state, dwRet = 32[gle=0x00000020]
    2013-03-29 16:40:07, Error      [0x0f00a8] SYSPRP WinMain:Hit failure while processing sysprep cleanup providers; hr = 0x80070020[gle=0x00000020]
    2013-03-29 16:48:52, Info       [0x0f004c] SYSPRP WaitThread:Exiting spawned waiting thread
    2013-03-29 16:48:52, Info       [0x0f0059] SYSPRP ScreenSaver:Screen saver was originally disabled, leaving it disabled
    2013-03-29 16:48:52, Info       [0x0f0052] SYSPRP Shutting down SysPrep log
    2013-03-29 16:48:52, Info       [0x0f004d] SYSPRP The time is now 2013-03-29 16:48:52

    Hi,
    This is typical of an OEM license issue.
    To avoid this in the future you should look at site/volume licensing.
    Anyway.
    so, first check if you can re-arm by runing the
    slmgr.vbs /dlv and check the re-arm counter, if it set to zero.. you need to do the following :
    http://support.microsoft.com/kb/929828 (set the <SkipRearm>1</SkipRearm> like in the example, note: this option will make the product key window to appear in the setup process).
    you can also try running : slmgr.vbs -rearm, to rearm Windows.
    after that, let's come back to the sysprep process.. for syspreping already syspreped machine we have to change few keys in the registry :
    HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\
    CleanupState:2
    HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\
    GeneralizationState:7
    After done with the registry, do the following :
    Start -> Run : msdtc -uninstall (wait few seconds)
    Start -> Run : msdtc -install (wait few seconds)
    Restart the machine
    Check the registry for the right registry keys values
    sysprep with the new XML answerfile.
    Source: Olegm
    If you find my information useful, please rate it. :-)

  • Creation of function module for updating the ztable

    Hi,
    I am sending the requirement for ceation of function module for updating the ztable.
    Requirement----
    Table Updation rule (New record)
    While creating a new record the calling function will export the following to the table handling function.
    Table field     Probable Values
    ZORDERNO------->     Sales Delivery no in case of sales orderShipment no in case of transfer order
    UNAME----
    >     User ID
    ZORDTYPE----
    >     SALEOR in case of sales orderTRANSF in case of transfer order
    ZREFDOCNO----
    >Sales Order no in case of sales orderPurchase Order no in case of transfer order
    ZREFDOCNO1----
    >Delivery no in case of transfer order
    The table handling function will calculate the following fields
    Table field     Probable Values
    ZREQNO----
    >Running serial number (incremented by 1 for each new record)
    ZREQDAT     -
    >System date
    ZREQTIME----
    >     System time
    ZSTATUS----
    >OPEN (for all new records)
    Before inserting a new record the table handling function will always check if a previous record exists for the same order / shipment no. if record exists the function will not insert a new record.
    Table Updation rule (Status Update)
    While updating a record the calling function will export the following to the table handling function.
    Table field     Probable Values
    ZORDERNO----
    >Sales order no in case of sales orderShipment no in case of transfer order
    ZSTATUS----
    >CANCEL if cancellation successfulERROR if cancellation not possible (order already processed)
    The table handling function will calculate the following fields
    Table field     Probable Values
    ZSTATDAT----
    >System date
    ZSTATTIME----
    >     System time

    Do you have to create/update new record in Ztable through Function Module ?
    or you need to write FM only for validation?
    Any how, you need to create a Program with Input values for the fields of Ztable, and for rest of fields the Value can be calculated based on input as per your requirement.
    Let me know clearly what exactly u need ?
    Regards,
    Kiran

  • How to update the record in a File (without closing Writer)?

    Well i've got one issue:
    I want my program to record in a file updating any time i.e the records are added in append.
    But i want the record must be done in a file even if the Writer is not closed because I'd like to see the all logs of user and the main thing is sometimes there could be issue of software crash, powercut off or any So for that reason i 've made code like this but it doesn't update but it only override:
    public boolean write(String s){
            boolean isFinished = false;
            try{
                FileOutputStream out = new FileOutputStream("C:\\new.txt"); 
                int i = 0;              
                while(i != s.length()){
                    out.write(s.charAt(i));
                    i++;
                //here i've not closed file output stream
                isFinished = true;
            catch(IOException i){
                i.printStackTrace();
                isFinished = false;
            return isFinished;
        }

    Well, Thanks for the help but,. i didn't understand
    try not opening the file every time. As I only know that I need to open a file if i would like to update the records..
    The update is not happening :
    Firstly it shows like this (new.txt):
    STOPSecondly it must show like this (new.txt) BUT NOT HAPPENING AS I EXPECTED:
    STOPSTOPBut it's not hapenning

  • Select query for every 1000 records

    Hi all ,
             Please help me in the issue . I am using select query Select * from table up to 1000 rows for acheving the records but i want this process to retrigger once the process of 1000 records is compleded again it needs to fetch the next 1000 records and process the same . I am changing the status of the processed records once it is processed . Can can one tell me how to retrigger the select query once the 1000 records are processes.
    Thanks in advance,

    Hi Eric,
                  After selecting the 1000 records, find the key value of the last record. Build up the range as GT. Again use the select query.
    For example,
    Select * into table lt_data from ztab
    where key in r_key
    up to 1000 rows.
    regards,
    Niyaz

  • FRM-40509: ORACLE error : Unable to update the record.

    Hi,
    I am having the following code in delete button.
    declare
         v_button  NUMBER;
    begin
      IF :CHNG_CNTRL_JOB_DTLS.SENT_DATE IS NULL THEN
                   v_button := fn_display_warning_alert( 'Do you want to delete the version ?');
                   IF ( v_button = alert_button1 )
                        THEN
                          message('before insert');
                          insert into chng_cntrl_job_dtls_log
                          select * from chng_cntrl_job_dtls
                          where job_name = :CHNG_CNTRL_JOB_DTLS.job_name
                          and job_version_no = :CHNG_CNTRL_JOB_DTLS.job_version_no
                          and sent_date is null;
                          message('before delete');
                          delete from CHNG_CNTRL_JOB_DTLS
                          where job_name = :CHNG_CNTRL_JOB_DTLS.job_name
                          and job_version_no = :CHNG_CNTRL_JOB_DTLS.job_version_no
                          and sent_date is null;
                          message('before commit');
                          silent_commit;
                          go_item('CHNG_CNTRL_JOB_DTLS.JOB_NAME');
                          P_DELETE_SET_PROPERTY;
                          clear_form;
                   ELSIF ( v_button = alert_button2 )
                        THEN
                          null;
                END IF;
         ELSE
                p_display_alert('Version '||:CHNG_CNTRL_JOB_DTLS.JOB_VERSION_NO||' for the job name '||:CHNG_CNTRL_JOB_DTLS.JOB_NAME||' cannot be deleted.','I');
      END IF;
         exception
              when others then
              message ('Exception in delete version button');
              end;when i am trying to save it says " *FRM-40509: ORACLE error : Unable to update the record*." .
    i am getting message till before commit.
    i am not able to check the error message in help as it is diabled in our form builder.
    I have checked the privileges also. they are fine.
    Please advice.
    Edited by: Sudhir on Dec 7, 2010 12:26 PM

    This error does not come from your procedure code, but from Forms itself. If you are in a database block, change something, and do a commit (either via a Forms key or in your own procedure), Forms commits the changes. For some reason this is not possible. You can see the database error via the Display Error key (often Shift-F1).
    I see in the OP that this key is disabled. Change the on-error code then:
    begin
       message(dbms_error_code||'-'||dbms_error_text);
       raise form_trigger_failure;     
    end;     Edited by: InoL on Dec 7, 2010 8:50 AM

  • Wanted to update the software now available, but it is asking for a pass code. As far as I remember in didn't put in any pass code , how do I settle this issue . Earlier updates were asking Apple ID but pass code for updating the new soft ware not known.

    Wanted to update the software now available, but it is asking for a pass code. As far as I remember in didn't put in any pass code , how do I settle this issue . Earlier updates were asking Apple ID but pass code for updating the new soft ware not known.

    Hello Kewal,
    Thank you for the details of the issue you are experiencing when trying to perform an update.  I recommend trying to update using iTunes, and as always, it is a good idea to make a backup first. 
    iOS: Back up and restore your iOS device with iCloud or iTunes
    http://support.apple.com/kb/ht1766
    Update your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/ht4623
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • I have ios 5.1.1 and when I check for updates the phone says there are no updates

    i have ios 5.1.1 and when I check for updates the phone says there are no updates

    Go to Settings > General > Software Update and see if you can update it over the air.

  • SQL query to populate the records, the maximum processed should be less than 10 records per week.

    Dear All,
    I have a requirement, to write a SQL query to populate the records which are inserted less than 10 no of records.
    The tables has the cretaed_date column and along with other key column which will have unique values.
    Ex1:  The user might have inserted records from application, per week basis, between the date range '01-jun-2013' - 08-jun-2013  , the no of records created by the user during this week may be less than 10 records or more.
    But I want to populate the records by giving date range that too, it should pick the records the count which fall with in 10 records.
    I dont want the query to populate the records if the user has inserted more than 10 records in a week.
    Ex2:
    User 1 has created 15 records during the week 1 ( the query should not populate this ).
    User 2: has cretaed less than 10 records from the UI during the week 2. ( This details should get populated ).
    Thanks

    Use COUNT to find how many rows where inserted in a week.
    If this does not answer your question then please read Re: 2. How do I ask a question on the forums? And provide necessary details.

  • Function module or BAPI that is used to update the records in RBKP table.

    Hello All,
    Can anybody please give me the name of any Function module or BAPI that is used to update the records in RBKP table.
    Please help me
      I need to change the fiscal year in RBKP table
    Thanks in Advance,
    Regards,
    LIJO

    Hi,
    You can use the BAPIs,
    BAPI_ACC_INVOICE_RECEIPT_CHECK Accounting: Check Invoice Receipt (OAG: LOAD PAYABLE)
    BAPI_ACC_INVOICE_RECEIPT_POST  Accounting: Post Invoice Receipt (OAG: LOAD PAYABLE)
    Hope this helps.
    Regards,
    Renjith Michael.

Maybe you are looking for

  • Need inputs : PO Smartform in Bulgaria language

    Hi Experts, I need a couple of suggestions and guide lines for PO print out Smart form. We have requirement for PO, print  out should print in Bulgaria language if the PO Vendors is from Bulgaria country. And if the vendor is other than Bulgaria coun

  • What is the BEST WAY to define a circle in PDF?

    Hi All I have been making circles in PDF in two ways and they both seem a little "hinky". One is using 4 bezier curves to approximate the circle which works pretty well and the other for smaller circles has been to use a thick line with a round end c

  • Performance issues - Log file parallel write

    Hi there, Since a few months I have big performance issues with my Oracle 11.2.0.1.0. If I look in the Enterprise manager (in blocking sessions) I see al lot of "log file paralles writes" and a lot of "log file sync" . We have configured an active da

  • Erratic behaviour of 'all day events'

    I use iCal very successfully for recording campsite bookings. It's only a small campsite - never more than ten pitches at a time, so at best I have 10 'all day events' spread across a week view (as discussed in this forum, month view is no use for vi

  • How can I install these printer drivers?

    I have a Brother HL-2220, which doesn't appear in any packages in the AUR (I already have CUPS and hplip installed, and the printer isn't yet recognized with cupsd running). Its drivers are available here, in both rpm and deb format. How can I instal