Cursor should be at Current checkbox

Hi All,
I have written the coding.If i check the record,and do some calculations affter click on Pre-Calculate Button again the cursor is going to 1st record.
plss can any one help me in this issue..
In WHEN_BUTTON_PRESSED trigger i have written the coding
     DECLARE     
                    CURRENTRECORD NUMBER;
begin
     /* HERE IS THE CODE FOR DISCOUNT RATE IF THE USER CHECKS ALL FOR SELECT FOR DISCOUNT RATE AS WELL AS DISCOUNT REASON */
BEGIN
          DECLARE
               CURRENT_DISCOUNT NUMBER;
               CURRENT_REASON VARCHAR2(100);     
          BEGIN
               CURRENT_DISCOUNT:=:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE ;
               CURRENT_REASON:=:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON;
               CURRENTRECORD :=:SYSTEM.CURSOR_RECORD;
               FND_MESSAGE.SET_STRING(CURRENTRECORD);
               FND_MESSAGE.SHOW;
               IF :XXSY_DISCOUNT_MANAGER_V.SELECT='Y' THEN
--               go_block('XXSY_DISCOUNT_MANAGER_V');
               FIRST_RECORD;
               WHILE TRUE LOOP
               :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:= CURRENT_DISCOUNT;
               :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:= CURRENT_REASON;
                    NEXT_RECORD;
                         IF :System.Last_Record = 'TRUE' THEN                    
                         :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:=CURRENT_DISCOUNT;
                         :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:=CURRENT_REASON;
                    exit;
                         END IF;     
               END LOOP;
               END IF;
--               go_block('XXSY_DISCOUNT_MANAGER_V');
               FIRST_RECORD;
               WHILE TRUE LOOP
                    if :XXSY_DISCOUNT_MANAGER_V.DISCOUNT='Y' THEN
               :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:= CURRENT_DISCOUNT;
               :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:= CURRENT_REASON;
                    end if;
                              NEXT_RECORD;
                    IF :System.Last_Record = 'TRUE' AND :XXSY_DISCOUNT_MANAGER_V.DISCOUNT='Y' THEN                    
                    :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE:=CURRENT_DISCOUNT;
                    :XXSY_DISCOUNT_MANAGER_V.DISCOUNT_REASON:=CURRENT_REASON;
               exit;
                    ELSE if :System.Last_Record = 'TRUE' and :XXSY_DISCOUNT_MANAGER_V.DISCOUNT <>'Y' then
                         exit;
end if;
                    END IF;
               END LOOP;
               END;               
END;
--     go_block('XXSY_DISCOUNT_MANAGER_V');
     FIRST_RECORD;
     WHILE TRUE LOOP
     if :XXSY_DISCOUNT_MANAGER_V.DISCOUNT = 'Y' AND :XXSY_DISCOUNT_MANAGER_V.NO_CHARGE_FLAG ='N' then
                    :XXSY_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE:=round((((100-:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE)/100)*:XXSY_DISCOUNT_MANAGER_V.LIST_PRICE),2);
                    :XXSY_DISCOUNT_MANAGER_V.EXTENDED_PRICE := round((:XXSY_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XXSY_DISCOUNT_MANAGER_V.QUANTITY),2);
                    :XXSY_DISCOUNT_MANAGER_V.NET_PRICE := :XXSY_DISCOUNT_MANAGER_V.EXTENDED_PRICE;
          END IF;     
               NEXT_RECORD;
          IF :System.Last_Record = 'TRUE' THEN
if :XXSY_DISCOUNT_MANAGER_V.DISCOUNT = 'Y' AND :XXSY_DISCOUNT_MANAGER_V.NO_CHARGE_FLAG ='N' then     
               :XXSY_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE:=round((((100-:XXSY_DISCOUNT_MANAGER_V.DISCOUNT_RATE)/100)*:XXSY_DISCOUNT_MANAGER_V.LIST_PRICE),2);
                    :XXSY_DISCOUNT_MANAGER_V.EXTENDED_PRICE := round((:XXSY_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XXSY_DISCOUNT_MANAGER_V.QUANTITY),2);
                    :XXSY_DISCOUNT_MANAGER_V.NET_PRICE := :XXSY_DISCOUNT_MANAGER_V.EXTENDED_PRICE;
          END IF;
          exit;
          END IF;
     END LOOP;
               FND_MESSAGE.SET_STRING(CURRENTRECORD);
               FND_MESSAGE.SHOW;               
go_record(CURRENT_RECORD);
end;
Pls check and pls let me know.
Even i have given display message it is displying the record ,but again itis giong to 1st record.
pls help me
Regards
Prasad.

hi
Try this before get the current record number :
GO_BLOCK( 'XXSY_DISCOUNT_MANAGER_V') ;
CURRENTRECORD :=:SYSTEM.CURSOR_RECORD ;
then your code and maybe u have to back to the previouse record to not break your calculation
Finally at the end of trigger
GO_BLOCK( 'XXSY_DISCOUNT_MANAGER_V') ;
go_record(CURRENT_RECORD);
end ;

