Help required understanding steps of Transfer Workflow:WS01000014

Hi All,
Please help me understand the steps of this workflow..i have already gone thru some explaination about this workflow from this [link|http://www.sapfans.com/forums/viewtopic.php?f=11&t=292192&start=0&st=0&sk=t&sd=a] but getting confused with few steps.
Correct me if i am wrong ..the workflow is triggered when a  new position is created?(to which employee is going to be transffered?)
In step1:check target postion..of who? and then what happens?
step on user and role is confusing too
there are two specify postion in two departments..what are the two postions for ? 1 fro employee and one for his new manager/hr admin?
pls advice
thanks in advance

Hello,
The workflow is triggered when an instance of object ORGCHEARM
issues the event CREATED - ie there has been an organizational change.
Step 1 is condition "Check Target Position" :
( Designation.Root <> 'P'     and
  Designation.Object Type <> ''     and
  Designation.Object ID   <>     00000000
) or
( Designation.Root = 'P'     and
  Designation.Object Type = 'S'     and
  Designation.Object ID   <>     00000000
If true then continue, if false: Specify Agent.
Specify Agent branches according to type of
Agent Specification. The condition is:
Designation.User Name <> ''
In both cases task TS01000118 (Specify Position in New Department)
is called. If the condition was true then it's called with as agent
the contents of ORGCHEARM.ACROSSBORDERUSER; if not true then
the role AC0000168 is used to determine the superior(s) of the
"object type affected" and they are used as the agents (ie they receive the workitem).
Hope this helps.
regards,
Rick Bakker
Hanabi Technology

Similar Messages

  • Help Required in Steps to create Hgrid Region

    Hi
    Guys
    I want to create a hgrid region in my oaf for some requirement. can any one please help me to create HGrid or Provide Basic steps.
    Please maill me the document to [email protected]
    I Appreciated your people to come out from this issue.
    Regards
    Santhosh Kumar. K
    [email protected]

    Hello
    As I'm not really fluent with English, I tell you that detailed explanations are given in the Help in a chapter entitled: "About Charts"
    As values must be in a header to be used as labels
    and
    as a header can’t be used to display values defined by a formula,
    it’s necessary to use an auxiliary table in a mixed way.
    I assumes that we have a table containing most of our datas. I name it « main »
    I use an auxiliary table named « 4chart ». In this table the column A is a header one.
    As it can’t display formulas, the year values are typed here
    A1 2007
    A4 2010
    In the main table, the block of cells we want to chart is C3 :D6
    In C3 enter a formula grabbing the value of aux table’s A1
    C3 =4chart :: A1
    fill down until C6
    In D3 thru D6 I enter the values.
    Back to the auxiliary table.
    enter the formula
    B1 =main :: D3
    fill down from D3
    thru D6
    Yvan KOENIG (from FRANCE dimanche 27 janvier 2008 15:18:57)

  • Help Required in : PO Account generator workflow customization.

    Hi All,
    I am new to workflow, I want to customize PO account generator workflow in 11i. I need to build the logic to populate charge-account on PO.
    I have identified the process in PO Account generator workflow but I am not sure whether I should pick the same process for modification or create new process.
    As I don't want if any upgrade patch applied , it will overwrite modified standard process. I have read articles on preserving customizations but couldn't get much from it, they are very confusing.
    Please help.
    Thanks in Advance.

    Hi Asif,
    Thanks for the reply.
    I referred the links mentioned by you, but couldn't find anything relevant to re-triggering of Account Generator workflow.
    The customizations I did are working fine and is triggering the workflow. But my Question is, what are the circumstances that re-trigger the Account Generator for a given Purchase Order.
    To elaborate, say for instance I have created a PO for PO category 'Electrical Equipments' furnishing all other details and charge account is generated for this category, and the PO is saved. Now I come back and change the PO category to 'Medical Equipments' for the same PO, retaining all the other info same.
    So here, will the Account generator be re-triggered to generate different charge account?
    Kindly suggest.
    Thanks,
    Nivedana

  • Need help with our "log and transfer" workflow...

    All,
    Again, it's our first tapeless project so please keep having patience with us.
    What should the workflow be for our project?
    I bring in the Firestore and dump raw files to a hard drive. Should I then transfer all footage to QT files? OR should my editor start looking at footage and carving it up as he transfers those files to QT?
    Our issue is that we have a lot of footage coming in and the new tower is slow when transferring footage from raw files to QT. It's driving us crazy.
    Aside from buying a more powerful tower, is there a way for us to review and log the footage and transfer at a real time pace (for example, is there a way to log the footage and do a transfer to QT files at the end of session?).
    Thanks.

    David, thanks for the questions.
    Yes, it's FS-100. And yes, we are shooting on a HVX200.
    The settings we were given by our editing guru create MXF files rather than QT. If so, we should dump onto a hard drive and then bring into FCP, correct?
    Is there a way to log a number of clips and then transfer them en masse? Or do I have log and transfer them one at a time?
    Our issue is that the computer grinds to a virtual halt while transferring.
    Thanks again. We look forward to your thoughts.

  • Can someone help me with the XDcam transfer workflow for EX3 footage?

    I'm trying to bring in a ton of BPAV footage but can't seem to figure out the workflow.  I've backed up the raw footage, but how do I get it to an editable format in FCP 7?

    Use XDCam Transfer to wrap it as a quicktime.  Should be available on Sony's website.  I believe once you have it installed, you can bring it in straight inside FCP (using Log & Transfer), but I generally just open up XDCam Transfer without opening up FCP (usually right after we finish shooting or bring the cards back) and save it to the desired location, then drag the files into my FCP project at a later time.

  • Help required please on data transfer between DAW's

    Are there any Logic user/s who have moved DAW from Cakewalk to Logic and have transferred
    song data between the two applications? I have tried using OMF but my songs dont line up and go out of synch. Am I using the right file format or is there a better way to do this please?

    Disappointed about the lack of folks who, as per your requirement, converted from Cakewalk to Logic just in time so they could read your post and answer to it ? That would be a bit much, even for Earth Coincidence Control ECCO.
    Converting from one platform to another is one thing, converting from one sequencer to another is another thing, transferring audio is a third, transferring MIDI is a fourth and finally transferring all the other stuff is a fifth chapter altogether.
    Switching platforms is a relatively problem-free endeavour if you make sure there are no special characters ()"!§$%&/*+'#_-:.;,ÄÖÜäöü etc. in any of your file names. If you happen to use +Guitar(take 5):from 5'12"/ 100% wet+ as a file name, you are in trouble. Guaranteed.
    Also make sure you keep file names under 32 characters. Oh, and don't create 32-bit audio files, as these won't work in Logic.
    Logic Projects don't play in Cakewalk and vice versa, as you found out.There is no conversion standard to transfer sessions between DAWs, so you have to make do with what is there and take care of the rest yourself.
    Audio is best converted into one long Region per track, and all Regions must begin at the exact same spot, like 1.1.1.1. This way it takes 15 seconds max to line up all your audio tracks in the new software.
    MIDI can be saved as one or several SMF (standard MIDI File). Each can carry 16 MIDI channels + Tempo information.
    There is no way to transfer all what's left, that is, signature changes, take folders, playlists, audio routings, audio plugins and their settings, markers, text notes, MIDI plugins, etc. So you really need to invent a good working scheme with a writing pad and a lot of screenshots. And quite some concentration and endurance.
    Good Luck
    Christian

  • Help required understanding the purpose of having instance Init blocks

    I want to know exactly what the purpose of having instance initialization blocks in Java. As in static init blocks, we can execute some commands before creating an instance of a class.
    And also in instance init blocks, we are executing some commands which we can do in a constructor. So I’m little bit confused of the purpose of having this concept instance init blocks without writing it in the constructor itself.
    Really appreciate if anyone can explain this ASAP as I am still a beginner who is studying for SCJP exam.
    Thanks in advance.

    The instance initialization blocks are always executed before the constructor code is executed. This may be used for some activity which is common to all constructors (in case constructors are overloaded).

  • Help required in Code understanding

    Hi,
    I am having the following code in a program.Please help me understand this. On F5 the 'fields' table get populated.
    Where and how does it fetch data ?
    system-call ict
        did
          ihttp_scid_get_header_fields
        parameters
          m_c_msg                            " > c handle
          fields                             " > header fields table
          m_last_error.                      " < return code
    Thanks,
    Amit

    Press F1 on the system-call.
    From SAP Help:
    <b>SYSTEM-CALL</b>
    This statement is only for
    !!! Internal use in SAP Basis development !!!
    Even within SAP Basis, it may only be used in programs within the ABAP+GUI development group.
    Its use is subject to various restrictions, not all of which may be listed in the documentation. This documentation is intended for internal SAP use within the Basis development group ABAP+GUI.
    Changes and further development, which may be incompatible, may occur at any time, without warning or notice!
    Regards,
    Prakash.

  • Two step stock transfer process

    hi All,
    i want to transfer material XYZ from plant AA to plant BB  in 2 step stock transfer. Qt= 2000
    So first i am trying to remove stock from plant AA in 303 movement type.
    system throughing error message " Deficit of PL Stock in transfer 48000 PC:    XYZ       BB
    ERROR Message no. M7 021
    after analysis i found that in plant BB , in Stck trans.(plnt)  , stock is showing  (  - 50000)
    i wonder how this stock got negative.
    please help resolving this issue.
    any help will be highly appreciated.
    thanks in advance
    regards,
    Anubhab

    hi Pankaj,
    in both plant AA & BB , negative stock is allowed.
    now i found that if i put the quantity equal to or more than 50000 , then system not giving error.
    but if i put a smaller qt , say 1000, then system deducting it from 50000 & showing deficit 49000  at plant BB.
    so the question is can't i transfer less than 50000 qt to BB from AA?
    Also what is meaning of 50000 qt showing as negative in stock in transfer stock ? does it mean that with out posting 303 at plant AA , customer has posted 305 at plant BB?
    Please help me understand. thanks .
    regards,
    anubhab

  • Error in single step plant transfer

    Hi guys,
    I have a doubt regarding "single step plant transfer"
    when i give material,plant and location in MB1B with
    movement type "301". after entering it and giving all the
    information like Material,quantity, and recieving Plant
    and if i enter i get this error
    "Material 1232 not maintained in plant JOP2"
    matrl no : 1232
    source plant JOP1 recieving plant JOP2
    kindly help me to overcome this error
    regards
    Jino

    hi
    Material 1232 not maintained in plant JOP2
    This means you have to extend this material to plant JOP2
    Go to MM01 and enter the material number 1232 at both Material no & Ref no
    then press enter
    in the next screen select all views & enter in the next screen enter the plant from & plant to. as JOP2
    just keep on pressing enter & Save.
    This will mainatin material in required plant
    Regards

  • Can anyone help me understand "Continue Statements"?

    Hi,
    I was wondering if anyone could help me understand continue statements. I've been studying the java tutorials this weekend but can not get my head around the following explanation: (My thoughts are at the end of this message and it might be easiest to read them first!)
    "The continue statement skips the current iteration of a for, while , or do-while loop. The unlabeled form skips to the end of the innermost loop's body and evaluates the boolean expression that controls the loop. The following program, ContinueDemo , steps through a String, counting the occurences of the letter "p". If the current character is not a p, the continue statement skips the rest of the loop and proceeds to the next character. If it is a "p", the program increments the letter count.
    {code}class ContinueDemo {
    public static void main(String[] args) {
    String searchMe = "peter piper picked a peck of pickled peppers";
    int max = searchMe.length();
    int numPs = 0;
    for (int i = 0; i < max; i++) {
    //interested only in p's
    if (searchMe.charAt(i) != 'p')
    continue;
    //process p's
    numPs++;
    System.out.println("Found " + numPs + " p's in the string.");
    }{code}
    Here is the output of this program:
    Found 9 p's in the string.
    To see this effect more clearly, try removing the continue statement and recompiling. When you run the program again, the count will be wrong, saying that it found 35 p's instead of 9.
    A labeled continue statement skips the current iteration of an outer loop marked with the given label. The following example program, ContinueWithLabelDemo, uses nested loops to search for a substring within another string. Two nested loops are required: one to iterate over the substring and one to iterate over the string being searched. The following program, ContinueWithLabelDemo, uses the labeled form of continue to skip an iteration in the outer loop.
    {code}class ContinueWithLabelDemo {
    public static void main(String[] args) {
    String searchMe = "Look for a substring in me";
    String substring = "sub";
    boolean foundIt = false;
    int max = searchMe.length() - substring.length();
    test:
    for (int i = 0; i <= max; i++) {
    int n = substring.length();
    int j = i;
    int k = 0;
    while (n-- != 0) {
    if (searchMe.charAt(j++)
    != substring.charAt(k++)) {
    continue test;
    foundIt = true;
    break test;
    System.out.println(foundIt ? "Found it" :
    "Didn't find it");
    }{code}
    Here is the output from this program.
    Found it"
    Here are Woodie's thoughts........................................
    1) With the first program I don't understand how the program counts the number of "p's". Like for example how it stores the number of "p's". Shouldn't it say:
    if (searchMe.charAt(i) = 'p') then store it in some sort of containers??? 2) With the second program, I don't understand the test section. For example: Why does it have --? why does it have != after while and why does it have != after if?
    while (n-- != 0)
                    if (searchMe.charAt(j++) != substring.charAt(k++))
                        continue test;
                foundIt = true;
                     break test;Edited by: woodie_woodpeck on Nov 23, 2008 3:29 AM

    Woodie, I think they're just silly "theoretical" examples... ergo don't worry too much not understanding them, coz they don't actually make a lot of sense... as you've allready pointed out there are other "more normal" control structures which achieve the same thing, and which in this case (in my humble opinion) would make for clearer, more concise, more maintainable code.
    All you need to know about continue is "it means go back to the top of the loop"... If you're not comfortable using "continue" then don't.
    There's more than one way to do it.
      public static void main(String[] args) {
        try {
          final String s = "peter piper picked a peck of pickled peppers";
          int count = 0;
          for ( char c : s.toStringArray() ) {
            if (c=='p') count++;
          System.out.println("There are "+count+ " p's in '"+s+"'");
        } catch (Exception e) {
          e.printStackTrace();
      }Having said all that... I did use continue in anger the other day... I was reading Geometries from a shape file... the reader was throwing an ArrayIndexOutOfBoundsException given an "empty Feature" (ie a feature with the geospatial presence)... All I did was catch the exception and continue trying to read the new feature... the alternative would have been to rewrite the control logic of the whole reader loop... quick, simple effective... but I don't routinely build continue statements into new code... just a matter of personal taste.
    Cheers. Keith.

  • Pls Help me with steps to add data from xml file to SAP B1 through B1iSN.

    Pls Help me with steps to add data from xml file to SAP B1 through B1iSN. I  am getting stuck in xsl transformation. not able to understand where the mapping code needs to be added.
    Pls explain me the steps for adding data from xml to B1 quotation step by step.
    thanks and regards
    Priya

    Hi,
    Have you checked this: https://sap.na.pgiconnect.com/p45508295/?launcher=false&fcsContent=true&pbMode=normal ?
    Thanks,
    Gordon

  • E-Rows = NULL and A-Rows=42M? Need help in understanding why.

    Hi,
    Oracle Standard Edition 11.2.0.3.0 CPU Oct 2012 running on Windows 2008 R2 x64. I am using Oracle 10g syntax for WITH clause as the query will also run on Oracle 10gR2. I do not have a Oracle 10gR2 environment at hand to comment if this behaves the same.
    Following query is beyond me. It takes around 2 minutes to return the "computed" result set of 66 rows.
    SQL> WITH dat AS
      2          (SELECT 723677 vid,
      3                  243668 fid,
      4                  TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
      5                  TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt
      6             FROM DUAL
      7           UNION ALL
      8           SELECT 721850,
      9                  243668,
    10                  TO_DATE ('06.02.2013', 'dd.mm.yyyy'),
    11                  TO_DATE (' 22.03.2013', 'dd.mm.yyyy')
    12             FROM DUAL
    13           UNION ALL
    14           SELECT 723738,
    15                  243668,
    16                  TO_DATE ('16.03.2013', 'dd.mm.yyyy'),
    17                  TO_DATE ('  04.04.2013', 'dd.mm.yyyy')
    18             FROM DUAL)
    19      SELECT /*+ GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
    20        FROM dat
    21  CONNECT BY LEVEL <= maxdt - mindt + 1
    22  order by fid, vid, dtshow;
    66 rows selected.
    SQL>
    SQL> SELECT * FROM TABLE (DBMS_XPLAN.display_cursor (NULL, NULL, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  9c4vma4mds6zk, child number 0
    WITH dat AS         (SELECT 723677 vid,                 243668 fid,
                TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
    TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt            FROM DUAL
    UNION ALL          SELECT 721850,                 243668,
       TO_DATE ('06.02.2013', 'dd.mm.yyyy'),                 TO_DATE ('
    22.03.2013', 'dd.mm.yyyy')            FROM DUAL          UNION ALL
        SELECT 723738,                 243668,                 TO_DATE
    ('16.03.2013', 'dd.mm.yyyy'),                 TO_DATE ('  04.04.2013',
    'dd.mm.yyyy')            FROM DUAL)     SELECT /*+
    GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
        FROM dat CONNECT BY LEVEL <= maxdt - mindt + 1 order by fid, vid,
    dtshow
    Plan hash value: 1865145249
    | Id  | Operation                              | Name | Starts | E-Rows | A-Rows |   A-Time   |  OMem |  1Mem | Used-Mem |
    |   0 | SELECT STATEMENT                       |      |      1 |        |     66 |00:01:54.64 |       |       |          |
    |   1 |  SORT UNIQUE                           |      |      1 |      3 |     66 |00:01:54.64 |  6144 |  6144 | 6144  (0)|
    |   2 |   CONNECT BY WITHOUT FILTERING (UNIQUE)|      |      1 |        |     42M|00:01:04.00 |       |       |          |
    |   3 |    VIEW                                |      |      1 |      3 |      3 |00:00:00.01 |       |       |          |
    |   4 |     UNION-ALL                          |      |      1 |        |      3 |00:00:00.01 |       |       |          |
    |   5 |      FAST DUAL                         |      |      1 |      1 |      1 |00:00:00.01 |       |       |          |
    |   6 |      FAST DUAL                         |      |      1 |      1 |      1 |00:00:00.01 |       |       |          |
    |   7 |      FAST DUAL                         |      |      1 |      1 |      1 |00:00:00.01 |       |       |          |
    --------------------------------------------------------------------------------------------------------------------------If I take out one of the UNION queries, the query returns in under 1 second.
    SQL> WITH dat AS
      2          (SELECT 723677 vid,
      3                  243668 fid,
      4                  TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
      5                  TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt
      6             FROM DUAL
      7           UNION ALL
      8           SELECT 721850,
      9                  243668,
    10                  TO_DATE ('06.02.2013', 'dd.mm.yyyy'),
    11                  TO_DATE (' 22.03.2013', 'dd.mm.yyyy')
    12             FROM DUAL)
    13      SELECT /*+ GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
    14        FROM dat
    15  CONNECT BY LEVEL <= maxdt - mindt + 1
    16  order by fid, vid, dtshow;
    46 rows selected.
    SQL>
    SQL> SELECT * FROM TABLE (DBMS_XPLAN.display_cursor (NULL, NULL, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  1d2f62uy0521p, child number 0
    WITH dat AS         (SELECT 723677 vid,                 243668 fid,
                TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
    TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt            FROM DUAL
    UNION ALL          SELECT 721850,                 243668,
       TO_DATE ('06.02.2013', 'dd.mm.yyyy'),                 TO_DATE ('
    22.03.2013', 'dd.mm.yyyy')            FROM DUAL)     SELECT /*+
    GATHER_PLAN_STATISTICS */ DISTINCT vid, fid, mindt - 1 + LEVEL dtshow
        FROM dat CONNECT BY LEVEL <= maxdt - mindt + 1 order by fid, vid,
    dtshow
    Plan hash value: 2232696677
    | Id  | Operation                              | Name | Starts | E-Rows | A-Rows |   A-Time   |  OMem |  1Mem | Used-Mem |
    |   0 | SELECT STATEMENT                       |      |      1 |        |     46 |00:00:00.01 |       |       |          |
    |   1 |  SORT UNIQUE                           |      |      1 |      2 |     46 |00:00:00.01 |  4096 |  4096 | 4096  (0)|
    |   2 |   CONNECT BY WITHOUT FILTERING (UNIQUE)|      |      1 |        |     90 |00:00:00.01 |       |       |          |
    |   3 |    VIEW                                |      |      1 |      2 |      2 |00:00:00.01 |       |       |          |
    |   4 |     UNION-ALL                          |      |      1 |        |      2 |00:00:00.01 |       |       |          |
    |   5 |      FAST DUAL                         |      |      1 |      1 |      1 |00:00:00.01 |       |       |          |
    |   6 |      FAST DUAL                         |      |      1 |      1 |      1 |00:00:00.01 |       |       |          |
    26 rows selected.What I cannot understand is why the E-Rows is NULL for "CONNECT BY WITHOUT FILTERING (UNIQUE)" step and A-Rows shoots up to 42M for first case. The behaviour is the same for any number of UNION queries above two.
    Can anyone please help me understand this and aid in tuning this accordingly? Also, I would be happy to know if there are better ways to generate the missing date range.
    Regards,
    Satish

    May be, this?
    WITH dat AS
                (SELECT 723677 vid,
                        243668 fid,
                        TO_DATE ('06.03.2013', 'dd.mm.yyyy') mindt,
                        TO_DATE ('06.03.2013', 'dd.mm.yyyy') maxdt
                   FROM DUAL
                 UNION ALL
                 SELECT 721850,
                        243668,
                       TO_DATE ('06.02.2013', 'dd.mm.yyyy'),
                       TO_DATE (' 22.03.2013', 'dd.mm.yyyy')
                  FROM DUAL
                UNION ALL
                SELECT 723738,
                       243668,
                       TO_DATE ('16.03.2013', 'dd.mm.yyyy'),
                       TO_DATE ('  04.04.2013', 'dd.mm.yyyy')
                  FROM DUAL)
           SELECT  vid, fid, mindt - 1 + LEVEL dtshow
             FROM dat
      CONNECT BY LEVEL <= maxdt - mindt + 1
          and prior vid = vid
          and prior fid = fid
          and prior sys_guid() is not null
      order by fid, vid, dtshow;
    66 rows selected.
    Elapsed: 00:00:00.03

  • Can you help me understand the use of the word POSITION in TR and CFM?

    Hi,
    I am trying to have a view of typical BI reports in TR and TM/CFM so through my research I came to the following link:.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/62/08193c38f98e1ce10000000a11405a/frameset.htm
    My problem on this link and other postings on this site seem to be the same. Can you help me understand the use of the word POSITIONS in these context:
    1. Our client has asked for financial transaction reports in BW, such as position of Borrowings, Investments and Hedge Operations (TM data).
    2. I have a requirement on, some reports related to Money Market (Fixed Term Deposits, Deposits at Notice) something on FSCM-Treasury and Risk Manager. These reports will be similar to that of Loans, i.e. Position statement, flow statement, etc.
    3. The set of position values for a single position or a limited amount of positions can be reported by transactions TPM12 and TPM13 in R3.
    4. 0CFM_C10 (Financial Positions Cube)
    Do you have some simple report outputs to help clarify how the word POSITION is used in such environments?
    Thanks
    Edited by: AmandaBaah on Feb 15, 2010 4:39 PM

    If I future buy 10 shares in company at £1 per share - at the end of the day my potential value is £10
    The next day the shares drop tp £0.9 per share - I have a negative position - my shares are only worth £9
    I haven;t bought them yet - but I have a negative position - ie if things stayed as they are - I am going to realise (ie end up with)  a loss
    Now you can use this for loans and foreign exchange banks as well...

  • Need help for understanding the behaviour of these 2 queries....

    Hi,
    I need your help for understanding the behaviour of following two queries.
    The requirement is to repeat the values of the column in a table random no of times.
    Eg. A table xyz is like -
    create table xyz as
    select 'A' || rownum my_col
    from all_objects
    where rownum < 6;
    my_col
    A1
    A2
    A3
    A4
    A5
    I want to repeat each of these values (A1, A2,...A5) multiple times - randomly decide. I have written the following query..
    with x as (select my_col, trunc(dbms_random.value(1,6)) repeat from xyz),
    y as (select level lvl from dual connect by level < 6)
    select my_col, lvl
    from x, y
    where lvl <= repeat
    order by my_col, lvl
    It gives output like
    my_col lvl
    A1     1
    A1     3
    A1     5
    A2     1
    A2     3
    A2     5
    A3     1
    A3     3
    A3     5
    A4     1
    A4     3
    A4     5
    A5     1
    A5     3
    A5     5
    Here in the output, I am not getting rows like
    A1     2
    A1     4
    A2     2
    A2     4
    Also, it has generated the same set of records for all the values (A1, A2,...,A5).
    Now, if I store the randomly-decided value in the table like ---
    create table xyz as
    select 'A' || rownum my_col, trunc(dbms_random.value(1,6)) repeat
    from all_objects
    where rownum < 6;
    my_col repeat
    A1     4
    A2     1
    A3     5
    A4     2
    A5     2
    And then run the query,
    with x as (select my_col, repeat from xyz),
    y as (select level lvl from dual connect by level < 6)
    select my_col, lvl
    from x, y
    where lvl <= repeat
    order by my_col, lvl
    I will get the output, exactly what I want ---
    my_col ....lvl
    A1     1
    A1     2
    A1     3
    A1     4
    A2     1
    A3     1
    A3     2
    A3     3
    A3     4
    A3     5
    A4     1
    A4     2
    A5     1
    A5     2
    Why the first approach do not generate such output?
    How can I get such a result without storing the repeat values?

    If I've understood your requirement, the below will achieve it:
    SQL> create table test(test varchar2(10));
    Table created.
    SQL> insert into test values('&test');
    Enter value for test: bob
    old   1: insert into test values('&test')
    new   1: insert into test values('bob')
    1 row created.
    SQL> insert into test values('&test');
    Enter value for test: terry
    old   1: insert into test values('&test')
    new   1: insert into test values('terry')
    1 row created.
    SQL> insert into test values('&test');
    Enter value for test: steve
    old   1: insert into test values('&test')
    new   1: insert into test values('steve')
    1 row created.
    SQL> insert into test values('&test');
    Enter value for test: roger
    old   1: insert into test values('&test')
    new   1: insert into test values('roger')
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select lpad(test,(ceil(dbms_random.value*10))*length(test),test) from test;
    LPAD(TEST,(CEIL(DBMS_RANDOM.VALUE*10))*LENGTH(TEST),TEST)
    bobbobbobbobbobbobbobbobbobbob
    terryterry
    stevestevesteve
    rogerrogerrogerrogerrogerrogerrogerrogerrogerYou can alter the value of 10 in the SQL if you want the potential for a higher number of names.
    Andy

Maybe you are looking for

  • Query vs Sales Analysis Report

    I wrote a query that does virtually the same thing as a sales analysis report -- add up all invoice totals and calculate a gross sales number. In the sales analysis report ItemXXX has a total sales of $1456.94 My query ItemXXX has a total sales of $1

  • Crystal report 9 Sql Server 2008 R2 compatability

    Can we use Crystal report version 9 in Sql server 2008 R2 to generate reports in web server. Kindly tell us about the compatability of  these two. If there is any support issue between these two kindly mention the same. Edited by: Deepan1 on Jun 7, 2

  • SQL*plus not showing proper value.

    Hi All, In one of the database, while quering in sql developer data is showing data as "PüSS", but when trying sqlplus (client and server), its showing as "Puss", but the actual value is "PüSS". Oracle verion 10.2.0.4 and Linux. SQL> select sys_conte

  • Hand Free Link when in Maps

    When I get in my Honda accord and my iphone 6 links up via bluetooth, then use maps, it always defaults to giving map directions via the hands free link (honda speaker system).  Each time I start a map I can click on microphone and tell it to use iph

  • OSStatus error -19160

    I keep getting an "OSStatus error -19160" when I try to play videos from websites through my Quicktime player.  How do I fix it?