Need to be tuned the script

Hello
Any suggestions in tuning following script.
SET LINESIZE 178
SPOOL &1
PROMPT @@ &2
PROMPT @@ &3
PROMPT @@ &4
SELECT
LPAD(a.lief_nr, 5,' ')
|| LPAD(a.iln_nr,13,' ')
|| a.lief_art
|| a.art_list_kz
|| a.art_ean_kz
|| a.distri_radius
|| a.import_sl
|| a.werb_verre_kz
|| a.loesch_kz
|| a.sperr_kz
|| a.edi_kz
|| LPAD(NVL(TO_CHAR(a.lief_dsd_nr), ' '),7,' ')
|| LPAD(NVL(a.ums_st_id,'@'),14,' ')
|| LPAD(NVL(TO_CHAR(a.vertrag_dat,'DDMMYYYY'),' '),8,' ')
|| LPAD(NVL(TO_CHAR(b.lml_lief_nr),' '),5,' ')
|| LPAD(NVL(TO_CHAR(c.w11_adr_sl),' '),9,' ')
|| SUBSTR(DECODE(c.match_name, NULL, LPAD(' ', 40, ' '), LPAD(c.match_name,40,' ')||LPAD(c.match_name,40,' ')), 1, 40)
|| SUBSTR(DECODE(c.match_ort, NULL, LPAD(' ', 15, ' '), LPAD(c.match_ort,15,' ')||LPAD(c.match_ort,15,' ')), 1, 15)
|| c.neu_list_kz
|| LPAD(d.lts_nr, 2,' ')
|| SUBSTR(DECODE(d.lts_bez, NULL, LPAD(' ', 33, ' '), LPAD(d.lts_bez,33,' ')||LPAD(d.lts_bez,33,' ')), 1, 33)
|| LPAD(d.urb_eksg,3,' ')
|| ' '
|| LPAD(NVL(TO_CHAR(e.zahl_ziel),' '),3,' ')
|| LPAD(NVL(TO_CHAR(e.sdr_zahl_tage),' '),3,' ')
FROM LI_ALLG a,
( SELECT lief_nr, lml_lief_nr, gueltig_bis
FROM LI_KONZERN_LIEF
WHERE (lief_nr, gueltig_bis) IN
(SELECT lief_nr, MAX(gueltig_bis) gueltig_bis
FROM LI_KONZERN_LIEF
GROUP BY lief_nr)
AND to_char(sysdate, 'YYYY') - to_char(gueltig_bis, 'YYYY') < 3
AND gueltig_ab <= sysdate
) b,
LI_LIEFERANT c,
LI_LTS_ALLG d,
( SELECT lief_nr, lts_nr, zahl_ziel, sdr_zahl_tage
FROM LI_LTS_ZAHLUNG
WHERE (lief_nr, lts_nr, gueltig_ab) IN
( SELECT lief_nr, lts_nr, max(gueltig_ab)
FROM LI_LTS_ZAHLUNG
GROUP BY lief_nr, lts_nr
AND to_char(sysdate, 'YYYY') - to_char(gueltig_bis, 'YYYY') < 3
AND gueltig_ab <= sysdate
) e
WHERE
c.lief_nr=a.lief_nr
AND (a.lief_nr, a.gueltig_bis) IN
(SELECT lief_nr, max(gueltig_bis)
from LI_ALLG
where to_char(sysdate, 'YYYY') - to_char(gueltig_bis, 'YYYY') < 3
and gueltig_ab <= sysdate
group by lief_nr
AND c.lief_nr=b.lief_nr(+)
AND c.lief_nr=d.lief_nr
AND (d.lief_nr, d.gueltig_bis) IN
(SELECT lief_nr, max(gueltig_bis)
from LI_LTS_ALLG
where to_char(sysdate, 'YYYY') - to_char(gueltig_bis, 'YYYY') < 3
and gueltig_ab <= sysdate
group by lief_nr
AND a.lief_nr = e.lief_nr(+)
AND e.lts_nr = d.lts_nr
PROMPT @@@ THE END

Can you post the execution plan for this query?
Also,
Oracle Version
Number of records in tables/returned by sub-queries
Edit: There are condition checks which go as
TO_CHAR (SYSDATE, 'YYYY') - TO_CHAR (gueltig_bis, 'YYYY') < 3
These could be rewritten as following, if there were any indexes defined on Gueltig_bis column
gueltig_bis between to_char (sysdate, 'YYYY')-2 and to_char (SYSDATE, 'yyyy')

Similar Messages

  • Need help in writing the script in windows to read the file at runtime

    Hi All,
    I need a help with a Script. I need to read a filename from a directorty based on a specific format. I will be looking for the file in a directory that will have a file added to it each month. The script will need to go out to that directory determine the current month and Year and then grab that file based on the MONTHYEAR contained itn the file name and
    in the same script pass the filename to SQL Loader.
    The filename will consist of three parts VARIABLECONSTANTDATE.ext (example: FUELFILE11262007.txt: FUEL is a VARIABLE, FILE is constant, 11 two digit month, 26 two digit day,2007 four digit year.)
    I am stuck as how to how to read that into a string, find the file name and then pass that to sql loader.
    Any help much appreciated..
    Looking forward for your response.

    Use of External Tables will ease your problem...
    Here's what you can do:
    1. Create External tables (fuelfile.asc)
    2. Use Java code to read all filenames in a particular directory and store them in table
    3. Use PL/SQL block to loop through each filename in the table and write the file to the file of external table (fuelfile.asc)
    3.1 Transfer data from External table to main table
    Aalap Sharma :)

  • Hello need vertical  lines in the script

    Dear ABAP GURUS,
         I need to draw verticle lines in the script as a tabel, i have drawn the horizontal lines. I heard that there is the the function module to draw the verticle lines but how is that possible to use in the script. Plwase help me out in drawing the vericle lines, i Have tried using the vline but no use.

    Hi Soni,
      Its very easy to draw the vertical lines in a script.  Use BOX statement to draw the same.  Check out the syntax for BOX statement.  Give the 'Y' coordinate only and do not mention 'X' coordinate.  So that the box will appear as a vertical line.  Check it.
    Boxes, Lines, Shading: BOX, POSITION, SIZE
    The BOX, POSITION and SIZE commands for drawing boxes, lines and shadowing can be used for specifying that within a layout set particular windows or passages of text within a window are to be output in a frame or with shadowing.
    The SAP printer drivers that are based on page-oriented printers (the HP LaserJet driver HPL2, the Postscript driver POST, the Kyocera Prescribe driver PRES) employ these commands when outputting. Line printers and page-oriented printers not supported in the standard ignore these commands. The resulting printer output may be viewed in the SAPscript print previewer.
    Syntax:
    1. /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    2. /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    3. /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    BOX Command
    Syntax
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    Effect: draws a box of the specified size at the specified position.
    Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT and FRAME both a measurement and a unit of measurement must be specified. The INTENSITY parameter should be specified as a percentage between 0 and 100.
    1. XPOS, YPOS: Upper left corner of the box, relative to the values of the POSITION command.
    Default: Values specified in the POSITION command.
    The following calculation is performed internally to determine the absolute output position of a box on the page:
    X(abs) = XORIGIN + XPOS
    Y(abs) = YORIGIN + YPOS
    2. WIDTH: Width of the box. Default: WIDTH value of the SIZE command.
    3. HEIGHT: Height of the box. Default: HEIGHT value of the SIZE command.
    4. FRAME: Thickness of frame.
    Default: 0 (no frame).
    5. INTENSITY: Grayscale of box contents as % .
    Default: 100 (full black)
    Measurements: Decimal numbers must be specified as literal values (like ABAP numeric constants) by being enclosed in inverted commas. The period should be used as the decimal point character. See also the examples listed below.
    Units of measurement: The following units of measurement may be used:
    • TW (twip)
    • PT (point)
    • IN (inch)
    • MM (millimeter)
    • CM (centimeter)
    • LN (line)
    • CH (character).
    The following conversion factors apply:
    • 1 TW = 1/20 PT
    • 1 PT = 1/72 IN
    • 1 IN = 2.54 CM
    • 1 CM = 10 MM
    • 1 CH = height of a character relative to the CPI specification in the layout set header
    • 1 LN = height of a line relative to the LPI specification in the layout set header
    /: BOX FRAME 10 TW
    Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
    /: BOX INTENSITY 10
    Fills the window background with shadowing having a gray scale of 10 %.
    /: BOX HEIGHT 0 TW FRAME 10 TW
    Draws a horizontal line across the complete top edge of the window.
    /: BOX WIDTH 0 TW FRAME 10 TW
    Draws a vertical line along the complete height of the left hand edge of the window.
    /: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
    /: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
    POSITION Command
    Syntax
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    Effect: Sets the origin for the coordinate system used by the XPOS and YPOS parameters of the BOX command. When a window is first started the POSITION value is set to refer to the upper left corner of the window (default setting).
    Parameters: If a parameter value does not have a leading sign, then its value is interpreted as an absolute value, in other words as a value which specifies an offset from the upper left corner of the output page. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value. If one of the parameter specifications is missing, then no change is made to this parameter.
    1. XORIGIN, YORIGIN: Origin of the coordinate system.
    2. WINDOW: Sets the values for the left and upper edges to be the same of those of the current window (default setting).
    3. PAGE: Sets the values for the left and upper edges to be the same of those of the current output page (XORIGIN = 0 cm, YORIGIN = 0 cm).
    /: POSITION WINDOW
    Sets the origin for the coordinate system to the upper left corner of the window.
    /: POSITION XORIGIN 2 CM YORIGIN '2.5 CM'
    Sets the origin for the coordinate system to a point 2 cm from the left edge and 2.5 cm from the upper edge of the output page.
    /: POSITION XORIGIN '-1.5' CM YORIGIN -1 CM
    Shifts the origin for the coordinates 1.5 cm to the left and 1 cm up.
    SIZE Command
    Syntax
    /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    Effect: Sets the values of the WIDTH and HEIGHT parameters used in the BOX command. When a window is first started the SIZE value is set to the same values as the window itself (default setting).
    Parameters: If one of the parameter specifications is missing, then no change is made to the current value of this parameter. If a parameter value does not have a leading sign, then its value is interpreted as an absolute value. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value.
    1. WIDTH, HEIGHT: Dimensions of the rectangle or line.
    2. WINDOW: Sets the values for the width and height to the values of the current window (default setting).
    3. PAGE: Sets the values for the width and height to the values of the current output page.
    /: SIZE WINDOW
    Sets WIDTH and HEIGHT to the current window dimensions.
    /: SIZE WIDTH '3.5' CM HEIGHT '7.6' CM
    Sets WIDTH to 3.5 cm and HEIGHT to 7.6 cm.
    /: POSITION WINDOW
    /: POSITION XORIGIN -20 TW YORIGIN -20 TW
    /: SIZE WIDTH +40 TW HEIGHT +40 TW
    /: BOX FRAME 10 TW
    A frame is added to the current window. The edges of the frame extend beyond the edges of the window itself, so as to avoid obscuring the leading and trailing text characters.
    Thanks & regards
    Kishore Kumar Maram

  • Need another disk in the script

    Hello,
    I have a nice script that does some FTP for me. The only thing is that I don't know how tho change the directory where the files will be stored :
    set downloads_Folder to quoted form of (POSIX path of (((path to desktop from user domain) as string) & "IMAGESTODAY" & ":"))
    This works fine but only with a folder IMAGESTODAY on the desktop.
    I would like to have another DISK from the same computer where I can store the images. I tried alot of things to remove the desktop and to use my path to the disk :MAC2:IMAGES:TODAY. It will not work or make folders on the wrong locations.
    How can I change the downloads_Folder?
    Why will this not work ? :
    set downloads_Folder to "MAC2:IMAGES:TODAY"
    Thanks... Still learning... making progress step by step...

    That's ok for me keep up the good advice
    Thanks.

  • Needs help for tuning the sql

    Hi
    I have a query which will read one fact table and 4 dimension table.fact table contains millions of records
    Can u suggest me how can i tune my query which uses the fact table to get the best performance.

    Which version of the database are you using? Have you enabled Star Transformation? What does the explain plan look like? Is this intended for building a materilaized view or as the basis for running an ad hoc report?
    We created bit map indexes on the joining columns.bitmap indexes or bitmap-join indexes?
    Cheers, APC

  • How to write the script in E-tester

    Hi i am new to e-tester. we are doing some R&D on empirix e-tester tool. We are familiar with QTP tool. we are able to record and play the script but we are unable to enhance the script.
    But when i went through this threads i came to know that we can use VBA script or VB script or etc for enhancing the script. current we are using "oracle Functional Testing for web applications 8.50.0260" version.
    Can any body please guide me and explain the procedure for enhancing the script and what is the use of open script.
    Is it required for e-load or e-tester. pls specify me its very urgent
    thanks inadvance...........pls

    Hi Alex,
    Nice reply, I need one more clarification. when installing OFT 8.5 software do we require any other software or any other set or funda for that. I am able to add some vbscript in test scrplet but when execution comes to that point node its getting halted and result is getting failed.
    can i take any precautions or any hierarchy or guidelines i need maintaing before writing the script on the scriplet.
    please give me the procedure. sorry for repeatedly asking as it's very important i have been raising the same question from couple of days.
    code i have writte over there
    msgbox("anjani")
    dim a=10
    dim b=20
    dim c=a+b
    msgbox c
    pls pass your mail id we can discuss later also my id is [email protected] plssssssssss
    anjani

  • Where the Script is Stored

    HI,
    when we create table or view or something, a script is generated and stored in the database,
    i need to know where the script data is stored i.e in which table
    i know function, procedure script is stored in user_source(text column)
    can any one know about this?

    If your purpose is to see the DDL used to create the object, you can use DBMS_METADATA package. Example :
    SQL> create table foo(a number primary key, b varchar2(20));
    Table created.
    SQL> select dbms_metadata.get_ddl('TABLE','FOO') from dual;
    DBMS_METADATA.GET_DDL('TABLE','FOO')
      CREATE TABLE "TEST"."FOO"
       (    "A" NUMBER,
            "B" VARCHAR2(20),
             PRIMARY KEY ("A")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"  ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    SQL>

  • How to write the script to watch InDesign actions?

    Hi All,
    I'd like to write a script or a .Net tool to watch the InDesign actions and alert the user for any deviations like the option 'Live Preflight' in InDesign CS4? Pl. suggest.
    Thanks,
    Praveen

    Hi Alex,
    Nice reply, I need one more clarification. when installing OFT 8.5 software do we require any other software or any other set or funda for that. I am able to add some vbscript in test scrplet but when execution comes to that point node its getting halted and result is getting failed.
    can i take any precautions or any hierarchy or guidelines i need maintaing before writing the script on the scriplet.
    please give me the procedure. sorry for repeatedly asking as it's very important i have been raising the same question from couple of days.
    code i have writte over there
    msgbox("anjani")
    dim a=10
    dim b=20
    dim c=a+b
    msgbox c
    pls pass your mail id we can discuss later also my id is [email protected] plssssssssss
    anjani

  • Need help with a basic script to resize image then resize the canvas

    I am new to photoshop scripting, and have come across a need to force an image to be 8"x10" at 300dpi (whether it is vertical or horizontal)
    I need to maintain the correct orientation in the file, so an Action will not work, I believe I have to implement a script to accomplish this.
    I have the below script so far, but I am not certain of how to input the variables / paramters
    doc = app.activeDocument;
    if (doc.height > doc.width) doc.resizeImage("2400 pixels","3600 pixels", "300", "BICUBIC");
    if (doc.height > doc.width) doc.resizeCanvas("2400 pixels","3000 pixels", "MIDDLECENTER");
    if (doc.height < doc.width) doc.resizeImage("3600 pixels","2400 pixels",300,"BICUBIC");
    if (doc.height < doc.width) doc.resizeCanvas(3000,2400,"MIDDLECENTER");
    When I run this script, I get the following error:
    Error 1245: Illegal argument - argument 4
    - Enumerated value expected
    Line: 5
    if (doc.height < doc.width) doc.resizeImage("3600 pixels","2400 pixels",300,"BICUBIC");
    The fact that its failing on lien 5 lets nme know that I have the "If" portions of my script correct, I just dont know how to accomplish the functions correctly.
    Any help would be appreciated!
    Thanks,
    Brian

    I know I'm late here but it seems to me your trying to automate a 8"x10 or 10"x8 300DPI  print.
    To do that you must first crop your image to a 4:5 aspect ratio to prevent distortion unless your shooting with a 4" by 5" camera.   I wrote a Plugin script a couple years ago that could help you do a centered crop.  You could do the whole process by recording a simple Photoshop action that uses two  Plugin Scripts only four steps would be needed.
    Step 1 Menu File>Automate>AspectRatioSelection  (My script based of Adobe Fit Image Plugin script) Set 4:5 Aspect ratio, center,  Rectangle, Replace, no feather. Llike Fit Image this script woks on both Landscape and Portrait images. The Selection will be correct for the images orientation.
    Step 2 Menu Image>Crop
    Step 3 Menu File>Automate>Fit Image set 3000 PX height and 3000 PX width the Image will be Resample so its longest side will be 3000 pixels.  Adobe Fit Image Plugin Script always uses BICUBIC resampling.  I have a modified version of Fit Image  that uses Bicubic Sharper whebndownsizing and BicubicSmoother when up sizing.
    Step 4 Menu Image>Size un check resample set resolution to 300 DPI.
    When you play the actions the Script Dialogs will not be displayed and the setting use when you recorded the action will ne used.
    The Plugin Script are included in my crafting actions package:
    http://www.mouseprints.net/old/dpr/JJMacksCraftingActions.zip
    Contains:
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file. This file has some additional comments I inserted describing how the actions work.
    12 Scripts for actions
    My other free Photoshop downloads cam be found here: http://www.mouseprints.net/Photoshop.html

  • Task Scheduling Script - Need help with passing the scheduled command (variables are not being evaluated)

    Hi Everyone,
    I'm trying to get a simple task scheduler script to work for me and can't get the command I need passed to the scheduler to evaluate properly.
    Here's the script:
    ###Create a new task running $Command and execute it Daily at 6am.
    $TaskName = Read-Host 'What would you like this job to be named?'
    $Proto = Read-Host 'What is the protocol? (FTP/FTPS/SFTP)'
    $User = Read-Host 'What is the user name?'
    $Pwd = Read-Host 'What is the password?'
    $Server = Read-Host 'What is the server address?'
    $NetworkDir = Read-Host 'Please input the network location of the file(s) you wish to send. Refer to documentation for more details.'
    $RemoteDir = Read-Host 'Please input the REMOTE directory to which you will upload your files. If there is none please input a slash'
    $Command = 'winscp.com /command "option batch abort" "option confirm off" "open $Proto://$User:$Pwd@$Server" "put $NetworkDir $RemoteDir" "exit"'
    $TaskAction = New-ScheduledTaskAction -Execute "$Command"
    $TaskTrigger = New-ScheduledTaskTrigger -Daily -At 6am
    Register-ScheduledTask -Action $TaskAction -Trigger $Tasktrigger -TaskName "$TaskName" -User "Administrator" -RunLevel Highest
    Write-Host "$TaskName created to run Daily at $TaskStartTime"
    What's messing up is the $Command creation, the command needs to have the quotes around "option blah blah", but if I wrap the whole line in single quotes the variables that are evaluated for the "open blah blah" strings (which also need
    to be inside quotes) and the "put blah blah" string are not being evaluated properly.
    I've dorked about with different bracketing and quoting but can't nail the syntax down, could someone point me in the right direction? My Google-fu seems to be lacking when it comes to nailing down this issue.
    Thanks

    Hmmn, closer. I'm getting this error now:
    + $Command = $tmpl -f  $User, $Pwd, $Server, $NetworkDir, $RemoteDir
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (winscp.com /com...t {4} {5}" exit:String) [], RuntimeException
        + FullyQualifiedErrorId : FormatError
    And the command being added to the new task looks like this:
    winscp.com /command "option batch abort" "option confirm off" "open ($Proto)://($User):($Pwd)@($Server)" "put $NetworkDir $RemoteDir" "exit"
    Here's the current state of the script. I get what you're doing to try to bypass the quotes issue, using an array. I'm just not awesome at this yet sooooooo...
    $TaskName = Read-Host 'What would you like this job to be named?'
    $Proto = Read-Host 'What is the protocol? (FTP/FTPS/SFTP)'
    $User = Read-Host 'What is the user name?'
    $Pwd = Read-Host 'What is the password?'
    $Server = Read-Host 'What is the server address?'
    $NetworkDir = Read-Host 'Please input the network location of the file(s) you wish to send. Refer to documentation for more details.'
    $RemoteDir = Read-Host 'Please input the REMOTE directory to which you will upload your files. If there is none please input a slash'
    $tmpl = 'winscp.com /command "option batch abort" "option confirm off" "open {0}://{1}:{2}@{3}" "put {4} {5}" exit'
    $Command = $tmpl -f $User, $Pwd, $Server, $NetworkDir, $RemoteDir
    $TaskAction = New-ScheduledTaskAction -Execute $Command
    $TaskTrigger = New-ScheduledTaskTrigger -Daily -At 6am
    Register-ScheduledTask -Action $TaskAction -Trigger $Tasktrigger -TaskName "$TaskName" -User "Administrator" -RunLevel Highest
    Write-Host "$TaskName created to run Daily at $TaskStartTime"

  • Why MicroSoft 2000 SR needed while running the script using test manager???

    hi all,
    whenever I trying to run a script using test manager,one POP-UP comes which starts installing MICROSOFT 2000 SR.
    and in few seconds it complaining for some missing component,
    can any body tell me why it is happening.
    what is the need of Microsoft 2000 SR while running the script in test manager.
    tnx
    USOni

    USoni
    I have seen that problem happening before, even that i was never able to figure out why, something that you can try is changing the service log in credentials for both:
    Oracle Application Testing Suite Agent Service
    Oracle Application Testing Suite Application Service
    and use a proper user with admin rights.
    let me know if that helped
    Regards
    Alex

  • About the script need to display

    hi team,
                    i  am working on the script of hr_ben_conf.... i need to display the data from the structure rpben_da. in these structure i need to take the field to display the EE costs(employee only)...
    we have different field :
             Bplan    pltyp     depcv  from the structure of the rpben_da.
             DENT    dent        EE
             visi        visi         ee
              medi    medi     ee
    i need to display the data of ee employee only ...... who to write this thing in the script level only........

    hi
    if u go throu debugging mode to the print program for the correponding script u will find this stucture will flow with values
    pass the same to the script.
    say for example.
    RLVSDR40 is the standard print prog for this example
    RLDRI is a struc where in we get TANUM ( transfer order no)
    but when u go in debgg mode u will get the struc as XRLDRI in RLVSDR40.
    so pass from the zprogram XRLDRI-TANUM to script.
    u can able to print the values u require .
    same logic try in urs.
    try it it is possible.
    Hope this might help u.
    Thanks and regards,
    Venkat.

  • Need help th tuning query or re write the query--

    Hi,
    Need help to tune the below query or rewrite th query for reducing the execution time Please find the query and explain plan.
    QUERY
    explain plan FOR SELECT consumer_key,product_key,days_in_product,20100201 period_key FROM
    (SELECT consumer_key,
      product_key,
      days_in_product,
      row_number() over ( Partition BY consumer_key order by Days_in_product DESC) row_num
    FROM
      (SELECT consumer_key,
        product_key,
        SUM(no_ofdays) days_in_product
      FROM
        (SELECT pcv.consumer_key,
          pcv.product_key,
          pcv.product_consumer_valid_from,
          pcv.product_consumer_valid_to,
          DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from) period_start,
          DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959) period_end,
          CASE
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) BETWEEN 20100201000000 AND 20100228235959
            AND activation_date > to_Date(product_consumer_valid_to,'YYYYMMDDHH24MISS')
            THEN 0
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) BETWEEN 20100201000000 AND 20100228235959
            AND activation_date BETWEEN to_Date(product_consumer_valid_from,'YYYYMMDDHH24MISS') AND to_Date(product_consumer_valid_to,'YYYYMMDDHH24MISS')
            THEN
              --to_char(activation_date,'MON-YYYY')='PERIOD_ACTIVE'  and activation_date >= to_Date(product_consumer_valid_from,'YYYYMMDDHH24MISS') then
              (to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_date(TO_CHAR(activation_date,'YYYYMMDDHH24MISS'),'YYYYMMDDHH24MISS') )
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) < 20100201000000
            THEN (to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_Date(DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from),'YYYYMMDDHH24MISS') )
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) > 20100228235959
            THEN 0
            ELSE
              --unusual situation
              (to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_Date(DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from),'YYYYMMDDHH24MISS') )
          END No_ofDays
        FROM cimtran.product_consumer_validity pcv,
          consumer_dimension cd
        WHERE pcv.consumer_key           =cd.consumer_key
        AND product_consumer_valid_to   >= 20100201000000
        AND product_consumer_valid_from <= 20100228235959
          --and product_consumer_valid_from > '20090801000000'
        ORDER BY consumer_key,
          product_key,
          product_consumer_valid_from
        ) a
      GROUP BY consumer_key,
        product_key
      ORDER BY consumer_key,
        product_key
    ) WHERE row_num=1 ;EXPLAIN PLAN
    "PLAN_TABLE_OUTPUT"
    "Plan hash value: 3823907703"
    "| Id  | Operation                | Name                      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |"
    "|   0 | SELECT STATEMENT         |                           |  4665K|   231M|       |   133K  (1)| 00:31:08 |"
    "|*  1 |  VIEW                    |                           |  4665K|   231M|       |   133K  (1)| 00:31:08 |"
    "|*  2 |   WINDOW SORT PUSHED RANK|                           |  4665K|   173M|   232M|   133K  (1)| 00:31:08 |"
    "|   3 |    VIEW                  |                           |  4665K|   173M|       |   104K  (1)| 00:24:18 |"
    "|   4 |     SORT GROUP BY        |                           |  4665K|   182M|   729M|   104K  (1)| 00:24:18 |"
    "|*  5 |      HASH JOIN           |                           |    13M|   533M|    65M| 44241   (1)| 00:10:20 |"
    "|   6 |       TABLE ACCESS FULL  | CONSUMER_DIMENSION        |  2657K|    35M|       |  4337   (1)| 00:01:01 |"
    "|*  7 |       TABLE ACCESS FULL  | PRODUCT_CONSUMER_VALIDITY |    13M|   351M|       | 15340   (2)| 00:03:35 |"
    "Predicate Information (identified by operation id):"
    "   1 - filter(""ROW_NUM""=1)"
    "   2 - filter(ROW_NUMBER() OVER ( PARTITION BY ""CONSUMER_KEY"" ORDER BY "
    "              INTERNAL_FUNCTION(""DAYS_IN_PRODUCT"") DESC )<=1)"
    "   5 - access(""PCV"".""CONSUMER_KEY""=""CD"".""CONSUMER_KEY"")"
    "   7 - filter(""PRODUCT_CONSUMER_VALID_FROM""<=20100228235959 AND "
    "              ""PRODUCT_CONSUMER_VALID_TO"">=20100201000000)"

    I doubt that this query can be tuned without using indexes. There is a lot of unnecessary work specified in your query, like unnecessary intermediate sorting and selecting unused columns. The cost based optimizer recognized it and skips some of that unnecessary work, it seems. For clarity's sake, I would rewrite your query like below. Note that the query is untested:
    select consumer_key
         , max(product_key) keep (dense_rank last order by days_in_product) product_key
         , max(days_in_product) days_in_product
         , 20100201 period_key
      from ( select pcv.consumer_key
                  , pcv.product_key
                  , sum
                    ( case
                      when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) between 20100201000000 and 20100228235959
                      then
                        case
                        when cd.activation_date > to_date(pcv.product_consumer_valid_to,'yyyymmddhh24miss')
                        then
                          0
                        when cd.activation_date between to_date(pcv.product_consumer_valid_from,'yyyymmddhh24miss') and to_date(product_consumer_valid_to,'yyyymmddhh24miss')
                        then
                          to_date(to_char(pcv.product_consumer_valid_to),'yyyymmddhh24miss'))
                          - to_date(to_char(activation_date,'yyyymmddhh24miss'),'yyyymmddhh24miss')
                        end
                      when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) < 20100201000000
                      then
                        to_date(to_char(pcv.product_consumer_valid_to),'yyyymmddhh24miss'))
                        - to_date(to_char(pcv.product_consumer_valid_from),'yyyymmddhh24miss'))
                      when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) > 20100228235959
                      then
                        0
                      end
                    ) days_in_product
               from cimtran.product_consumer_validity pcv
                  , consumer_dimension cd
              where pcv.consumer_key             = cd.consumer_key
                and product_consumer_valid_to   >= 20100201000000
                and product_consumer_valid_from <= 20100228235959
              group by consumer_key
                  , product_key
    group by consumer_keyRegards,
    Rob.

  • Ruined my contacts with Apple Script, need someone to help me modify the script to undo what I did!

    Hi all, so all my contacts started with "+1". The goal was to erase the "+" and just have all of them start with "1". However, I messed up royally. I ran the following script, which made all my contacts start with "1+1". :
    tell application "Contacts"
              repeat with eachPerson in people
                        repeat with eachNumber in phones of eachPerson
                                  set theNum to (get value of eachNumber)
                                  if (theNum starts with "1+") then
                                            set value of eachNumber to "1" & theNum
                                  end if
                        end repeat
              end repeat
    save
    end tell
    This is messed up in 2 ways. Firstly, I meant to write "+1" in the script, but instead I wrote "1+". Secondly, even if I had written "1+", it still wouldn't make sense, because I'd effectively be telling the program to just add "1" in front of what's already there, including the "+1".
    Could someone please tell me how to modify this script to say:
    If the contact starts with "1+1", then erase the "1+1". Then I would need another script to take all my numbers and add "1" in front of them.

    What you want to do is simply delete the first few characters from the phone number, yes?
    How about something like this:
                             repeat with eachNumber in phones of eachPerson
                                            set theNum to (get value of eachNumber) as string
                                            if (theNum starts with "1+1") then
                     set myFixedNum to (characters 3 thru -1) of theNum
                                            else if (theNum starts with "+1") then
                                                           set myFixedNum to (characters 2 thru -1) of theNum
                                            end if
                                            set value of eachNumber to (myFixedNum as string)
                              end repeat
    That will take you from 1+1 or +1 to 1 in one easy step.

  • How do I enable the scripts? I downloaded the new version of Firefox and now I need to manually allow scripts?

    I downloaded the new version of Firefox on my XP system. Now to get the scripts working I need to click to allow??

    Your list of add-ons includes '''''NoScript'''''. See their website for a description, use, and a link to their forum.
    *see - http://noscript.net/
    Also see the following Firefox options page; the section regarding "Enable JavaScript".
    *https://support.mozilla.org/en-US/kb/settings-fonts-languages-pop-ups-javascript

Maybe you are looking for

  • Info Structure S031 - Information on movement type categories

    How can I find out the movement type categories for the S031 info structure? For instance what movement types add to the "Goods receipt" total or the "Goods issue" total.   Also, how do you "switch off the updating process for specific, individual mo

  • How to Debug a BackGround Job

    Hi all,          Can any one tell me how to Debugg a BackGround job in 4.7 version. I used something like JDBG in SM37 but its not working. Is there any process for this....

  • Apple TV, HD TV and Bose 18 System

    I recently upgraded to the 2nd gen. Apple TV and have connected the HDMI cable from the Apple TV to the HDMI plug on the HDTV. The picture and sound are fine between the TV and AppleTV with this connection. Whats the problem then? Well, I want the so

  • How to create an instance of a class which is actually an array?

    the following code gives a runtime exception Object obj = (Object )attributeClass.newInstance(); Exception: java.lang.InstantiationException: [Ltest.Name;[/b] Here test.Name is user defined class and i want to create an array instance of that class.

  • Creative Audio Control Panel

    I have just installed Windows 7. With an update to my bios, and newest drivers from both Micorosft and my motherboards website. I installed the newest drivers from Creative for my Sound Blaster X-Fi Xtreme Audio, and installed the Audio Conrol Panel.