Similar Messages

  • Cursor should be placed in Current Record.

    Hi All,
    I have a form,if in tabular form.
    For Exp : if the user have done change in the 2nd record and click on save button.The cursor is going to the 1st record automatically.
    After save also change also the cursor should be in the same changes record.
    Can any help me in this issue...
    Regards
    Siva

    Hi again
    i have a code , but i am not sure if its the most perfet solution for your problem
    the code should be in KEY_Commit trigger or on on_commit as follows :
    ---===================================================
    Declare
         V_REC_NO number ;
    Begin
         v_rec_no := :System.Cursor_Record ;
         --any code you need to do on commiting
         Commit ;
         go_record ( v_rec_no ) ;
    End ;
    -====================================================
    Thank you

  • Cursor remaining in the current item even after pressing Enter-Query

    We have an application running in 10g.
    We are getting similar problems in three forms of the application.
    In the form there are 2 datablocks which has a master-detail relationship.
    After the data for the first datablock is retreived, when I click on any of the items and give enter-query, the cursor remains in the same item.
    Ideally the cursor should move to the first item in the datablock after entering the enter-query mode. But it is not happening.
    This is working fine in the other forms. When i give enter-query, the cursor is going back to the first item.
    Only in these three forms, it is behaving differently.
    Expecting a quick reply...

    did you check if the items in object navigator have the same order as on canvas?
    in normal case the cursor goes to the first enterable item in block when entering in query mode.
    as workaround you can write your own KEY-ENTQRY trigger:
    ENTER_QUERY;
    GO_ITEM('YOUR_BLOCK.YOUR_ITEM');

  • Should I uninstall current CS6 before installing CreativeCloud app?

    Should I uninstall current CS6 before installing CreativeCloud app?
    I have the CS6 Master Suite and have kept it updated, do I need to uninstall that before installing the creative cloud apps?
    cheers,
    Fred    

    Not necessary. CC will recognise existing installs and simply substitute the licensing.
    Mylenium

  • Execute store procedure( in Id, in out RefCursor), and data fetched in ref cursor should be sent out as excel sheet.

    I am trying to make a ssis package that get the data calling the store proc with two param one is ID and other is Sys_refcursor. Say Store Proc as ListName(Id int, myCur sys_refcursor), which gets the datas with the conditions inside it.
    REATE OR REPLACE PROCEDURE schemaName.LISTNAME (P_ID  IN INT, LST_NAME_REFCUR   IN OUT SYS_REFCURSOR)
    IS
    P_NAMESOURCE_ID INT;
    BEGIN
        SELECT SOURCE_ID INTO P_NAMESOURCE_ID FROM SEARCHING_TABLE ST WHERE ST.ID = P_ID;           
                   IF (P_NAMESOURCE_ID=1)
                   THEN
                      OPEN LST_SOURCE_REFCUR FOR 
                            SELECT ST.ID,
                                   ST.TRANSACTION_DATE AS TRAN_DATE,
              IF (P_NAMESOURCE_ID=1)
                   THEN 
                      OPEN LST_SOURCE_REFCUR FOR             ....     
    then i need to get the data from that refcursor and fetch those data to excel sheet to a virtual directory.
    Any help would be appreciated. I am new to SSIS. and i need to do this assignment this friday. 

    Hi 11srk,
    To fetch data from Oracle store procedure, you can use a Script Component as source to call the Oracle stored procedure by using System.Data.OracleClient OracleDataReader, and get the rows and add them to the pipeline buffer. For more information, please
    see:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1d0b3a1b-8792-469c-b0d1-f2fbb9e9ff20/dump-oracle-ref-cursor-into-ms-sql-staging-table-using-ssis
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/fcdaa97e-8415-4c3e-8ffd-1ad45b590d57/executing-an-oracle-stored-procedure-from-ssis?forum=sqlintegrationservices
    http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracledatareader(VS.90).aspx  
    Regards,
    Mike Yin
    TechNet Community Support

  • Independent Cursor Usage from the Current Plotting

    Dear All,
    In the program I've written, the signal is being read from a quad detector and simultaneously plotted. At the time being, the flexibility of my program is very low since the cursor activation is located right after the data reading code and thus, I must enter the cursor mode (i.e. the event structure by which I perform various action with the cursor has to be stopped in order to exit these two codes (reading and cursor activation) which are in a different main event structure).
    Indeed, I want to remove the cursor activation event structure and put it in the outer event structure as an individual event. To do so, I need to save the data the detector is reading (XY data) in a local or global variable so I can pass to the cursor activation mode separately. I've already tried the latter option and realized that the program stops receiving any command by the user and the only solution is to kill the program!
    I suspect that not directly sending the collected array of data into the cursor activating structure is the reason why the separated cursor event structure does not receive any command.
    I would be greatly thankful for your helps in advance.
    Kind Regards,
    Arman 

    Well, this needs to be redesigned from scratch. You have event structures inside while loops inside event structures. This is way too convoluted. An event structure always needs to be ready to fire (note that event structures queue up an infinite amount of events, even if they never get a chance to execute them because they are no reachable by dataflow because the code is trapped inside another loop).
    I cannot really debug your code. My laptop screen resolution is not high enough to get an overview of the code.
    All you probably need is a simple state machine with an event based producer loop and a consumer loop to do the lifting. Use a parallel loop to handle UI interactions. Have a look at the design patterns.
    LabVIEW Champion . Do more with less code and in less time .

  • Content-aware move cursor should reflect use of Shift- or Alt-

    It appears that I can modify the content-aware selection using familiar techniques: Hold the Shift key to add areas to the selection, hold the Alt key to remove areas from the selection.  I think it would help if the cursor changed, much as it does with the regular lasso: Add a plus or minus sign.

    You can use any of the selection tools to make the initial selection.  Then use the Move tool to drag to new location.
    Although your point does sound valid to me.

  • User exit for vf01 for delivery date should be a current date

    Hi Experts,
                   I won t allow to save vf01 delivery date mismatch with system date. Delivery date must equal with system date. kindly give any userexit for this issue.
    regards
    G.Vendhan

    Hi Vendhan,
    Probably we are waiting for your Reply.......
    You didn't replied to MxG question.....that whether writing VF01 for delivery was a typing mistake or you actually mean it.
    Your reply will help us to answer your thread.......in case you already solved the problem by yourself.....I suggest you to close the Thread......and you may share the solution implemented/used ...so as to avoid a redundant thread creation in the future.

  • How to get highest number of open cursors within the current calendar day

    Hi all ,
    i need to know how to get the highest number of open cursors within the current calendar day.
    Thanks ,

    823030 wrote:
    the issue is my customer is getting the error ORA-01000: maximum open cursors exceeded and we need an sql statment that gets the following values :
    -highest number of open cursors experienced in the current calendar day.
    -current open cursors
    -and maximum open cursorsThis error is rare. It happens when
    a) the value of the open cursor parameter is set extremly low (default is something like 1000). Low would be something like 10.
    b) <strike>you have many concurrent users(=sessions) and </strike>the application does not use bind values
    In this case each select will open a new cursor, instead of reusing it.
    c) you have a select that opens a cursor for each line. This can happen with a statement where you have the CURSOR keyword somewhere in the select or where clause. Those cursors will be closed when the select is finished. But during the run time of the select, all cursors stay open.
    To track the number of "open cursors" during the day you would need to implement some monitoring. Maybe based on the view that was already mentioned.
    Edited by: Sven W. on May 16, 2011 2:30 PM - since the parameter is on session level, other open cursors should not influence it much.

  • Drawing current  Cursor Image.

    I want to draw the current cursor image on the BufferedImage. Basically I am taking snapshot of desktop using java.awt.Robot. But the image of desktop does not contain mouse cursor image . How can I know which type of cursor image I should draw(Hand cursor, Move Cursor for example ...). Is there api which will allow me to create mouse cursor image based on current cursor style, when snapshot of desktop image was taken?.

    Hi,
    I'm afraid there is no API for that. I've been looking for it as well. The issue has been discussed on the java dot net forums also.
    [http://forums.java.net/jive/message.jspa?messageID=293665#293665]
    Piet

  • Help plss Should a cursor be created in database or program unit in forms l

    Where can i create a cursor should it be in database i.e isql plus using internet explorer or should i create the cursor in forms
    forms can i create the cursor so that i can use the cursor in the post item trigger of the userid item of login page
    Can i create the cursor in a package specification and how can i call that cursor into a post_text item trigger
    details below
    Iam working on a Online exam for students Dummy project using forms
    The student 1st comes to a WELCOME page i.e form which asks him if he is a new student or registered stud
    If he clicks registered pushbutton it takes him to a LOGIN page where there are two items userid and password.I am using a Validate_item OR Post_item trigger to fire after the student enters his userid.
    I need to compare the entered userid with the userid stored in the database STUDENTS table which i created which consists of the registered students details.
    Our project Guide suggested that we create a cursor and fetch each userid everytime into the cursor and compare the entered userid with the cursor.

    hi Sqlstar,
    Regarding to your all questions , i prefered that you search for a simple document or book in order to understand much more more about creating cursors.
    however since this forum made to help people and to make a integerated community i would be glad to offer my help and going with you step bt step with your answers.
    as for beginning
    1) when you create the user_exists function in database , if you want to call it in the form level you would wirte a code like this
    ----WHEN-VALIDATE-ITEM------------user_id item---------
    IF scheme_name.procedure_name(:block1.userid)!='TURE' then
       message('User Name is not correct');
       raise form_trigger_failure;
    end if;
    2) it's not a waste of recourse to make 2 validation of both userid and password
    and as same you create a procedure for useris you should create a procedure for password where the user id is the outcomming of userid item in the form.
    3)you have all choices to create the 2 procedures on database side or in the program unit at design time for the form it's up to you and as a small hint for you ,
    when you create them in the program unit and want to call the procedures in the WHEN-VALIDATE-ITEM  trigger you should denote the procedure name with the name of package first as following
    -------[Package Spec Code]-------
    PACKAGE user_validation IS
    function user_exists (p_user_id number) return boolean;
    end ;
    --------------[Package Body Code]------
    PACKAGE BODY user_validation IS
    function user_exists (p_user_id number) return boolean
    is
    user_number number;
    cursor c_user_id is
    select user_id from <user_table>
    where user_id=p_user_id;
    begin
    open c_user_id ;
    loop
    fetch user_id  into user_number ;
    return (true);
    exit when c_user_id%NOTFOUND;
    end loop;
    execption  when others then
    return(false);
    end user_exists;
    end;
    -----Calling at Validation level-----------
    IF (user_validation.user_exists(:block1.userid))!=TURE then
       message('User Name is not correct');
       raise form_trigger_failure;
    end if;
    i hope this could be helpful engouh to start your application
    Good Luck .
    Regards
    Omar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Should display the cursor automatically

    hi,
    i have written the code in html format
    <html>
    <head>
    </head>
    <body>
    <br><br><br><br>
    <form name="myForm" method="post" action="book.jsp">
    <table align="center" bgcolor="LIGHTBLUE">
         <tr>
              <td colspan=3 align="center"><b>
              <span style="font-size:20px;">Enter Id to get details</span></b></td>
         </tr>
         <tr>
              <td><b>ID</b></td>
              <td><input type="text" name="id" value=""></td>
              <td><input type="submit" name="Submit" value="Submit"></td>
         </tr>
    </table>
    </form>
    </body>
    </html>
    then the output willl come...
    my doubt is in the text field the cursor should be come automatically can you guide me.

    {color:red}I{color} {color:orange}k{color}{color:yellow}n{color}{color:green}o{color}{color:blue}w{color} {color:black}I{color} {color:pink}h{color}{color:brown}a{color}{color:red}v{color}{color:orange}e{color} {color:yellow}a{color} {color:green}l{color}{color:blue}i{color}{color:black}t{color}{color:pink}t{color}{color:brown}l{color}{color:red}e{color} {color:orange}p{color}{color:yellow}r{color}{color:green}o{color}{color:blue}g{color}{color:black}r{color}{color:pink}a{color}{color:brown}m{color} {color:red}l{color}{color:orange}y{color}{color:yellow}i{color}{color:green}n{color}{color:blue}g{color} {color:black}a{color}{color:pink}r{color}{color:brown}o{color}{color:red}u{color}{color:orange}n{color}{color:yellow}d{color} {color:green}s{color}{color:blue}o{color}{color:black}m{color}{color:pink}e{color}{color:brown}w{color}{color:red}h{color}{color:orange}e{color}{color:yellow}r{color}{color:green}e{color} {color:blue}t{color}{color:black}o{color} {color:pink}m{color}{color:brown}a{color}{color:red}k{color}{color:orange}e{color} {color:yellow}m{color}{color:green}y{color} {color:blue}p{color}{color:black}o{color}{color:pink}s{color}{color:brown}t{color}{color:red}s{color} {color:orange}c{color}{color:yellow}a{color}{color:green}n{color}{color:blue}d{color}{color:black}y{color}-{color:pink}c{color}{color:brown}o{color}{color:red}l{color}{color:orange}o{color}{color:yellow}u{color}{color:green}r{color}{color:blue}e{color}{color:black}d{color}, {color:pink}r{color}{color:brown}a{color}{color:red}i{color}{color:orange}n{color}{color:yellow}b{color}{color:green}o{color}{color:blue}w{color}-{color:black}b{color}{color:pink}r{color}{color:brown}i{color}{color:red}g{color}{color:orange}h{color}{color:yellow}t{color} {color:green}c{color}{color:blue}o{color}{color:black}n{color}{color:pink}f{color}{color:brown}e{color}{color:red}c{color}{color:orange}t{color}{color:yellow}i{color}{color:green}o{color}{color:blue}n{color}{color:black}s{color}. {color:pink}A{color}{color:brown}h{color}, {color:red}h{color}{color:orange}e{color}{color:yellow}r{color}{color:green}e{color} {color:blue}i{color}{color:black}t{color} {color:pink}i{color}{color:brown}s{color}!

  • Script to delete users profile only months old profile with the Registry itself but should leave current profile intact.

    Hi every one.
    first of all sry if this post is repetitive for the profile deletion.
    If you have a correct link please post it below or the script itself.
    Question: as i have a lot of computers with windows 7 (2400 systems) as the operating system on them and as the users keep on changing or shifting place from one PC to another PC and managing the system or the C drive for the consistent system performance
    or freeing space is a challenging task.
    I would like have a Script that would only delete old (No of Months) profile as well as the registry itself  but should keep the current profile instanct the the registry too.
    I did find the below script on some forum that gets the job done but not the right way as it deletes all the profile and excludes the admin,administrator etc as seen in the script but i cannot delete the old profile of a certain time or date period.
    As again sorry if this post looks like mess but help is appreciated 
    @echo off
    ' DELETES LOCAL PROFILES ON WINDOWS 7
    :START
    FOR /f "tokens=*" %%a IN ('dir c:\USERS /b /ad') DO CALL :PATHCHECK "%%a"
    GOTO REGISTRY
    ::The following is where you would put in the profile you wish to exclude from the wipe. Just copy/paste a line and make the appropriate revisions.
    :PATHCHECK
    IF /i [%1]==["Administrator"] GOTO :PATHSKIP
    IF /i [%1]==["Admin"] GOTO :PATHSKIP
    IF /i [%1]==["All Users"] GOTO :PATHSKIP
    IF /i [%1]==["Default"] GOTO :PATHSKIP
    IF /i [%1]==["Default user"] GOTO :PATHSKIP
    IF /i [%1]==["public"] GOTO :PATHSKIP
    GOTO PATHCLEAN
    :PATHSKIP
    ECHO. Skipping path clean for user %1
    GOTO :EOF
    :PATHCLEAN
    ECHO. Cleaning profile for: %1
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHFIRST
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHFIRST
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHSECOND
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHSECOND
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    GOTO :EOF
    :REGISTRY
    ECHO.------------
    FOR /f "tokens=*" %%a IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECK "%%a"
    GOTO VERIFY
    ::The following is where it parses the registry data and checks it against the user path. Copy/paste the IF line and make the user modification needed.
    :REGCHECK
    FOR /f "tokens=3" %%b in ('reg query %1 /v ProfileImagePath') DO SET USERREG=%%b
    IF /i [%USERREG%]==[c:\Users\Administrator] GOTO :REGSKIP
    GOTO REGCLEAN
    :REGSKIP
    ECHO. Skipping registry clean for %USERREG%
    GOTO :EOF
    :REGCLEAN
    ECHO. Cleaning registry for: %USERREG%
    reg delete %1 /f
    GOTO :EOF
    ::The cleaning portion of the script is now done. Now begins the verification and log reporting.
    :VERIFY
    FOR /f "tokens=*" %%c IN ('dir c:\USERS /b /ad') DO CALL :VERIFYPATH "%%c"
    ::Same thing as the clean - if you need to exclude an account, make your copy/paste below.
    :VERIFYPATH
    IF /i [%1]==["Administrator"] GOTO :EOF
    IF /i [%1]==["All Users"] GOTO :EOF
    IF /i [%1]==["Default"] GOTO :EOF
    IF /i [%1]==["Default user"] GOTO :EOF
    IF /i [%1]==["public"] GOTO :EOF
    GOTO VERPATHREPORT
    :VERPATHREPORT
    ECHO. %1
    IF /i [%1]==[] (
    set PATHRESULT=PATH_SUCCESS
    ) ELSE (
    set PATHRESULT=PATH_FAILURE
    ECHO. %PATHRESULT%
    GOTO REGVERIFY
    :REGVERIFY
    ECHO.------------
    FOR /f "tokens=*" %%d IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECKVERIFY "%%d"
    GOTO REGVERIFYECHO
    ::Same thing as the registry clean - copy/paste excluded profiles below.
    :REGCHECKVERIFY
    FOR /f "tokens=3" %%e in ('reg query %1 /v ProfileImagePath') DO SET USERREGV=%%e
    IF /i [%USERREGV%]==[c:\Users\Administrator] GOTO :EOF
    GOTO REGVERIFYECHO
    :REGVERIFYECHO
    ECHO. %1
    IF /i [%1]==[] (
    set REGRESULT=REG_SUCCESS
    ) ELSE (
    set REGRESULT=REG_FAILURE
    ECHO. %REGRESULT%
    GOTO REPORTCHECK
    ::The following is where you would enter the mapped drive path.
    ::You can use a straight UNC if you like, but I find this to be a bit
    ::more solid and it allows you to use different creds in case you
    ::automate it for a local scheduled task to run as local admin.
    :REPORTCHECK
    'net use t: \\server\path
    'IF EXIST "t:\labreport.txt" (
    'GOTO REPORTGEN
    ') ELSE (
    'GOTO EXIT
    ::This is a time/date stamp creator that I actually pulled from a Minecraft
    ::to Dropbox backup script I made a long while back.
    ':REPORTGEN
    'FOR /F "tokens=1 delims=:" %%f in ('time /T') DO SET T=%%f
    'FOR /F "tokens=*" %%g in ('echo %date:~10,4%-%date:~4,2%-%date:~7,2% %T%-%time:~3,2%-%time:~6,2%') DO SET TDATETIME=%%g
    ECHO. %PATHRESULT% %REGRESULT% %COMPUTERNAME% %TDATETIME% >> "t:\labreport.txt"
    net use t: /delete
    GOTO EXIT
    :EXIT
    exit
    :EOF

    Hi every one.
    first of all sry if this post is repetitive for the profile deletion.
    If you have a correct link please post it below or the script itself.
    Question: as i have a lot of computers with windows 7 (2400 systems) as the operating system on them and as the users keep on changing or shifting place from one PC to another PC and managing the system or the C drive for the consistent system performance
    or freeing space is a challenging task.
    I would like have a Script that would only delete old (No of Months) profile as well as the registry itself  but should keep the current profile instanct the the registry too.
    I did find the below script on some forum that gets the job done but not the right way as it deletes all the profile and excludes the admin,administrator etc as seen in the script but i cannot delete the old profile of a certain time or date period.
    As again sorry if this post looks like mess but help is appreciated 
    @echo off
    ' DELETES LOCAL PROFILES ON WINDOWS 7
    :START
    FOR /f "tokens=*" %%a IN ('dir c:\USERS /b /ad') DO CALL :PATHCHECK "%%a"
    GOTO REGISTRY
    ::The following is where you would put in the profile you wish to exclude from the wipe. Just copy/paste a line and make the appropriate revisions.
    :PATHCHECK
    IF /i [%1]==["Administrator"] GOTO :PATHSKIP
    IF /i [%1]==["Admin"] GOTO :PATHSKIP
    IF /i [%1]==["All Users"] GOTO :PATHSKIP
    IF /i [%1]==["Default"] GOTO :PATHSKIP
    IF /i [%1]==["Default user"] GOTO :PATHSKIP
    IF /i [%1]==["public"] GOTO :PATHSKIP
    GOTO PATHCLEAN
    :PATHSKIP
    ECHO. Skipping path clean for user %1
    GOTO :EOF
    :PATHCLEAN
    ECHO. Cleaning profile for: %1
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHFIRST
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHFIRST
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    IF EXIST "C:\USERS\%1" GOTO RETRYPATHSECOND
    IF NOT EXIST "C:\USERS\%1" GOTO :EOF
    :RETRYPATHSECOND
    ECHO. Error cleaning profile for: %1 - Trying again.
    rmdir C:\USERS\%1 /s /q > NUL
    GOTO :EOF
    :REGISTRY
    ECHO.------------
    FOR /f "tokens=*" %%a IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECK "%%a"
    GOTO VERIFY
    ::The following is where it parses the registry data and checks it against the user path. Copy/paste the IF line and make the user modification needed.
    :REGCHECK
    FOR /f "tokens=3" %%b in ('reg query %1 /v ProfileImagePath') DO SET USERREG=%%b
    IF /i [%USERREG%]==[c:\Users\Administrator] GOTO :REGSKIP
    GOTO REGCLEAN
    :REGSKIP
    ECHO. Skipping registry clean for %USERREG%
    GOTO :EOF
    :REGCLEAN
    ECHO. Cleaning registry for: %USERREG%
    reg delete %1 /f
    GOTO :EOF
    ::The cleaning portion of the script is now done. Now begins the verification and log reporting.
    :VERIFY
    FOR /f "tokens=*" %%c IN ('dir c:\USERS /b /ad') DO CALL :VERIFYPATH "%%c"
    ::Same thing as the clean - if you need to exclude an account, make your copy/paste below.
    :VERIFYPATH
    IF /i [%1]==["Administrator"] GOTO :EOF
    IF /i [%1]==["All Users"] GOTO :EOF
    IF /i [%1]==["Default"] GOTO :EOF
    IF /i [%1]==["Default user"] GOTO :EOF
    IF /i [%1]==["public"] GOTO :EOF
    GOTO VERPATHREPORT
    :VERPATHREPORT
    ECHO. %1
    IF /i [%1]==[] (
    set PATHRESULT=PATH_SUCCESS
    ) ELSE (
    set PATHRESULT=PATH_FAILURE
    ECHO. %PATHRESULT%
    GOTO REGVERIFY
    :REGVERIFY
    ECHO.------------
    FOR /f "tokens=*" %%d IN ('reg query "hklm\software\microsoft\windows nt\currentversion\profilelist"^|find /i "s-1-5-21"') DO CALL :REGCHECKVERIFY "%%d"
    GOTO REGVERIFYECHO
    ::Same thing as the registry clean - copy/paste excluded profiles below.
    :REGCHECKVERIFY
    FOR /f "tokens=3" %%e in ('reg query %1 /v ProfileImagePath') DO SET USERREGV=%%e
    IF /i [%USERREGV%]==[c:\Users\Administrator] GOTO :EOF
    GOTO REGVERIFYECHO
    :REGVERIFYECHO
    ECHO. %1
    IF /i [%1]==[] (
    set REGRESULT=REG_SUCCESS
    ) ELSE (
    set REGRESULT=REG_FAILURE
    ECHO. %REGRESULT%
    GOTO REPORTCHECK
    ::The following is where you would enter the mapped drive path.
    ::You can use a straight UNC if you like, but I find this to be a bit
    ::more solid and it allows you to use different creds in case you
    ::automate it for a local scheduled task to run as local admin.
    :REPORTCHECK
    'net use t: \\server\path
    'IF EXIST "t:\labreport.txt" (
    'GOTO REPORTGEN
    ') ELSE (
    'GOTO EXIT
    ::This is a time/date stamp creator that I actually pulled from a Minecraft
    ::to Dropbox backup script I made a long while back.
    ':REPORTGEN
    'FOR /F "tokens=1 delims=:" %%f in ('time /T') DO SET T=%%f
    'FOR /F "tokens=*" %%g in ('echo %date:~10,4%-%date:~4,2%-%date:~7,2% %T%-%time:~3,2%-%time:~6,2%') DO SET TDATETIME=%%g
    ECHO. %PATHRESULT% %REGRESULT% %COMPUTERNAME% %TDATETIME% >> "t:\labreport.txt"
    net use t: /delete
    GOTO EXIT
    :EXIT
    exit
    :EOF

  • How to pass a col of pl/sql tab to a parametrized cursor?

    Hi,
    I'm getting this error constantly:
    Error on line 1
    declare
    j number :=1;
    cursor f
    ORA-06550: line 9, column 20:
    PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:
    constant exception <an identifier>
    <a double-quoted delimited-identifier> table LONG_ double ref
    char time timestamp interval date binary national character
    nchar
    Code Snippet:
    declare
    j number :=1;
    cursor firstquery (c_item in varchar2) is
    SELECT SEARCH, NAME, ID FROM tablename
    WHERE name LIKE c_item;
    first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;
    first_rec_tbl first_rec_tbl_type;
    type act_str_tbl_type is table of varchar2(50) index by binary_integer;
    act_put_str_tbl act_str_tbl_type;
    begin
    this is executing fine as i have executed it as a standalone script also
    act_put_str_tbl table has values here.passing these to below:
    ----------------------------------- i guess the problem lies here------------------------
         begin
              dbms_output.put_line('reached second begin');
    For i in act_put_str_tbl.first..act_put_str_tbl.last
         loop
         dbms_output.put_line('inside loop of second begin');
         open firstquery(act_put_str_tbl(i));
              loop
              fetch firstquery into first_rec_tbl(j);
              j:=j+1;
              exit when firstquery%notfound or firstquery is null;
              end loop;
         close firstquery;
         end loop;
    How to use parametrized cursor with PL/SQL table, any help is appreciated in the above snippet.
    Thanks

    Satyaki_De wrote:
    first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;Create this type in side any package like ->
    create or replace package patch_array
    is
    first_rec_tbl_type is table of firstquery%rowtype index by pls_integer;
    end;But, you have to use explicit record type instead of firstquery%rowtype here.
    And, then refer this type inside your parametrized cursor to use that properly, that might solve your current problem - i guess.
    So, you cursor should look something like this ->
    cursor firstquery (c_item in patch_array.first_rec_tbl_type)
    is
    SELECT SEARCH, NAME, ID
    FROM tablename
    WHERE name LIKE c_item; N.B.:Not Tested...
    Regards.
    Satyaki De.
    Edited by: Satyaki_De on Dec 28, 2008 1:32 AM??? No package is needed:
    SQL> declare
      2      j number := 1;
      3      cursor firstquery(
      4                        c_item in varchar2
      5                       )
      6        is
      7          SELECT  ename,
      8                  sal
      9            FROM  emp
    10            WHERE ename LIKE c_item;
    11      type first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;
    12      first_rec_tbl first_rec_tbl_type;
    13      type act_str_tbl_type is table of varchar2(50) index by binary_integer;
    14      act_put_str_tbl act_str_tbl_type;
    15  begin
    16      act_put_str_tbl(1) := 'S%';
    17      act_put_str_tbl(2) := '%L%';
    18      act_put_str_tbl(3) := 'KING';
    19      begin
    20          dbms_output.put_line('reached second begin');
    21          For i in 1..nvl(act_put_str_tbl.count,0) loop
    22            dbms_output.put_line('inside loop of second begin');
    23            dbms_output.put_line('act_put_str_tbl(' || i || ') = ' || act_put_str_tbl(i));
    24            open firstquery(act_put_str_tbl(i));
    25            loop
    26              fetch firstquery into first_rec_tbl(j);
    27              exit when firstquery%notfound;
    28              dbms_output.put_line('first_rec_tbl(' || j || ').ename = ' || first_rec_tbl(j).enam
    e);
    29              dbms_output.put_line('first_rec_tbl(' || j || ').sal = ' || first_rec_tbl(j).sal);
    30              j:=j+1;
    31            end loop;
    32            close firstquery;
    33          end loop;
    34      end;
    35  end;
    36  /
    reached second begin
    inside loop of second begin
    act_put_str_tbl(1) = S%
    first_rec_tbl(1).ename = SMITH
    first_rec_tbl(1).sal = 800
    first_rec_tbl(2).ename = SCOTT
    first_rec_tbl(2).sal = 3000
    inside loop of second begin
    act_put_str_tbl(2) = %L%
    first_rec_tbl(3).ename = ALLEN
    first_rec_tbl(3).sal = 1600
    first_rec_tbl(4).ename = BLAKE
    first_rec_tbl(4).sal = 2850
    first_rec_tbl(5).ename = CLARK
    first_rec_tbl(5).sal = 2450
    first_rec_tbl(6).ename = MILLER
    first_rec_tbl(6).sal = 1300
    inside loop of second begin
    act_put_str_tbl(3) = KING
    first_rec_tbl(7).ename = KING
    first_rec_tbl(7).sal = 5000
    PL/SQL procedure successfully completed.
    SQL> To OP. It is better to use BULK COLLECT:
    SQL> declare
      2      cursor firstquery(
      3                        c_item in varchar2
      4                       )
      5        is
      6          SELECT  ename,
      7                  sal
      8            FROM  emp
      9            WHERE ename LIKE c_item;
    10      type first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;
    11      first_rec_tbl first_rec_tbl_type;
    12      type act_str_tbl_type is table of varchar2(50) index by binary_integer;
    13      act_put_str_tbl act_str_tbl_type;
    14  begin
    15      act_put_str_tbl(1) := 'S%';
    16      act_put_str_tbl(2) := '%L%';
    17      act_put_str_tbl(3) := 'KING';
    18      begin
    19          dbms_output.put_line('reached second begin');
    20          For i in 1..nvl(act_put_str_tbl.count,0) loop
    21            dbms_output.put_line('inside loop of second begin');
    22            dbms_output.put_line('act_put_str_tbl(' || i || ') = ' || act_put_str_tbl(i));
    23            open firstquery(act_put_str_tbl(i));
    24            fetch firstquery bulk collect into first_rec_tbl;
    25            for j in 1..nvl(first_rec_tbl.count,0) loop
    26              dbms_output.put_line('first_rec_tbl(' || j || ').ename = ' || first_rec_tbl(j).enam
    e);
    27              dbms_output.put_line('first_rec_tbl(' || j || ').sal = ' || first_rec_tbl(j).sal);
    28            end loop;
    29            close firstquery;
    30          end loop;
    31      end;
    32  end;
    33  /
    reached second begin
    inside loop of second begin
    act_put_str_tbl(1) = S%
    first_rec_tbl(1).ename = SMITH
    first_rec_tbl(1).sal = 800
    first_rec_tbl(2).ename = SCOTT
    first_rec_tbl(2).sal = 3000
    inside loop of second begin
    act_put_str_tbl(2) = %L%
    first_rec_tbl(1).ename = ALLEN
    first_rec_tbl(1).sal = 1600
    first_rec_tbl(2).ename = BLAKE
    first_rec_tbl(2).sal = 2850
    first_rec_tbl(3).ename = CLARK
    first_rec_tbl(3).sal = 2450
    first_rec_tbl(4).ename = MILLER
    first_rec_tbl(4).sal = 1300
    inside loop of second begin
    act_put_str_tbl(3) = KING
    first_rec_tbl(1).ename = KING
    first_rec_tbl(1).sal = 5000
    PL/SQL procedure successfully completed.
    SQL> SY.
    Edited by: Solomon Yakobson on Dec 27, 2008 12:32 PM

  • Cursor Question

    Hi
    I have a multi-tab form and in the first tab block (B1) one of the field's values is used to populate an NBT field in another multi-record tab block (B2). When tab B2 fields are filled in, the last value is populated automatically with the value from B1. I had thought that if the value in B1 is subsequently changed then I would like the form, in B2, to update the field(s) (if any) with the new value input in B1.
    DB relation is B1 parent, B2 child.
    I thought the best option would be to use a cursor to loop through the records in B2 when:
    B1 field's system record status is 'CHANGED'
    And PK(s) in B2 are present i.e. records are present and need updated.
    So i've not really get much experience using cursors so thought this would be ideal opportunity to learn it. I created the following cursor:
    IF :system.record_status = 'CHANGED' AND :B2.ID IS NOT NULL THEN
    DECLARE
         v_mod_id NUMBER := :B2.FK; --variable used for join condition in cursor
         v_cvs_val VARCHAR2(100) := :B1.UpdatedValue; Passes updated B1 value into variable so it can be used to update B2
         CURSOR c_cvs IS
    SELECT B2_PK, B2_current_val --Current value to be updated
         FROM B2 table
         WHERE B2_FK = v_mod_id;
         B2_Table_rec c_cvs%ROWTYPE; --declares record of cursor type
    BEGIN
         OPEN c_cvs;
         LOOP
              FETCH c_cvs INTO B2_Table_rec;
              EXIT WHEN c_cvs%NOTFOUND;
              :B2.field_requiring_B1updatedValue := v_cvs_val; Passes updated value into --each field in the block B2
         END LOOP;
         CLOSE c_cvs;
    END;
    END IF;
    What I am a bit confused about is what trigger to use this in. I have used it in when validate item in B1, so when I update value the cursor should go through the records in B2 to update them, and it does, but only does it once, and only does it to the record in B2 that I left focus in; so if I was on row 2 in B2 and went and changed value in B1 it would only update row 2 in B2.
    I would appreciate if anyone can offer any advice as to where i'm going wrong, either in the cursor statement itself or in what trigger I should put it.
    thanks
    Andrew

    http://asktom.oracle.com/pls/ask/f?p=4950:8:3983328209686210967::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:5241391331097
    Rgds.

Maybe you are looking for

  • SSRS 2008 Chart legend colours not matching series colour.

    Hi, I believe this issue has been raised before. In SSRS 2005 & 2008 R2 though I am yet to find a solution other than a lengthy (messy) workaround. I have a chart based on the following data: Data field - Count(ChangeID) Category - Change_Categorisat

  • SSO in resource adapter : Subject=NULL

    Error while trying to use SingleSignOn in resource adapter deployed in WebLogic server 8.1 Hi, To support SSO in Resource Adaptor all steps were produced as described in WebLogic site: http://e-docs.bea.com/wls/docs81/secmanage/credential_maps.html#1

  • Whatz Default UserID and Passwd for ODM and SSO

    Hi, I have installed oracle9i on win2k.After the installation,i tried to use the Oracle Directory Manager. I use the Default Userid "cn=orcladmin" and the Default passwd "welcome" to connect to OID server through oracle directory manager. It gives me

  • Error ERR-1014 Application not found

    Hi. I've installed Oracle 10g FedoraCore 3 pc. server and client working fine and i installed Oracle 10g Companion Product CD with Apache and HTML db with no errors . when i type http://localhost:7777 in mozilla OracleHTTP server pages are coming. Bu

  • Hänger bei Optionsauswahl Premiere CS6

    wenn ich mit der rechten Maustaste Optionen auswähle -.egal ob Audioverstärkung - Audiokanäle - Ausschneiden - Löschen usw. bekomme ich die Option gar nicht angezeigt Mit ESC-Taste kann ich dann zwar das Menü aktivieren, aber nicht bearbeiten. Starte