IR group by function and timestamp datatype

Is there any limitations on the group by function e.g. based on the datatype.
My problem\misunderstanding is with the IR:
USING "GROUP BY"-
I have a TIMESTAMP column (columnname TM_TIME) and I can schose it in the group by clause but not in the function section. Is there any reason why and could I get it to work.
regards
Thorsten
Edited by: Fischert on 02.05.2012 03:05

It really depends on the granularity that you need from the timestamp to make it meaningful. The key word is aggregation. So you should ask what level of aggregation do I need?
You can reduce the granularity from the fractional seconds to some lower level of granularity like seconds, minute, hours or even date (equivalent of trunc(date_column) using CAST or Truncating or to_date(to_char(...)) with appropriate format mask.
It just depends on the application and data.
E.g. for the LHC at CERN chasing the Higgins, timestamp is just not fine grained enough (you need 10 exp -23 or lower I guess !)
E.g. if you look at seismic data for oil exploration a hell of a lot happens in 5th and 6th decimal places in the timestamp.
But if you are looking at data logged by a normal SCADA system then maybe a second is detailed enough for the purpose.
In normal business application we are better off "rounding" the timestamp to some meaningful level for aggregation/ reporting.
Regards,

Similar Messages

  • In my opinion, I think the rolling function of Muse need to add the group status function and group!

    In my opinion,
    I think the rolling function of Muse need to add the group status function and group!
    Because when the processing of many things, but the effect is the same,
    but to repeat many times, it is necessary to group similar function of PS.

    I learned how to install the 9.1.3 upgrade by renaming my app, and that works fine. Logic is now recognized in About My Mac as a 64 bit app, which is where I started. Thanks for your help.
    Now I have to figure out how to get my Novation to work through Automap in some way that I can finally get mixer functions. I'll repost the second part of this if I'm still having a headscratcher about it tomorrow.

  • I just tried the 'group tabs' function but when I close a window and open a new one, the last page I viewed opens every single time. I can't remove or ignore the group tabs function and it automatically opens with it. How can I stop this?

    Before I attempted using the 'groups tab' function for the first time, there was no icon (unlike currently). There is now the icon with for the function yet I am unable to remove it or its function.

    Try a clean reinstall and delete the Firefox program folder and desktop shortcut before (re)installing a fresh copy of the current Firefox release.
    Download a fresh Firefox copy and save the file to the desktop.
    *Firefox 23.0: http://www.mozilla.org/en-US/firefox/all.html
    Uninstall your current Firefox version, if possible, to cleanup the Windows registry and settings in security software.
    *Do NOT remove personal data when you uninstall your current Firefox version, because all profile folders will be removed and you lose personal data like bookmarks and passwords from profiles of other Firefox versions.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    *(32 bit Windows) "C:\Program Files\Mozilla Firefox\"
    *(64 bit Windows) "C:\Program Files (x86)\Mozilla Firefox\"
    *It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    *http://kb.mozillazine.org/Uninstalling_Firefox
    Your bookmarks and other personal data are stored in the Firefox profile folder and won't be affected by an uninstall and (re)install, but make sure that "remove personal data" is NOT selected when you uninstall Firefox.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • Webi  - How to use group by function and to make data distinct in that column

    Hi Everyone
    I'm a begginer in BO and i'm experiencing problems when trying to create a webi report that shows different courses, how many males and females in a course, their race and how many people attended each course. My challenge comes in wen i try to group by distinct courses:
    For Example
    Course name     Gender     Race         Attendees 
    BEXX11             Female     Coloured    2
    BEXX11             Male         African      1
    C3                    Male         Indian        2
    F3                    Female      White       1
    BEXX11            Female      Indian        3
    C3                   Female      Indian        4
    Course name     Gender     Race         Attendees
    BEXX11             Female     Coloured    2
                            Male         African       1
                            Female      Indian        3
    C3                    Male         Indian         2
                            Female     Indian         4
    F3                    Female      White       1
    Thanks in advance

    Hi Olebogeng Marumo,
    Apply the break on Course Name and then check the output.It will fulfill your requirement.
    Web Intelligence 4.0: Create breaks between groups of data
    Regards,
    Anish

  • Confusion in group by function

    Hi,
    I always have a doubt regarding the group by function i.e. if we are using a group by function and we want to display some columns which are not to be grouped by then how do we display those.
    Like for eg.
    to display last name, department no and average of salary for each department how should we proceed.
    I know we can display the department no, and avg(sal) but how abt the last name.
    Do we use a subquery?
    Any thoughts or explanaitions with example?
    Thanks

    hi, People often get confused with group by function.
    You have to be very clear about this that the group by must include all the columns that have been selected. If you want to use another column out of group by list then that column must be driven by the another table join or inline table join.
    bye

  • Confusion in group by function- Any thoughts?

    Hi,
    I always have a doubt regarding the group by function i.e. if we are using a group by function and we want to display some columns which are not to be grouped by then how do we display those.
    Like for eg.
    to display last name, department no and average of salary for each department how should we proceed.
    I know we can display the department no, and avg(sal) but how abt the last name.
    Do we use a subquery?
    Any thoughts or explanaitions with example?
    Thanks

    While the analytic functions already suggested are likely more efficient for y our example, there are cases where they may not be. An alternative formulation without analytics would be something like:
    SQL> SELECT s.department_id, e.last_name, s.average
      2  FROM (SELECT department_id, AVG(salary) average
      3        FROM employees
      4        GROUP BY department_id) s, employees e
      5  WHERE s.department_id = e.department_id
      6  ORDER BY s.department_id;
    DEPARTMENT_ID LAST_NAME                    AVERAGE
               10 Whalen                          4400
               20 Hartstein                       9500
               20 Fay                             9500
               30 Raphaely                        4150
               30 Tobias                          4150
               30 Colmenares                      4150
               30 Himuro                          4150
               30 Baida                           4150
               30 Khoo                            4150
               40 Mavris                          6500
               50 Taylor                    3475.55556
               50 Fleaur                    3475.55556
               50 Sullivan                  3475.55556
               50 Geoni                     3475.55556
               50 Cabrio                    3475.55556HTH
    John

  • How do we search by partner function and authorization group?

    1. In CRM Web UI, we are not able to search by "partner function" and by "auth group."
    2.  When viewing the Account, we can see the "Contact Person" and the "Function" tab is visible but we cannot see the "Partner Function"

    Hi Vishal,
    Can you please help me look Partner Function and Relationship type search capability in WebUi
    you mentioned that partner function search is standard functionality.
    Thanks
    Amish

  • Creating a  query with group function and non group function

    Could anyone help me with creating a query that contain single row function and multiple row function in Report6i.
    what i want to do basically is to create a query that will display sum of certain columns according to a column in that table

    You can either calculate a sum yourself, or let Reports do it for you.
    1. select sum(column) from table where ....
    This will just display the sum, not the records.
    2. Make a query: select column from table where ...
    Create a summary field. You can do it manually or with the report wizard.
    That will create a report like this:
       Column
           10
           20
           15
       ======
    Sum    45                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to obtain a number of seconds between 2 fields in TimeStamp datatypa

    Hello, I need to have the result of a difference between 2 fields (date1 - date2)which are in TimeStamp datatype
    The result given must be in seconds
    I am using owb 10.2.1.0.31
    Can so help me ?
    Thanks

    check the Puget Sound Oracle Users Group page (http://www.psoug.org/) at
    http://www.psoug.org/reference/timestamp.html
    And more information on the INTERVAL DAY TO SECOND datatype at
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#SQLRF00207
    here's an excerpt from the PSOUG page:
    CREATE TABLE tint_test (
    msg VARCHAR2(25),
    start_date TIMESTAMP WITH TIME ZONE,
    end_date TIMESTAMP WITH TIME ZONE,
    duration_1 INTERVAL DAY(5) TO SECOND,
    duration_2 INTERVAL YEAR TO MONTH);
    INSERT INTO tint_test
    (msg, start_date, end_date)
    VALUES
    ('my plane ride',
    timestamp'2004-08-08 17:02:32.212 US/Eastern',
    timestamp'2004-08-08 19:10:12.235 US/Pacific');
    UPDATE tint_test
    SET duration_1 = (end_date - start_date) DAY(5) TO SECOND,
    duration_2 = (end_date - start_date) YEAR TO MONTH;
    SELECT msg, duration_1, duration_2 FROM tint_test;
    SELECT t.*, end_date - start_date FROM tint_test t;

  • Conversion from DATE to TIMESTAMP datatype

    Hello,
    My issue is as follows:
    1. I have one variable of type DATE, which I assign the value of SYSDATE
    mydatevar DATE:= SYSDATE;2. I want to find *"today"*, truncated to DAY
      TRUNC (mydatevar, 'DD')
    TRUNC function returns DATE datatype. So I will receive in point 2 for example *'2010-01-13 00:00:00'*.
    3. I want to assign the value from point 2 to a variable of type TIMESTAMP
      mytimestampvar TIMESTAMP := mydatevar;which implicitly will convert the DATE variable to TIMESTAMP.
    Problem: During the conversion (both implicit and explicit conversion with a format mask) I lose the "00" hours and "00" minutes and receive something like this: "10-JAN-13 *12*.00.00.000000000 AM".
    Question: How can I convert from DATE to TIMESTAMP keeping hours and minutes zeros?
    Why I need this conversion: I have a table with a column "column1" TIMESTAMP(0) and I would like to take only those rows from the table, where "column1" is in range from today 12 o'clock in the morning till now (whatever hour it is).
    NLS characteristics of the database:
    PARAMETER                           VALUE
    NLS_LANGUAGE                           AMERICAN
    NLS_TERRITORY                   AMERICA
    NLS_CURRENCY     $
    NLS_ISO_CURRENCY                    AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CHARACTERSET                    AL32UTF8
    NLS_CALENDAR                            GREGORIAN
    NLS_DATE_FORMAT                    DD-MON-RR
    NLS_DATE_LANGUAGE            AMERICAN
    NLS_SORT     BINARY
    NLS_TIME_FORMAT                     HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT             DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY              $
    NLS_COMP                             BINARY
    NLS_LENGTH_SEMANTICS               BYTE
    NLS_NCHAR_CONV_EXCP             FALSE
    NLS_NCHAR_CHARACTERSET     AL16UTF16
    NLS_RDBMS_VERSION             10.2.0.4.0Session parameters are the same.
    DBTIMEZONE is "+02:00".

    Verdi wrote:
    Problem: During the conversion (both implicit and explicit conversion with a format mask) I lose the "00" hours and "00" minutes and receive something like this: "10-JAN-13 *12*.00.00.000000000 AM".I don't think you are necessarily losing any information whatsoever. It's probably more of a function of your NLS_TIMESTAMP_FORMAT and NLS_DATE_FORMAT. For example your NLS_DATE_FORMAT could be setup by default for a HH24 (24 hour time) which would report midnight as "00" hours. However, it looks like your NLS_TIMESTAMP_FORMAT is setup with a "HH" format with a meridian indicator which means 12 hours time.
    Your comparisons should be using date/timestamp data types anyways so as long as the input value is converted properly into a date type this shouldn't matter anyways.
    You can see what is actually stored by using the DUMP function:
    SQL> SELECT  DUMP(TO_TIMESTAMP(TO_CHAR(TRUNC(SYSDATE,'DD'),'MM/DD/YYYY HH:MI:SS AM'))) AS TSTAMP
      2  ,       DUMP(TRUNC(SYSDATE,'DD')) AS DT
      3  FROM DUAL
      4  /
    TSTAMP                                                                      DT
    Typ=187 Len=20: 218,7,1,13,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0                  Typ=13 Len=8: 218,7,1,13,0,0,0,0As you can see the TSTAMP and DT store nearly the same values (218,7,1,13), but the TSTAMP has more precision because of fractional seconds.
    HTH!
    Edited by: Centinul on Jan 13, 2010 7:23 AM

  • Overloading a DATE function with TIMESTAMP to avoid "too many declarations"

    CREATE OR REPLACE PACKAGE util
    AS
      FUNCTION yn (bool IN BOOLEAN)
        RETURN CHAR;
      FUNCTION is_same(a varchar2, b varchar2)
        RETURN BOOLEAN;
      FUNCTION is_same(a date, b date)
        RETURN BOOLEAN;
      /* Oracle's documentation says that you cannot overload subprograms
       * that have the same type family for the arguments.  But,
       * apparently timestamp and date are in different type families,
       * even though Oracle's documentation says they are in the same one.
       * If we don't create a specific overloaded function for timestamp,
       * and for timestamp with time zone, we get "too many declarations
       * of is_same match" when we try to call is_same for timestamps.
      FUNCTION is_same(a timestamp, b timestamp)
        RETURN BOOLEAN;
      FUNCTION is_same(a timestamp with time zone, b timestamp with time zone)
        RETURN BOOLEAN;
      /* These two do indeed cause problems, although there are no errors when we compile the package.  Why no errors here? */
      FUNCTION is_same(a integer, b integer) return boolean;
      FUNCTION is_same(a real, b real) return boolean;
    END util;
    CREATE OR REPLACE PACKAGE BODY util
    AS
         NAME: yn
         PURPOSE: pass in a boolean, get back a Y or N
      FUNCTION yn (bool IN BOOLEAN)
        RETURN CHAR
      IS
      BEGIN
        IF bool
        THEN
          RETURN 'Y';
        END IF;
        RETURN 'N';
      END yn;
         NAME: is_same
         PURPOSE: pass in two values, get back a boolean indicating whether they are
                  the same.  Two nulls = true with this function.
      FUNCTION is_same(a in varchar2, b in varchar2)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in date, b in date)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in timestamp, b in timestamp)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      FUNCTION is_same(a in timestamp with time zone, b in timestamp with time zone)
        RETURN BOOLEAN
      IS
        bool boolean := false;
      BEGIN
        IF a IS NULL and b IS NULL THEN bool := true;
        -- explicitly set this to false if exactly one arg is null
        ELSIF a is NULL or b IS NULL then bool := false;
        ELSE bool := a = b;
        END IF;
        RETURN bool;
      END is_same;
      /* Don't bother to fully implement these two, as they'll just cause errors at run time anyway */
      FUNCTION is_same(a integer, b integer) return boolean is begin return false; end;
      FUNCTION is_same(a real, b real) return boolean is begin return false; end;
    END util;
    declare
    d1 date := timestamp '2011-02-15 13:14:15';
    d2 date;
    t timestamp := timestamp '2011-02-15 13:14:15';
    t2 timestamp;
    a varchar2(10);
    n real := 1;
    n2 real;
    begin
    dbms_output.put_line('dates');
    dbms_output.put_line(util.yn(util.is_same(d2,d2) ));
    dbms_output.put_line(util.yn(util.is_same(d1,d2) ));
    dbms_output.put_line('timestamps'); -- why don't these throw exception?
    dbms_output.put_line(util.yn(util.is_same(t2,t2) ));
    dbms_output.put_line(util.yn(util.is_same(t,t2) ));
    dbms_output.put_line('varchars');
    dbms_output.put_line(util.yn(util.is_same(a,a)));
    dbms_output.put_line(util.yn(util.is_same(a,'a')));
    dbms_output.put_line('numbers');
    -- dbms_output.put_line(util.yn(util.is_same(n,n2))); -- this would throw an exception
    end;
    /Originally, I had just the one function with VARCHAR2 arguments. This failed to work properly because when dates were passed in, the automatic conversion to VARCHAR2 was dropping the timestamp. So, I added a 2nd function with DATE arguments. Then I started getting "too many declarations of is_same exist" error when passing TIMESTAMPs. This made no sense to me, so even though Oracle's documentation says you cannot do it, I created a 3rd version of the function, to handle TIMESTAMPS explicitly. Surprisingly, it works fine. But then I noticed it didn't work with TIMESTAMP with TIME ZONEs. Hence, the fourth version of the function. Oracle's docs say that if your arguments are of the same type family, you cannot create an overloaded function, but as the example above shows, this is very wrong.
    Lastly, just for grins, I created the two number functions, one with NUMBER, the other with REAL, and even these are allowed - they compile. But then at run time, it fails. I'm really confused.
    Here is the apparently incorrect Oracle documentation on the matter: http://docs.oracle.com/cd/B12037_01/appdev.101/b10807/08_subs.htm (see overloading subprogram names), and here are the various types and their families: http://docs.oracle.com/cd/E11882_01/appdev.112/e17126/predefined.htm.
    Edited by: hotwater on Jan 9, 2013 3:38 PM
    Edited by: hotwater on Jan 9, 2013 3:46 PM

    >
    So, I added a 2nd function with DATE arguments. Then I started getting "too many declarations of is_same exist" error when passing TIMESTAMPs. This made no sense to me
    >
    That is because when you pass a TIMESTAMP Oracle cannot determine whether to implicitly convert it to VARCHAR2 and use your first function or implicitly convert it to DATE and use your second function. Hence the 'too many declarations' exist error.
    >
    , so even though Oracle's documentation says you cannot do it, I created a 3rd version of the function, to handle TIMESTAMPS explicitly. Surprisingly, it works fine. But then I noticed it didn't work with TIMESTAMP with TIME ZONEs.
    >
    Possibly because of another 'too many declarations' error? Because now there would be THREE possible implicit conversions that could be done.
    >
    Hence, the fourth version of the function. Oracle's docs say that if your arguments are of the same type family, you cannot create an overloaded function, but as the example above shows, this is very wrong.
    >
    I think the documentation, for the 'date' family, is wrong as you suggest. For INTEGER and REAL the issue is that those are ANSI data types and are really the same Oracle datatype; they are more like 'aliases' than different datatypes.
    See the SQL Language doc
    >
    ANSI, DB2, and SQL/DS Datatypes
    SQL statements that create tables and clusters can also use ANSI datatypes and datatypes from the IBM products SQL/DS and DB2. Oracle recognizes the ANSI or IBM datatype name that differs from the Oracle Database datatype name. It converts the datatype to the equivalent Oracle datatype, records the Oracle datatype as the name of the column datatype, and stores the column data in the Oracle datatype based on the conversions shown in the tables that follow.
    INTEGER
    INT
    SMALLINT
    NUMBER(38)
    FLOAT (Note b)
    DOUBLE PRECISION (Note c)
    REAL (Note d)
    FLOAT(126)
    FLOAT(126)
    FLOAT(63)

  • Timestamp datatype issue in Expression

    Hi
    I am extracting data from oracle table which timestamp datatype for one column then connected to Expression operator. When i see the data type of timestamp in sourcetable it is timestamp(3), But when i see the data type of timestamp in Expression operator it says timestamp(3) but it is adding 6 in the precision by default and that cannot be changed. I tried creating new column in expression it behaved the same. there by my mapping is giving me the warnings regarding this.
    Could you guys please help on this.
    Thanks

    Hi Cezar,
    Thanks for your quick reply.
    I am currently doing the second step you have mentioned. I even went to the extent of cutomizing the I$ tables getting created with a custom structure to avoid this. But this is very tedious as i have hundreds of columns in the table.
    Is this a bug in ODI? I am asking this because this is a general functionality and should be ideally covered by such a good ELT tool.
    I have raised a SR for the same, let us see what solution they have in store:)
    Anyway thanks for your valuable suggestion its really useful.
    But I have a doubt regarding the versions. Whats the difference between versions 10.1.3.2.0 which I am using and 10.1.3.4.0? I hope this version is not creating this issue?
    Thanks,
    Vikram

  • Problem in execution of a function having clob datatype

    [http://www.orafaq.com/forum/t/128331/98870/]
    Hi,
    I had a Problem in executing a function having clob datatype.
    Here below is my function.
    create or replace type split_obj as object
        occurence_id number(10,0),
        splitvalue varchar2(1000)
    create or replace type split_rec as table of split_obj;
    create or replace FUNCTION Split_new1(
                                           p_string IN clob,
                                           p_delimiter IN VARCHAR2
                                         )  return split_rec  pipelined  is
        v_length NUMBER := dbms_lob.getlength(p_string);
          v_start NUMBER := 1;
         v_index NUMBER;
          V_temp NUMBER(10,0):=0;
       begin
    WHILE(v_start <= v_length)
        LOOP
          v_index := dbms_lob.INSTR(p_string, p_delimiter, v_start);
           IF v_index = 0 THEN
             V_temp:=V_temp+1;
             PIPE ROW(split_obj(v_temp,dbms_lob.SUBSTR(p_string, v_length,v_start)));
             v_start := v_length + 1;
           ELSE
             v_temp:=v_temp+1;  
             PIPE ROW(split_obj(v_temp,dbms_lob.SUBSTR(p_string, v_index - v_start,v_start)));
             v_start := v_index + 1;
           END IF;
         END LOOP;
        return;
       end Split_new1;Here attached link contains the procedure trying to execute the function with huge string more than 400kb.
    Could you pls let me know how to do the same in sqlplus and toad.
    Thanks in advance.
    Edited by: user512743 on Nov 27, 2008 4:31 AM

    BluShadow wrote:
    The problem is that in your execution of this you are trying to assign a value to the clob variable using
    v_clob := '<string>'
    where the string is greater than allowed in PL/SQL.
    Whilst the CLOB itself can hold more data, the string is actually the equivalent of a VARCHAR2 so cannot exceed VARCHAR2 limits.
    You should use the DBMS_LOB package to append data to your CLOB in chunks of no more than 32767 characters at a time.??? PL/SQL provides full CLOB support. There is no need to use DBMS_LOB (although you could). OP's function has logic errors. Anyway:
    SQL> create or replace type split_obj as object
      2    (
      3      occurence_id number(10,0),
      4      splitvalue varchar2(1000)
      5    );
      6  /
    Type created.
    SQL> create or replace type split_rec as table of split_obj;
      2  /
    Type created.
    SQL> create or replace
      2    FUNCTION Split_new1(
      3                        p_string IN clob,
      4                        p_delimiter IN VARCHAR2
      5                       )
      6      return split_rec  pipelined
      7      is
      8          v_length NUMBER := length(p_string);
      9          v_start  NUMBER := 1;
    10          v_end    NUMBER;
    11          V_id     NUMBER :=0;
    12          v_clob   CLOB   := p_string || p_delimiter;
    13      begin
    14          while(v_start <= v_length) loop
    15            v_end := instr(v_clob, p_delimiter, v_start);
    16            v_id  := v_id + 1;
    17            pipe row(split_obj(v_id,substr(p_string,v_start,v_end - v_start)));
    18            v_start := v_end + length(p_delimiter);
    19          end loop;
    20          return;
    21  end Split_new1;
    22  /
    Function created.
    SQL> create table test_table(x clob)
      2  /
    Table created.
    SQL> declare
      2      c clob;
      3  begin
      4      for i in 1..26 loop
      5        c := c || lpad(chr(ascii('a') + i - 1),1000,chr(ascii('a') + i - 1)) || ',';
      6      end loop;
      7      for i in 1..26 loop
      8        c := c || lpad(chr(ascii('A') + i - 1),1000,chr(ascii('A') + i - 1)) || ',';
      9      end loop;
    10      for i in 1..26 loop
    11        c := c || lpad(chr(ascii('a') + i - 1),1000,chr(ascii('a') + i - 1)) || ',';
    12      end loop;
    13      for i in 1..26 loop
    14        if i > 1 then c := c || ','; end if;
    15        c := c || lpad(chr(ascii('A') + i - 1),1000,chr(ascii('A') + i - 1));
    16      end loop;
    17      insert into test_table
    18        values(c);
    19  end;
    20  /
    PL/SQL procedure successfully completed.
    SQL> select  length(x)
      2    from  test_table
      3  /
    LENGTH(X)
        104103
    SQL> select  t.occurence_id,
      2          length(splitvalue) len,
      3          substr(splitvalue,1,20) first_20
      4    from  test_table,
      5          table(Split_new1(x,',')) t
      6  /
    OCCURENCE_ID        LEN FIRST_20
               1       1000 aaaaaaaaaaaaaaaaaaaa
               2       1000 bbbbbbbbbbbbbbbbbbbb
               3       1000 cccccccccccccccccccc
               4       1000 dddddddddddddddddddd
               5       1000 eeeeeeeeeeeeeeeeeeee
               6       1000 ffffffffffffffffffff
               7       1000 gggggggggggggggggggg
               8       1000 hhhhhhhhhhhhhhhhhhhh
               9       1000 iiiiiiiiiiiiiiiiiiii
              10       1000 jjjjjjjjjjjjjjjjjjjj
              11       1000 kkkkkkkkkkkkkkkkkkkk
    OCCURENCE_ID        LEN FIRST_20
              12       1000 llllllllllllllllllll
              13       1000 mmmmmmmmmmmmmmmmmmmm
              14       1000 nnnnnnnnnnnnnnnnnnnn
              15       1000 oooooooooooooooooooo
              16       1000 pppppppppppppppppppp
              17       1000 qqqqqqqqqqqqqqqqqqqq
              18       1000 rrrrrrrrrrrrrrrrrrrr
              19       1000 ssssssssssssssssssss
              20       1000 tttttttttttttttttttt
              21       1000 uuuuuuuuuuuuuuuuuuuu
              22       1000 vvvvvvvvvvvvvvvvvvvv
    OCCURENCE_ID        LEN FIRST_20
              23       1000 wwwwwwwwwwwwwwwwwwww
              24       1000 xxxxxxxxxxxxxxxxxxxx
              25       1000 yyyyyyyyyyyyyyyyyyyy
              26       1000 zzzzzzzzzzzzzzzzzzzz
              27       1000 AAAAAAAAAAAAAAAAAAAA
              28       1000 BBBBBBBBBBBBBBBBBBBB
              29       1000 CCCCCCCCCCCCCCCCCCCC
              30       1000 DDDDDDDDDDDDDDDDDDDD
              31       1000 EEEEEEEEEEEEEEEEEEEE
              32       1000 FFFFFFFFFFFFFFFFFFFF
              33       1000 GGGGGGGGGGGGGGGGGGGG
    OCCURENCE_ID        LEN FIRST_20
              34       1000 HHHHHHHHHHHHHHHHHHHH
              35       1000 IIIIIIIIIIIIIIIIIIII
              36       1000 JJJJJJJJJJJJJJJJJJJJ
              37       1000 KKKKKKKKKKKKKKKKKKKK
              38       1000 LLLLLLLLLLLLLLLLLLLL
              39       1000 MMMMMMMMMMMMMMMMMMMM
              40       1000 NNNNNNNNNNNNNNNNNNNN
              41       1000 OOOOOOOOOOOOOOOOOOOO
              42       1000 PPPPPPPPPPPPPPPPPPPP
              43       1000 QQQQQQQQQQQQQQQQQQQQ
              44       1000 RRRRRRRRRRRRRRRRRRRR
    OCCURENCE_ID        LEN FIRST_20
              45       1000 SSSSSSSSSSSSSSSSSSSS
              46       1000 TTTTTTTTTTTTTTTTTTTT
              47       1000 UUUUUUUUUUUUUUUUUUUU
              48       1000 VVVVVVVVVVVVVVVVVVVV
              49       1000 WWWWWWWWWWWWWWWWWWWW
              50       1000 XXXXXXXXXXXXXXXXXXXX
              51       1000 YYYYYYYYYYYYYYYYYYYY
              52       1000 ZZZZZZZZZZZZZZZZZZZZ
              53       1000 aaaaaaaaaaaaaaaaaaaa
              54       1000 bbbbbbbbbbbbbbbbbbbb
              55       1000 cccccccccccccccccccc
    OCCURENCE_ID        LEN FIRST_20
              56       1000 dddddddddddddddddddd
              57       1000 eeeeeeeeeeeeeeeeeeee
              58       1000 ffffffffffffffffffff
              59       1000 gggggggggggggggggggg
              60       1000 hhhhhhhhhhhhhhhhhhhh
              61       1000 iiiiiiiiiiiiiiiiiiii
              62       1000 jjjjjjjjjjjjjjjjjjjj
              63       1000 kkkkkkkkkkkkkkkkkkkk
              64       1000 llllllllllllllllllll
              65       1000 mmmmmmmmmmmmmmmmmmmm
              66       1000 nnnnnnnnnnnnnnnnnnnn
    OCCURENCE_ID        LEN FIRST_20
              67       1000 oooooooooooooooooooo
              68       1000 pppppppppppppppppppp
              69       1000 qqqqqqqqqqqqqqqqqqqq
              70       1000 rrrrrrrrrrrrrrrrrrrr
              71       1000 ssssssssssssssssssss
              72       1000 tttttttttttttttttttt
              73       1000 uuuuuuuuuuuuuuuuuuuu
              74       1000 vvvvvvvvvvvvvvvvvvvv
              75       1000 wwwwwwwwwwwwwwwwwwww
              76       1000 xxxxxxxxxxxxxxxxxxxx
              77       1000 yyyyyyyyyyyyyyyyyyyy
    OCCURENCE_ID        LEN FIRST_20
              78       1000 zzzzzzzzzzzzzzzzzzzz
              79       1000 AAAAAAAAAAAAAAAAAAAA
              80       1000 BBBBBBBBBBBBBBBBBBBB
              81       1000 CCCCCCCCCCCCCCCCCCCC
              82       1000 DDDDDDDDDDDDDDDDDDDD
              83       1000 EEEEEEEEEEEEEEEEEEEE
              84       1000 FFFFFFFFFFFFFFFFFFFF
              85       1000 GGGGGGGGGGGGGGGGGGGG
              86       1000 HHHHHHHHHHHHHHHHHHHH
              87       1000 IIIIIIIIIIIIIIIIIIII
              88       1000 JJJJJJJJJJJJJJJJJJJJ
    OCCURENCE_ID        LEN FIRST_20
              89       1000 KKKKKKKKKKKKKKKKKKKK
              90       1000 LLLLLLLLLLLLLLLLLLLL
              91       1000 MMMMMMMMMMMMMMMMMMMM
              92       1000 NNNNNNNNNNNNNNNNNNNN
              93       1000 OOOOOOOOOOOOOOOOOOOO
              94       1000 PPPPPPPPPPPPPPPPPPPP
              95       1000 QQQQQQQQQQQQQQQQQQQQ
              96       1000 RRRRRRRRRRRRRRRRRRRR
              97       1000 SSSSSSSSSSSSSSSSSSSS
              98       1000 TTTTTTTTTTTTTTTTTTTT
              99       1000 UUUUUUUUUUUUUUUUUUUU
    OCCURENCE_ID        LEN FIRST_20
             100       1000 VVVVVVVVVVVVVVVVVVVV
             101       1000 WWWWWWWWWWWWWWWWWWWW
             102       1000 XXXXXXXXXXXXXXXXXXXX
             103       1000 YYYYYYYYYYYYYYYYYYYY
             104       1000 ZZZZZZZZZZZZZZZZZZZZ
    104 rows selected.
    SQL> As you can see, function works OK without DBMS_LOB on CLOB of 104103 bytes.
    SY.

  • Few questions about sql2008 functions and commands

    hello,
    I am learning sql2008 implementation and maintenance,I am just 2 weeks bussy.there is some questions in my mind wich I can't answer it.
    1-when I can use  USE MASTER statement
    2-can a database for example (test) have many and unlimmited file groups?
    3-what is the diferrence between file and filegroup! is the term of file means  tables in filegroup?
    4-with boundary points does mean the data type when creating partition function!
    5`what is diferrence between full text index and index,where you have to use the index and wher you have to use full text index?
    6-each filegroup must have one partition or one partition can have many filegroups in partition scheme!
    7-do you have to partition every scheme or not! where do you have to partition a scheme and where not?
    8-can you give a little example with switch operator!
    9-again do you have to partition every table and index in the real world or not!
    thanks
    johan
    h.david

    Hi,
    Let me try to answer your questions:
    You need to use USE MASTER whenever you need to do some work in the MASTER database and the database context is not that.
    Yes, a database can have many filegroups. Please check this article:
    http://msdn.microsoft.com/en-us/library/ms179316.aspx
    Please check this article:
    http://msdn.microsoft.com/en-us/library/ms179316.aspx
    As per BOL:
    boundary_value is a constant expression that can reference variables. This includes user-defined type variables, or functions and user-defined functions. It cannot reference Transact-SQL expressions.
    boundary_value must either match or be implicitly convertible to the data type supplied in
    input_parameter_type, and cannot be truncated during implicit conversion in a way that the size and scale of the value does not match that of its corresponding
    input_parameter_type. For more details check
    http://msdn.microsoft.com/en-us/library/ms187802.aspx
    For simplicity: Full-Text index is used to search in a LOB/text data in a column, index is used to speed up your queries. Please check these articles:
    http://msdn.microsoft.com/en-us/library/ms142571.aspx,
    http://msdn.microsoft.com/en-us/library/ms189271.aspx
    As per BOL: When you create a partition scheme, you define the filegroups where the table partitions are mapped, based on the parameters of the partition function. You must specify enough filegroups to hold the number of partitions. You can specify that
    all partitions map to a different filegroup, that some partitions map to a single filegroup, or that all partitions map to a single filegroup. You can also specify additional, "unassigned" filegroups in the event you want to add more partitions later. For
    more info, please check
    http://msdn.microsoft.com/en-us/library/ms188730.aspx
    8. Please read the concept of partitioning here:
    http://msdn.microsoft.com/en-us/library/ms190199.aspx and for SWITCH operator, please check the sliding window example at here:
    http://msdn.microsoft.com/en-us/library/aa964122(SQL.90).aspx
    9. It depends :) but you always will have at least 1 partition!
    I hope it helps.
    J.
    There are 10 type of people. Those who understand binary and those who do not.

  • Sort order for group by functions

    I have table TAB1(notenum number, linenum number, linetext varchar2(100)).
    Each note can have multiple lines of text. Eg data
    NOTENUM     LINENUM     LINETEXT
    1     1     THIS IS LINE1.
    1     2     THIS IS LINE2.
    2     1     THIS IS LINE1 OF NOTE2.
    2     2     THIS IS LINE2 OF NOTE2.
    I need the text of lines of the most recent note (max notenum)
    <Note>THIS IS LINE1 OF NOTE2. THIS IS LINE2 OF NOTE2</Note>.
    I have a query like this
    SELECT XMLAGG(XMLPARSE(CONTENT LINETEXT WELLFORMED))
    FROM TAB1
    GROUP BY NOTENUM
    ORDER BY NOTENUM DESC
    Above query would return the text of all lines concatenated for each note and the first row would be the one with highest notenum value.
    My problem is that concatenation of the LINETEXT should happen in ascending order of LINENUM. Since LINENUM is not in GROUP BY clause I cannot specify it in ORDER BY.
    How can I specify to XMLAGG (for that matter any group by function) to concatenate text in a specific order.
    I hope I was able to explain my problem clear enough for somebody to help.
    thanks for all the help
    Message was edited by:
    user448703
    Message was edited by:
    user448703

    Never mind. I just found out that XMLAGG function has the option to specify ORDER BY. I think that will work.

Maybe you are looking for

  • Table component - how to find out which cell is clicked

    Hello! I have a couple of questions regarding table component 1. Is there any way to find out which table cell is clicked on? 2. And is it possible to paint clicked cell programmatically? Possible solution might be a Select Boolean Checkbox inside a

  • Problem with M1 linecard on Nexus7000

    Hi all, We have a problem with some interface on M1 linecard. When I use show module command, the output show this module is Fail as bellow:  CORE-NX7010-002# sh module Mod  Ports  Module-Type                         Model              Status 1    48

  • Possible bug when syncing between iCal & iPhone

    Am I doing something wrong. Here's the scenario. I have set up a continuous repeating appointment in iCal for my daughter Mon-Fri inclusive. 'School' I then went and changed selected events to 'Summer Holiday' where applicable, each time I changed a

  • Creating greeting cards in PRE 10

    I am using PRE 10 to create a greeting card.  Tis the season.  LOL ..  Anyway, I select create, greeting card, themes.  It appears as though all the themes come from Shutterfly.  And any particular theme only gives you one template to choose from.  N

  • No Task/Memo Applicatio​n

    I have read all discussions regarding no task application and have tried all that was suggested. I have 8100 version 4.5. There's no task app in the app list on the phone. I checked the desktop manager and updated to 4.5. I can not get the task appli