Concatenated groupings question

Hello,
Regarding to concatenated groupings, if i have: GROUP BY grouping sets(a,b), grouping sets(c,d), the result is a cross product of groupings from each grouping set. So, we have the following groupings: (a,c), (a,d), (b,c), (b,d).
But if we have GROUP BY department_id, ROLLUP(job_id), CUBE(manager_id), which are the groupings in this case?
Also, on GROUP BY department_id, ROLLUP(job_id, <other column>), CUBE(manager_id) ?
The last 2 examples are a bit confusing for me.
Thanks!

Hi,
Roger22 wrote:
Ok, so:
SQL> select department_id, job_id, manager_id, sum(salary), grouping(department_id)
2  from employees e
3  group by rollup(department_id, (job_id, manager_id))
4  ;
DEPARTMENT_ID JOB_ID     MANAGER_ID SUM(SALARY) GROUPING(DEPARTMENT_ID)
SA_REP            149        7000                       0
7000                       0
10 AD_ASST           101        4400                       0
10                              4400                       0
23 rows selected
What table are you using? When I run that query with my hr.employees table, I get 46 rows, not 23. If your employees table is a subset of hr.employees, then post the code you used to cfreate it.
I don't understant the first two rows(those with salary 7000). There is no grouping of (job_id, manager_id) in this example , because it's treated as a unit,Sorry, I don't understand what you mean here.
There is a grouping of (job_id, manager_id) in this example. The GROUP BY clause contains "(job_id, manager_id)", so there is a separate row for each distinct combination of job_id and manager_id.
it's a composite column and ROLLUP does not roll up in each direction possible (so, with all combinations in GROUP BY clause), but rolls up from the highest level to the outermost level (from right to left). So, the groupings are:
department_id, job_id, manager_id
department_id
and () -- which is the grand total calculated
Please clarify in this case.. hope i was more clearThat's right.
What exactly don't you understand about the beginning of the output?
I really think it would help if you displayed GROUPING for all of the GROUP BY columns, not just one of them, like this:
SELECT        department_id
,       job_id
,       manager_id
,       SUM (salary)               AS sum_salary
,       GROUPING (department_id)     AS g_d
,       GROUPING (job_id)          AS g_j
,       GROUPING (manager_id)          As g_m
FROM       hr.employees     e
GROUP BY  ROLLUP ( department_id
           , (job_id, manager_id)
;Output (abridged):
DEPARTMENT_ID JOB_ID     MANAGER_ID SUM_SALARY G_D G_J G_M
              SA_REP            149       7000   0   0   0
                                          7000   0   1   1
           10 AD_ASST           101       4400   0   0   0
           10                             4400   0   1   1
                                        691400   1   1   1As you said, ROLLUP is treating job_id and manager_id as a uint.
On each row where an individual job_id is used, an individual manager_id is used also.
Whenever all l job_ids are combined, all manager_ids are combined also.
GROUPING (job_id) = GROUPING (mnaager_id) on every row.
It's unclear, but you seem to have a question about how the 2nd row above
DEPARTMENT_ID JOB_ID     MANAGER_ID SUM_SALARY G_D G_J G_M
                                          7000   0   1   1is being produced. Look at the GROUPING output. GROUPING (department_id) = 1, meaning the row represents only one department_id (GROUP BY treats NULL as a value), but GROUPING (job_id) = 1 and GROUPING (manager_id) = 1, meaning that this row is a super-aggregate, combining rows regardless of their job_id or manager_id. The 2nd row functions exactly the same as any other row with the same values (0, 1, 1) in the GROUPING columns. For eample, the 4th row above:
DEPARTMENT_ID JOB_ID     MANAGER_ID SUM_SALARY G_D G_J G_M
           10                             4400   0   1   1Do you uderstand how this row is formed? It is a summary of all the rows in the table where department_id=10 (As it happens, there is only one row with department_id=10 in the table, but GROUP BY produces a summary anyway.)
In exactly the same way, the 2nd row of output is a summary of all the rows in the table where department_id is NULL. (As it happens, there is only one row with department_id is NULL in the table, but GROUP BY produces a summary anyway.)

Similar Messages

  • Easy Question: How to split concatenated string into multiple rows?

    Hi folks,
    this might be an easy question.
    How can I split a concatenated string into multiple rows using SQL query?
    INPUT:
    select 'AAA,BBB,CC,DDDD' as data from dualDelimiter = ','
    Expected output:
    data
    AAA
    BBB
    CCC
    DDDDI'm looking for something kind of "an opposite for 'sys_connect_by_path'" function.
    Thanks,
    Tomas

    Here is the SUBSTR/INSTR version of the solution:
    SQL> WITH test_data AS
      2  (
      3          SELECT ',' || 'AAA,BBB,CC,DDDD' || ',' AS DATA FROM DUAL
      4  )
      5  SELECT  SUBSTR
      6          (
      7                  DATA
      8          ,       INSTR
      9                  (
    10                          DATA
    11                  ,       ','
    12                  ,       1
    13                  ,       LEVEL
    14                  ) + 1
    15          ,       INSTR
    16                  (
    17                          DATA
    18                  ,       ','
    19                  ,       1
    20                  ,       LEVEL + 1
    21                  ) -
    22                  INSTR
    23                  (
    24                          DATA
    25                  ,       ','
    26                  ,       1
    27                  ,       LEVEL
    28                  ) - 1
    29          )       AS NEW_STRING
    30  FROM    test_data
    31  CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(DATA,'[^,]','')) - 1
    32  /
    NEW_STRING
    AAA
    BBB
    CC
    DDDD

  • Question about Shuffle By Groupings

    I listen to a good deal of classical music and lately this has become more and more frustrating to do on itunes. Most classical works have more than one movment a peice, and it is continually frustrating to see even with group shuffle on one song out of a grouping of 18 make it on the playlist even though the grouping tag for all 18 are set. Am I still doing something wrong? Would a complete Reinstall of iTunes fix this problem?

    I have the same problem with tracks that I used to be able to group together. They would stick together in a shuffled playlist so long as the grouping names were correctly done and the checkbox was marked.
    For the last few versions of iTunes, however, every time I check the Grouping box (assumedly to engage it for that group), close the "Get info" screen, and then open it again, the checkbox is unchecked again. Nothing I do maintains grouping for any number of songs.
    IMO the "Join CD tracks" is not a good solution because it doesn't solve the problem that iTunes is not funtioning as it should, and that I shouldn't have to re-import music just to get song grouping to work.
    Do Apple solution-makers even read these posts? :P

  • Grouping in rtf template like oracle reports - a newbie question

    Hello all
    I am new to BI Publisher and have probablly a silly question to ask.
    I have a basic query that returns a flat xml file which looks something like this. it will have multiple rows.
    <ROWSET>
    <ROW num="1">
    <DATE>01-DEC-2007</DATE>
    <PACKAGE>XXX </PACKAGE>
    <DROP_OFF>Hotel1</DROP_OFF>
    <ROOM>1</ROOM>
    <NAME>Test Customer</NAME>
    <PROBLEM_RECORDED>N</PROBLEM_RECORDED>
    <EXCEPTION>1</EXCEPTION>
    </ROW>
    </ROWSET>
    Because i am fairly new to xml i am at a loss trying to work out how i can form a template that will effectively allow grouping at say
    1. Date Level
    2. Package Level
    3.Drop Off level
    4. put all other data in here
    In reports i would just do groups and alter the layout accordingly. Obviously if i had an oracle report version of the sql that generates the xml then i could just generate the xml from the report and i would get the xml i am looking for .
    But I am working with basic sql not reports and am wondering What do I have to do with my xml to get it looking live the grouping I mention above, given all i have to play with is the example xml I included. I am really bamboozled and think i am missing something simple.
    I dont want to have to write multiple queries with different groupings using cast , multiset as I thought one of the benefits of BI Publisher was one query multiple layouts.
    Thanks
    Lisa

    If you haev word plugin installed,
    please follow the documentation and try using that,
    load the xml in the word plugin
    and then select insert table/form and then you can do the drag and drop,
    and group by each fields.
    http://blogs.oracle.com/xmlpublisher/2006/10/30
    http://blogs.oracle.com/xmlpublisher/2007/10/30

  • Need to sum max values in a report with Hidden groupings

    I have looked all over and have not found my exact situation, so I am posting my first question.  I have a report that I have grouped on multiple levels.  So my report has a customer/header/detail/release grouping.  I have written a custom
    expression so that only a single value, which is the max value in the group, is shown in the detail, with all values showing in the release.  I have then set my visibility toggle to toggle on header, then detail, then release and I need to sum up those
    max values into a field on the report.  The custom expression that I have written works correctly when you are showing on the detail level.  It gives the correct value, which is the max value in each release.
    What I then need the report to do is to sum only that max value and roll that up into the header group, so that I get a total of the max values.  
    I have tried using the MAX function in my expression to get the correct max value, but I cannot get SSRS 2008 R2 to sum that, and I have tried writing a custom expression that will calculate the max (Non-zero values divided by number of non-zero records) and
    both ways work correctly until I try to rollup and sum to the next group level.
    I have also tried using a group variable and custom code to get the value and save it to a variable, but I have not had any luck in setting or getting that value correctly back to my report.
    At its most basic it feels like I should be able to set a Sum(Max(Fields!ValueColumn.Value) and let SSRS handle how that should be broken out, but after trying that repeatedly I have still had no luck.  I cannot adjust the SQL as I need the level of detail
    that the report shows, although I could add more fields as long as I don't add any groupings or totals that would reduce the granularity of that data being returned.
    Any new avenue to explore would be very helpful.
    Thank you in advance,
    Chad
     

    Ok, after continuing to search the internet I finally found the extra piece that I was missing that gave me the results I needed. The new expression looks like this:
    =runningvalue(Sum(Max(IIF(LEFT(Fields!JobNum.Value,1)="S" AND Fields!Week1STol.Value<>0, CDBL(Fields!Week1STol.Value), 0),"JobItem"),"JobItem"),SUM, "JobItem")
    In this I wrapped the original expression of Max in both a Sum and a runningvalue both at the JobItem level to get this rollup value. Now when I open the grouping I get the correct running value at each level.
    What this really gives to me is a running total at each of four groupings, even with a "max" value at the detail level. This also allows me to total a max value inline on the report, without needing a hidden row, or report footer.
    Thank you to everyone who looked at this, I hope it helps someone else. If this answer is not clear enough, please don't hesitate to add to the comments and I will try to clarify.
    Thank you, Chad

  • Follow-up question for Chris H on longtext in BDC for IW31

    Chris -
    Here's the relevant part of my code:
    PERFORM DYNPRO USING:
    'X' 'SAPLCOIH'          '3000',            "
    ' ' 'CAUFVD-KTEXT   '   SCRN_PROBLEM1,     " 1st line problem text
    ' ' 'CAUFVD-ANLZU   '   CAUFVD-ANLZU,      " System condition
    ' ' 'BDC_OKCODE'       '=LTXK'.            "
    LOOP AT i_txt INTO wa_txt.
      v_txtln_ctr_n = sy-tabix + 2.    " Chris - note that I'm bumping to "3" here
      v_txtln_ctr_c = v_txtln_ctr_n.
      CONCATENATE 'RSTXT-TXLINE('
                  v_txtln_ctr_c
             INTO v_bdc_txtln_lit.
      CONDENSE v_bdc_txtln_lit NO-GAPS.
      PERFORM DYNPRO USING:
        'X' 'SAPLSTXX'          '1100',              "
        ' ' v_bdc_txtln_lit     wa_txt,              " line of problem text
        ' ' 'BDC_OKCODE'        '=ENTR'.             "
    ENDLOOP.
    This actually works - it creates an order in which the long text begins with what is in the variable SCRN_PROBLEM1 and continues with what is in i_txt concatenated together.  So I get, for example:
    "This is the short description. a b c d e"
    where:
    scrn_problem1 = 'This is the short description'
    row 1 of i_txt = 'a'
    row 2 of i_txt = 'b'
    row 3 of i_txt = 'c'
    row 4 of i_txt = 'd'
    row 5 of i_txt = 'e'
    The only problem is that the BDC doesn't go thru on its own.  When I change 'N' to 'E', the BDC brings up a screen with the title:
    "Change order text header Alternative Language EN"
    Then, when I just "back-arrow" from this, the BDC does complete successfully and I can see the correct text saved for the order in IW32.
    What am I doing wrong to cause this "change order text header" screen to come up?  Is it the "LTXK" value of the OK-CODE in the first dynpro call above?
    Or maybe something with my default user parameters?  I had to set quite a few of these in order to get the BDC to go with just a system, priority, and short text/long text.
    I'm really hoping you can see what's going on here because I'm at a loss.
    Thanks for whatever help you can provide.  You seem to have coded this BDC before, so that's why I'm directing this question to you.
    BTW, I'd try the BAPI except the documentation specifically says it won't observe user default parameters and this is a must in our situation.
    Thanks again
    Dave

    Chris/Rich -
    My suspicion was correct.  In the last loop over the longtext itab, the ok_code must be 'TXBA', not 'ENTR'.
    Here's the code that works without any 'E' interruptions:
    PERFORM DYNPRO USING:
    'X' 'SAPLCOIH'          '3000',            "
    ' ' 'CAUFVD-KTEXT   '   SCRN_PROBLEM1,     " 1st line problem text
    ' ' 'CAUFVD-ANLZU   '   CAUFVD-ANLZU,      " System condition
    ' ' 'BDC_OKCODE'       '=LTXK'.            "
    DESCRIBE TABLE i_txt LINES v_txt_cnt.
    LOOP AT i_txt INTO wa_txt.
      v_txtln_ctr_n = sy-tabix + 2.
      v_txtln_ctr_c = v_txtln_ctr_n.
      CONCATENATE 'RSTXT-TXLINE('
                  v_txtln_ctr_c
             INTO v_bdc_txtln_lit.
      CONDENSE v_bdc_txtln_lit NO-GAPS.
      IF sy-tabix = v_txt_cnt.
        v_txt_ok = '=TXBA'.                    " no more text lines coming
      ELSE.
        v_txt_ok = '=ENTR'.                    " more text lines coming
      ENDIF.
      PERFORM DYNPRO USING:
        'X' 'SAPLSTXX'          '1100',       
        ' ' v_bdc_txtln_lit     wa_txt,        " line of problem text
        ' ' 'BDC_OKCODE'        v_txt_ok.      " ok_code
    ENDLOOP.
    The result is that the longtest display in IW32 will be what's in "SCRN_PROBLEM1" followed by all the lines that are in i_txt.
    Reagrds
    djh

  • Questions on ABKRS and Wage type

    Hello,
    Am in the process of transitioning to SAP HR and have some questions needing answers:
    My first question is on ABKRS which is the default value for payroll accounting area. When all the necessary entries have been made when creating "Employee Sub group" during configuration, should the SAME entries appear under LGMST or ABKRS decision tree? The particular screen shows "<b>Display feature ABKRS: decision tree" under PERSK: Employee Subgroup?</b>
    My other question is, from the change view "Employee Subgroup Grouping" for primary wage type, how do I <u>combine</u> "<b>Employee Subgroup for primary wage type</b>? How do I group the "<b>Employee Subgroup already named to group in the "Change view "Employee subgroup Grouping for Primary Wage Type</b>": Overview screen?
    Your assistance is greatly appreciated.
    Faith

    1.     ABKRS is used to default the Payroll Area in infotype 0001, based on the EE sub group grouping,
    LGMST is used to default the WT model for infotype 0008, based on the Personnel Areas.
    2.     For Employee Subgroup already named to group in the "Change view "Employee subgroup Grouping for Primary Wage Type U can always amed the groupings in change status., even if the field is grayed u can removed that and change.
    Kindly just let me know if u have any concern…
    Reward points if u find the answer is helpful
    Asha

  • Can anyone answer this question? What is used to format a string so that it falls into a certain Row/Column in excel? see text for indepth question.

    I'm attaching a file that may help. Just remember this is my FIRST attempt at using NI/FeildPoint so things that would be obvious to the normal users more than likely would slide right by me. So I'll try and explain what the text contains as to make my problem more clear. I'm using a FP-1000, FP-AI-100, and a FP-TB-10. i'm creating a application where I'm using the 8 channels from the FP-AI-100 to monitor a control system ,that we manufacture. The control system is in an environmental chamber. I use the FP-TB-10 to monitor the temperature while in the chamber. The control system is ran for 4 hours under varing enviromental conditions while I monitor vital system voltages with the FP-AI-100. Now the application that i'm building starts with the obvious FP CREATE.VI and so forth I have no problem communicating with the FP's, but the information that I'm monitioring needs to be placed into a file with Headers describing the information below it. Now I use a "WHILE LOOP.VI" to monitor the FP-AI-100 & FP-TB-10 for the 4 hour period. but before that I create and open a file where I use a "CONCATENATE STRINGS.VI" to enter the headers I need. I do this by CONSTANTS, CONTROLS, TABs, AND CARRIAGE RETURN being entered into the "CONCATENATE STRINGS.VI" in the order I want them to appear. I use ROW 1 to enter (OPERATOR:with a CONSTANT) an a (CONTROL so the operator may enter his name and be recorded into the file) using a TAB to seperate Columns and a CARRIAGE RETURNto drop down to ROW 2 for the next headers. I use header names and TABs to seperate the columns. This part works great. I end up with ROW 1 having the operator information then ROW 2 having the headers for all the channels I'm using to monitor the control system with in their own column. The trouble happens when I write to this file during the "WHILE LOOP". The information recorded for DATE:, TIME:, and Channel 0 of the FP-AI-100 end up right under their corresponding header on ROW 3, but the rest of the data ends up on ROW 4 in column 3 and goes down many rows with some of the data not being stored at all. It varies on how many rows are used starting at ROW 4 but hey always stay in column 3. I use the "FP READ.VI" outputing to a "ARRAY TO SPREADSHEET STRING.VI" outputing to a "CONCATENATE STRINGS.VI" for each channel within the "WHILE LOOP" then into the "WRITE.VI". I use the "CONCATENATE STRINGS.VI" to place my data OR atleast I thought you could do that some how I'm not quit doing something write either there is a sampling/timing issue or writing to file issue where things are being confused in the "WHILE LOOP" if someone know a better route to perform what I'm tring here I would be interested. Its not like I'm not giving it the old colledge try here but without proper training and the vagness of the manuals it's difficult to understand what every connection actually does.I'm tring though for everyone who happens to fill pity for me
    Thanks for your help
    John Morris
    Glendinning Marine Product, Inc.
    Attachments:
    ALLchannels ‏273 KB

    > I appreciate your effort to help me, but there is still a slight cloud
    > in front of my eyes here.(I must mention that I'm using Labview 5.1
    Oh, to bad. I'm using LV 6,02 and tried to save the application as LV5.1,
    but it didn't work.
    > Lets start with the easy one which is the SECOND main thing you
    > wanted to mention. In my application I used individual Create Tag.vi's
    > "so your saying that I can use just one Create Tag.vi and one Read.vi
    > and what ever I use to display the values will automatically to show
    > the individual channels" in other words if I use a "Indicator(DBL)"
    > comming out of the Read.vi what ever I use in the "PANEL" layout will
    > expand to show all 8 channel if I was using a FP-AI-100? Cool...
    Allmost right. The 8 channels come out as 1D-array, ch0...ch7.
    > #1--How do I change the delimiter (TAB) to a delimiter (comma) in a
    > Array to Spreadsheet String.vi?
    > ...cut
    I don't use this Spreadsheet VI, because files coming out there allways
    start this time consuming EXCEL wizzard. Because of this, I programmed my
    own CSV-conversion vi. Maybe you could just use a common texteditor, like
    wordpad and put the csv-examples from my last reply down to a text file
    and rename it to *.csv. Texteditors terminate lines with "\r\n" by
    default, so this is a very quick way for testing.
    > FP_Analog_Logging example to record all eight channels it uses a Array
    I didn't find the vi you metione above, but there is another good one:
    Look at examples\FieldPoint\DataLogging\FP Logger.vi.
    In a little case structure, at "false", there is a function called "Format
    into string".
    Pop up on the format string and adjust >>'\' Codes Display<<.
    Then you change the format string into: %.;%-f%s
    A Tab string is connected to the lower input of this function. Replace
    this one with a comma.
    That should do.
    >
    > #2--If using just one Create Tag.vi and one Read.vi and I have the
    > Item Name listed as ALL I take it that the information comming out of
    > the Read.vi is data for each channel in a String format starting with
    > channel 0 and ending with channel 7 for the FP-AI-100.
    Yes, just as explained above. If you put a indicator at the output to
    display the values, you can expand the display to show all 8 channels, but
    you can't name induvidual cells. In a array, all cells have identical
    named labels. If you want to name the individually, you have to attach the
    array to cluster function and put the indicator after this one. Enable
    labe display and name the output values individually.
    > #3--Now I use the following to "Format String" in the Array to
    > Spreadsheet string.vi (%.4f)but I don't see anyway of changing the
    > delimiter from (TAB) to (COMA)
    Explained above.
    > #4 you stated text strings need a "as prefix and sufix" and each
    > string is seperated by a coma, a period is used as decimal number
    > separator and lines have to be terminated by my question is
    > WHERE IS THIS ACCOMPLISHED? WHAT VI OR WHAT CONNECTOR PIN?
    Well, modifying strings are done with string functions.
    Above, as I explained how the sample FP Logger.vi can be modified to do
    the job for numbers. The pre- and suffixing with ", you only need for
    strings, which EXCEL should interpret a string and as nothing else as a
    string, even if there's a number inside. You usually need this only for
    headers. So its easyest, if you just write your string into a string
    constant or control and concatenate it to the previous csv-file contents.
    Oh, I just see by looking at the above mentioned example... Inside the
    case structure, but in the "true" case, there are error messages
    concatenated to the logfile. At this point it is importent, to use " for
    integrating the message into the CSV file, because a error message usually
    looks like this: >> ERROR 2345 in vi yxz <<
    Here you have text and number strings mixed in one line. EXCEL does not
    know, if it should interpret the number inside the error line as separate
    number, separating the line into three colums i.e. string before number,
    number and string after number. So tell EXCEL by putting a " before and
    after the line each.
    For this, expand the Format To String function by one input, move down all
    connections, to be able to insert a string constant with a " to the first
    argument connector. Change the contents of the string constant at the
    bottom argument from tab to ", (quotation mark AND comma)
    > #5 You gave me an example of what a 3 column header could look like:
    > "col0","col1","col2"\r\n Now is this something that you enter
    > somewhere cause I know that \r is carriage return and \n is newline so
    > I take it that the above is entered somewhere maybe in the Write.vi to
    > the connector called Header (F)? See this is what confuses me because
    > NI manuals have no examples of certain connectors types being used or
    > any reference as to how they manipluate data with there varing type
    > inputs. Or maybe I'm just missing them.
    The example I mentioned above help here to.
    Look at the Write File function. This function receves data from a
    function named concatenate strings. Expand this function to have one more
    spare input at the bottom. Create a string constant. Switch the constant
    display to "\" mode. Enter "col0","col1","col2"\r\n into the constant.
    Connect the constant to the spare input.
    Doing this, every dataline in the csv file is followed by
    "col0","col1","col2"\r\n .
    I wish you a nice weekend,
    Rainer Ehrt

  • Power Mac G4 RAID Question

    After successfully putting OS X Leopard on my Power Mac G4, I then gasped at the amount of space I had; from the built in 10 GB hard drive, I had a couple hundred MegaBytes left. However, I recently pulled a 40 GB Hard Drive from another computer, and installed it. The Mac had no problem identifying and formatting it.
    However, having very little space and more things to install, my question is this; How do I set up this Mac to identify the 2 internal drives as one single drive? I have done a little research, and discovered Disk Utility's ability to configure a sort of "Software RAID," but cannot find a good guide as to define how to actually do so. Any ideas?
    Thanks in advance,
    Jordan. Meow!

    OK, you're not going to get much speed out of OSX with only 50 GB to start with, since Leopard does best with 100 GB or 30% Free space, but anyway, boot from the Install Disc...
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    Select one of the drives, click on the RAID tab, Raid type select Concatenated RAID set, drag to two drives on the left to the window on the right, iirc.

  • How do I break up a concatenated disk set?

    After spending the better part of a week trying to shoehorn in two 500Gb SATA drives into my G4, I coming around to the conclusion that the Sonnet Tech PCI to SATA (TSATA) controller firmware, is not up to the challenge of concatenated drives. The OS and all the files loaded on just fine, but the system simply doesn't want to boot from that volume.
    In the short term: I want to separate the drives, to make sure the controller is fully functional i.e. can boot from a single drive.
    Long term: send the (new) drives back to the vender while I am still within the grace period, and buy one large drive.
    The question now is: has anyone separated a raid back into it's constitute pieces before?
    Do I just pull the plug on one and try an erase?

    Tom,
    Yeah, I read that too. I have the model TSATA, 2 port, 1.5Gb/sec, internal.
    I was able to pull one drive and erase it, put a minimal OS on it and boot.
    Now I am trying to find a compatible 750Gb SATA drive, I was going to buy the Seagate until I read there is a problem with the firmware, something about 32mb cache not being recognized and it running dog-slow, also something about nor being able to flash the firmware form a MAC?

  • A question about development of livecylcle forms

    Hello,  I have been asked to build complex static forms for a client of ours using Livecycle Designer version 8.2.  The forms are static (fixed field) forms that will not interact with users in any way.  We will be populating the form fields from a .NET api so there is no need for any kind of validation handling / submit buttons etc.   In that way the forms are relatively simple.
    The problem I am running into is the desired form layout is complex and I am not sure about the most productive way to produce this layout.  The form a need to produce must exactly match the content of the attached file called "TheGoal.pdf".   Unfortunately this comes as some kind of read only image produced from a word template and I am unable to manipulate the layout when I import this into Livecycle designer.  The client wants me to create the form from scratch so they can have full control of the layout if changes are requested in future.
    To get a start on this, I went through the tutorials that come with the product just so I could understand how the forms are built.  I have attached a pdf file called "MyAttempt.pdf" that shows my initial attempts with the first few fields in the desired layout ("TheGoal.pdf").
    I have considered a number of approaches and, the only thing, that sort of works is draw all the boxes using rectangle objects and then dropping the required fields into the rectangles.  [Note: I have tried using tables and nested tables but I appear to be limited by the fact that tables only allow me to have a fixed number of columns and that nested tables always fille the entire cell of the parent table. ]
    The problem I have run into right away is I am finding my current approach very labor intensive.   Any time I want to change anything like resizing a box I have to resize all of the other boxes on the form.   As the form grows in complexity I can see the whole thing becoming a maintenance nightmare.
    In short my question is this:
    What is the best approach for creating complex layouts like this?  As an html developer I have been used to using tables to handle complex layouts in a way that can be changed relatively easily but that approach doesn't appear to work with Adobe LiveCycle designer.
    Any thoughts or insights would be very much appreciated. [Sorry about the long explanation].
    Thanks in advance.

    I justed wanted to say thanks for all of the help.   I think I am getting closer to an agreed approach with the client that might work.
    It looks like they will be fine with me just overlaying the fields on top of the Adobe image for most of the pages just because it will take a long time to create the layout manually for each one.  There is one page that is dynamic in nature because the number of table items on that page can potentially increase to any number - that part I am thinking of handling dynamically.
    Basically there will be a static image for each page except the dynamic one.   When all the fields are populated I will concatenate them all together and handle the page numbers in code.  [I will be using VB code with the apToolkit to handle the form data binding and concatenation of pdf images].
    Its a little messy but we think this effort should be less than trying to create that complicated layout on all of the pages.
    If anybody has any thoughts on that or similar experience I would very much like to hear about it. [The image file is in the original post and it is called "TheGoal.pdf".  Each page on that will be broken down to an individual image and page 2 is the part I will try to handle as separate dynamic form because the items in the "Property" section can increase to any number of items]
    Geoff.

  • Question regarding decode function.

    Hi friends,
    I have a question regarding using decode.
    I'm try'g to explain my problem using emp table.
    Can you guys please help me out.
    For example consider emp table, now i want to get all manager id's concatenated for 2 employees.
    I tried using following code
    declare
    v_mgr_code  number(10);
    v_mgr1      number(4);
    v_mgr2      number(4);
    begin
    select  mgr into    v_mgr1
    from    scott.emp
    where   empno = 7369;
    select  mgr into    v_mgr2
    from    scott.emp
    where   empno = 7499;
    select v_mgr1||'-'||v_mgr2 into v_mgr_code from dual;
    end;now instead of writing 2 select statements can i write one select statement using decode function ?
    Edited by: user642856 on Mar 8, 2009 11:18 PM

    i don't know wheter your looking for this or not.if i am wrong correct me.
    SELECT Ename||' '||initcap('manager is ')||
    DECODE(MGR,
            7566, (SELECT Ename
                    FROM Emp
                    WHERE Empno = 7566),
            7698, (SELECT Ename
                    FROM Emp
                    WHERE Empno = 7698),
            7782, (SELECT Ename
                    FROM Emp
                    WHERE Empno = 7782),
            7788, (SELECT Ename
                    FROM Emp
                    WHERE Empno = 7788),
            7839, (SELECT Ename
                    FROM Emp
                    WHERE Empno = 7839),
            7902, (SELECT Ename
                    FROM Emp
                    WHERE Empno = 7902),
            'Do Not Know')  Manager from empor
    SELECT Ename||' '||initcap('manager is ')||
    DECODE(MGR,
            7566, (SELECT empno
                    FROM Emp
                    WHERE Empno = 7566),
            7698, (SELECT empno
                    FROM Emp
                    WHERE Empno = 7698),
            7782, (SELECT empno
                    FROM Emp
                    WHERE Empno = 7782),
            7788, (SELECT empno
                    FROM Emp
                    WHERE Empno = 7788),
            7839, (SELECT empno
                    FROM Emp
                    WHERE Empno = 7839),
            7902, (SELECT empno
                    FROM Emp
                    WHERE Empno = 7902)) manager
    from empEdited by: user4587979 on Mar 8, 2009 9:52 PM

  • Using Javascript to create concatenated string from checkbox fields to one text field

    Hi. I have a PDF form that I am trying to have output to a spreadsheet that matches my database schema. Here is the dilemna:
    * I have a set of checkboxes for available languages (LANGUAGE_ENGLISH, LANGUAGE_SPANISH, etc.) When they export to spreadsheet, the value is TRUE.
    * I need to take values from checked boxes and create a single string in a text field called LANGUAGE_DISPLAY (so my UI will not need to do the concatenation). If LANGUAGE_ENGLISH is TRUE (checked), append "English, " to LANGUAGE_DISPLAY, else append "". Then, if LANGUAGE_SPANISH is TRUE (checked), append "Spanish, " to LANGUAGE_DISPLAY, else append "". And on and on
    In the LANGUAGE_DISPLAY text field properties, I am inserting a Custom Calculation script to try to achieve this, but am not getting any results. I tried teh following even trying to pull the checkboxes default values and string them together:
    box1 = this.getField("LANGUAGE_ENGLISH").value.toSrting();
    box2 = this.getField("LANGUAGE_FARSI").value.toSrting();
    box3 = this.getField("LANGUAGE_MANDARIN").value.toSrting();
    event.value = box1 + ', ' + box2 + ', ' + box3;
    I also played with this to get the desired strings output...but to no avail:
    if ( LANGUAGE_ENGLISH.rawValue == true )
    box1.rawValue = "English, ";
    if ( LANGUAGE_FARSI.rawValue == true )
    box1.rawValue = "Farsi, ";
    if ( LANGUAGE_HEBREW.rawValue == true )
    box1.rawValue = "Hebrew, ";
    event.value = box1 + box2 + box3;
    Then I tried to simplify to see one field output so used this script...still no results:
    event.value = "";
    var f = this.getField("LANGUAGE_ENGLISH");
    if ( f.isBoxChecked() == true) {
    event.value = "English";
    Couple questions:
    1) Am I on the right track with any of these scripts?
    2) Is there something else I need to do to get the script to run before running the Create Spreadsheet with Data Files comman in Acrobat to get my csv file output? Maybe there needs to be some event to get the checkbox values read by that field in order to calculate/create the string.
    Appreciate any help you can provide.

    LiveCycle Designer has shipped with all Acrobat Professional versions since the "Professional" version was introduced with version 6.
    You do not let us know want results you get in the field or the JavaScript console.
    Using:
    box1 = this.getField("LANGUAGE_ENGLISH").value.toString();
    box2 = this.getField("LANGUAGE_FARSI").value.toString();
    box3 = this.getField("LANGUAGE_MANDARIN").value.toString();
    event.value = box1 + ', ' + box2 + ', ' + box3;
    returns "Off, Off, Off", when no box is checked and returns "Yes" for the appropriate box being checked when the default value is used for the creation of the check box. So if one would make the 'Export Value' of the box from the default value of 'Yes" to the appropriate language, one would get a more desirable result. But for each unchecked box the value would appear as "Off". So one needs to change the 'Off' value to a null string. But one is still left with the separator when there is an unchecked option.
    Using the following document level function:
    // Concatenate 3 strings with separators where needed
    function fillin(s1, s2, s3, sep) {
    Purpose: concatenate up to 3 strings with an optional separator
    inputs:
    s1: required input string text or empty string
    s2: required input string text or empty string
    s3: required input string text or empty string
    sep: optional separator sting
    returns:
    sResult concatenated string
    // variable to determine how to concatenate the strings
    var test = 0; // all strings null
    var sResult; // re slut string to return
    // force any number string to a character string for input variables
    s1 = s1.toString();
    s2 = s2.toString();
    s3 = s3.toString();
    if(sep.toString() == undefined) sep = ''; // if sep is undefined force to null
    assign a binary value for each string present
    so the computed value of the strings will indicate which strings are present
    when converted to a binary value
    if (s1 != "") test += 1; // string 1 present add binary value: 001
    if (s2 != "") test += 2; // string 2 present add binary value: 010
    if (s3 != "") test += 4; // string 3 present add binary value: 100
    /* return appropriate string combination based on
    calculated test value as a binary value
    switch (test.toString(2)) {
    case "0": // no non-empty strings passed - binary 0
    sResult = "";
    break;
    case "1": // only string 1 present - binary 1
    sResult = s1;
    break;
    case "10": // only string 2 present - binary 10
    sResult = s2;
    break;
    case "11": // string 1 and 2 present - binary 10 + 1
    sResult = s1 + sep + s2;
    break;
    case "100": // only string 3 present - binary 100
    sResult = s3;
    break;
    case "101": // string 1 and 3 - binary 100 + 001
    sResult = s1 + sep + s3;
    break;
    case "110": // string 2 and 3 - binary 100 + 010
    sResult = s2 + sep + s3;
    break;
    case "111": // all 3 strings - binary 100 + 010 + 001
    sResult = s1 + sep + s2 + sep + s3;
    break;
    default: // any missed combinations
    sResult = "";
    break;
    return sResult;
    And the following cleaned up custom calculation script:
    box1 = this.getField("LANGUAGE_ENGLISH").value;
    box2 = this.getField("LANGUAGE_FARSI").value;
    box3 = this.getField("LANGUAGE_MANDARIN").value;
    if (box1 == 'Off') box1 = '';
    if (box2 == 'Off') box2 = '';
    if (box3 == 'Off') box3 = '';
    event.value = fillin(box1, box2, box3, ', ');
    One will get the list of languages with the optional separator for 2 or more language selections.

  • The data from my web page insert in SQL table as question marks

    I use Farsi language in my web page for inserting customer data. The data that is inserted in webpage and submitted, showed as ???? in SQL table. A lot of developers say that I should use N' before the Unicode character, but I don't know how I can use it
    in my code. I attached the code. Can someone say me where I should insert the N in my code?
    protected void cmdInsert_Click(object sender, EventArgs e)
    //Checking the validation of required fields
    if (cboCustomerType.Text == "" || cboTitle.Text == "" || SearchableName.Text == "" ||
    FinalName.Text == "" || NationalID.Text == "" || BusinessID.Text == "" || MobilePhone.Text == "")
    lblStatus.Text = "لطفا فیلدهای اجباری را حتما پر کنید";
    return;
    //define ADO.NET objects.
    string insertSQL;
    insertSQL = "INSERT INTO Customers(";
    insertSQL += "CustomerType,CustomerTitle,CustomerFirstName,CustomerLastName,CompanyType,";
    insertSQL += "CompanyName,SearchableName,FinalName,NationalCode,BusinessID,City,Address,PostalCode,";
    insertSQL += "Zone,MobileNumber,WorkPhone1,WorkPhone2,HomePhone,FaxNumber,Email,Website,Note)";
    insertSQL += "VALUES('";
    insertSQL += cboCustomerType.Text + "','";
    insertSQL += cboTitle.Text + "','";
    insertSQL += CustomerFirstName.Text + "','";
    insertSQL += CustomerLastName.Text + "','";
    insertSQL += cboCompanyType.Text + "','";
    insertSQL += CompanyName.Text + "','";
    insertSQL += SearchableName.Text + "','";
    insertSQL += FinalName.Text + "','";
    insertSQL += NationalID.Text + "','";
    insertSQL += BusinessID.Text + "','";
    insertSQL += City.Text + "','";
    insertSQL += Address.Text + "','";
    insertSQL += PostalCode.Text + "','";
    insertSQL += Zone.Text + "','";
    insertSQL += MobilePhone.Text + "','";
    insertSQL += Phone1.Text + "','";
    insertSQL += Phone2.Text + "','";
    insertSQL += HomePhone.Text + "','";
    insertSQL += FaxNumber.Text + "','";
    insertSQL += Email.Text + "','";
    insertSQL += Website.Text + "','";
    insertSQL += Note.Text + "')";
    SqlConnection con = new SqlConnection(connectionString);
    SqlCommand cmd = new SqlCommand(insertSQL, con);
    //try to open the database and execute the insert
    int added = 0;
    try
    con.Open();
    added = cmd.ExecuteNonQuery();
    lblStatus.Text = added.ToString() + "اضافه شد";
    catch (Exception err)
    lblStatus.Text = "Error inserting record.";
    lblStatus.Text += err.Message;
    finally
    con.Close();
    //If the insert succeed, refresh the customer list.
    if (added > 0)
    FillCustomerList();
    Regards,

    Because you're composing the SQL statement with string concatenation, you would put the "N" before the single quote,
    VALUES(N'";
                insertSQL += cboCustomerType.Text + "',N'";
                insertSQL += cboTitle.Text + "',N'"; // ...etc
    However, composing SQL statements with string concatenation is not a suggested practice because it's open to SQL injection (see:
    https://technet.microsoft.com/en-us/library/ms161953(v=sql.105).aspx). A safer way to do this is to use command parameters to represent the values (see SqlCommand.Parameters
    property). If you use parameters, you can specify parameter data type as SqlDbType.NVarchar, which will ensure your text values are passed in as Unicode. Also ensure that the columns in question are defined in the database table definition as Unicode (NVARCHAR
    rather than VARCHAR).
    Hope this helps, Bob

  • Parent child table question

    HI i have some questions which iam unclear please help me
    1) in a parent child relationship.. is it always 1-m relation from parent to child?
    2) can a parent table be on many side? i.e can a child - parent be 1- m?
    3) if i itake employee as child table and department as parent table then dept_id will be the foreigh key in employee table ...
    Now if i want to add a new employee who is not assigned to any department can i add it ?
    4) In an identifying relationship ... a child table has concatenated primary key (pk of child,pk of parent)
    should we still add any other primary key to the table....in addition to this concatenated key?
    thanks in advance
    raj

    Hi!
    1) in a parent child relationship.. is it always 1-m relation from parent to child?
    yes unless you create a unique index on the foreign key column
    2) can a parent table be on many side? i.e can a child - parent be 1- m?
    no, if you need an n-m you will need an intersection table
    e.g. employees - emp_dept - departments
    in this case the emp_dept table would contain the foreign keys of employees and departments
    3) if i itake employee as child table and department as parent table then dept_id will be the foreigh key in employee table ...
    Now if i want to add a new employee who is not assigned to any department can i add it ?
    no, you will have to insert the master first
    Best regards,
    PP

Maybe you are looking for