CONNECT BY QUERY returns different number of Clotilde in 10g or 11g databases

People,

I put just a problem of bellows in our databases.

1.) 10 g database:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select * from global_name;

SQL> SELECT ROWNUM 
  2    FROM   dual
  3  CONNECT BY ROWNUM <= 2;

    ROWNUM
----------
         1
         2
         3

SQL> 
2 Database 11 g
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from global_name;


SQL> SELECT ROWNUM 
  2    FROM   dual
  3    CONNECT BY ROWNUM <= 2;

    ROWNUM
----------
         1
         2

SQL> 
As you can see in 10g above query returns 3 records in 11 g only 2.
Why is it like that? It's sort of adjustable, to produce the same result?

Thank you very much
Tomas

Hello

If you have access to metalink, see no bug no 6031397.
It is fixed in version 10.2

Tags: Database

Similar Questions

  • query returns different results depends on the length of the day

    Hello!

    I have a query:

    INSERT /*+ APPEND */ INTO pwa_process (
    id,
    id_session,
    id_customer,
    s2k_account,
    service_seq_num,
    msisdn,
    id_tariff,
    contract_end_date,
    last_contract_date,
    next_available_contract_date,
    tariff_name,
    description,
    description_long,
    imei_old,
    activation_date,
    id_customer_number,
    arpu,
    value0,
    value1,
    value2,
    value3,
    value4,
    value5,
    id_pricing_plan)
    WITH msisdns AS (SELECT msisdn ms FROM customer_number cn
    JOIN customer_s2kaccount cs ON cn.s2k_account = cs.s2k_account AND cs.id_customer = v_customerId)
    SELECT
    seq_pwa_process.NEXTVAL,
    v_sessionId,
    customer_s2kaccount.id_customer,
    customer_s2kaccount.s2k_account,
    customer_number.service_seq_num,
    msisdn.msisdn,
    tariff.id,
    NVL(CASE WHEN date_contract_end IS NULL AND le_contract_end_date IS NOT NULL OR (date_contract_end < le_contract_end_date)
             THEN le_contract_end_date
             ELSE NVL(date_contract_end, ADD_MONTHS(customer_number.date_start, customer_number.ada_availability))
        END, TO_DATE('01.01.1970', 'DD.MM.YYYY')) contract_end_date,
    CASE WHEN NOT customer_number.date_first_activation IS NULL AND customer_number.date_first_activation >      (CASE WHEN ada_priority = 1 THEN ada_date_pwa
            WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) 
            THEN exchange_date 
            ELSE date_pwa 
      END) 
         THEN customer_number.date_first_activation
         ELSE   (CASE WHEN ada_priority = 1 THEN ada_date_pwa
            WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) 
            THEN exchange_date 
            ELSE date_pwa 
      END) 
    END last_contract_date,
    ADD_MONTHS(CASE WHEN NOT customer_number.date_first_activation IS NULL AND customer_number.date_first_activation > NVL(  (CASE WHEN ada_priority = 1 THEN ada_date_pwa
            WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) 
            THEN exchange_date 
            ELSE date_pwa 
      END) ,
                                                                                                                           NVL(customer_number.date_first_activation, NVL(customer_number.date_start, customer_number.date_effective)))
                    THEN customer_number.date_first_activation
                    ELSE NVL(  (CASE WHEN ada_priority = 1 THEN ada_date_pwa
            WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) 
            THEN exchange_date 
            ELSE date_pwa 
      END) , NVL(customer_number.date_first_activation, NVL(customer_number.date_start, customer_number.date_effective)))
               END, customer_number.ada_availability - DECODE(NVL(customer_number.current_contract_type, 0), 2, DECODE(customer_number.reduced_contract_used, 0, NVL(customer_number.el_contract_calculated_reduc,0), 0), 0)) next_available_contract_date,
    tariff.name_ada,
    DECODE(msisdn_group.def_column, 0, msisdn.value0, 1, msisdn.value1, 2, msisdn.value2, 3, msisdn.value3, 4, msisdn.value4, 5, msisdn.value5, msisdn.value0),
    msisdn.value0 || ';' || NVL(msisdn.value1, '') || ';' || NVL(msisdn.value2,'') || ';' || NVL(msisdn.value3,'') || ';' || NVL(msisdn.value4, '') || ';' || NVL(msisdn.value5, ''),
    customer_number.imei,
    NVL(customer_number.date_first_activation, NVL(customer_number.date_start, customer_number.date_effective)) date_start,
    customer_number.id,
    NVL(s2kaccount.arpu1,0),
    msisdn.value0,
    msisdn.value1,
    msisdn.value2,
    msisdn.value3,
    msisdn.value4,
    msisdn.value5,
    customer_number.id_pricing_plan
    FROM customer_s2kaccount
    JOIN customer_number ON customer_number.s2k_account = customer_s2kaccount.s2k_account AND customer_number.service_state = 'AB'
    JOIN msisdn ON msisdn.msisdn = customer_number.msisdn
    JOIN TABLE(CAST(v_tmp_table AS ADA.NUMBER_TABLE)) ids ON ids.column_value = msisdn.id
    JOIN msisdn_group ON msisdn_group.id = msisdn.id_msisdn_group
    JOIN pricing_plan ON pricing_plan.id = customer_number.id_pricing_plan AND pricing_plan.is_for_pwa = 1
    JOIN tariff ON tariff.name = pricing_plan.id
    JOIN s2kaccount ON s2kaccount.s2k_account = customer_number.s2k_account
    LEFT
    JOIN (SELECT msisdn, exchange_date, ADD_MONTHS(exchange_date, MAX(prolongation)) le_contract_end_date
    FROM loyalty_exchange a, msisdns
    WHERE a.msisdn = msisdns.ms AND exchange_date >= ALL (SELECT exchange_date FROM loyalty_exchange b WHERE b.msisdn = a.msisdn)
    GROUP BY msisdn, exchange_date) le ON le.msisdn = customer_number.msisdn
    WHERE customer_s2kaccount.id_customer = v_customerId;
    This query returns different results in the morning (09:00) and afternoon (16:00) on the same database for the same input data (I have prepared a script to test).
    Oracle 9.2.0.6 @solaris
    I checked the query plans, but they look the same in the morning and the afternoon. I don't know where to look for a problem/bug.
    Please help me with suggestions. is in bug with join ansi? or a left outer join?

    Published by: batonoff on February 16, 2009 16:56

    Published by: batonoff on February 16, 2009 16:58

    Published by: batonoff on February 16, 2009 17:00

    I recommend you post your declaration in the {} code tags (without the spaces) so that we can actually read.

    You are absolutely positive that nothing has changed on the data between when you run in the morning and in the afternoon?

  • SQL query return different result 11 GR 1 material and GR 11, 2

    Problem: SQL returns different results in 11 GR 1 material and GR 11, 2 games.

    Example script:

    create the table tab_main
    (
    SOS number (2) not null,
    contract number (2) null
    )
    /

    create the table tab_sub
    (
    number (2) of contract non-null,.
    SOS number (2) null
    )
    /

    insert into tab_main values (1, 10);
    insert into tab_main values (2, 20);
    insert into tab_main values (3, null);
    insert into tab_main values (4, null);

    insert into tab_sub values (1, 10);
    insert into tab_sub (20, 2) values;
    commit;

    The SQL code:

    SELECT *.
    OF tab_main.
    tab_sub
    WHERE tab_main.sos = tab_sub.sos (+) AND
    tab_main. Contract = tab_sub.contract (+) and
    tab_main. Contract not in (select 1 of the double);

    The above query gives more results
    -by 11.2.0.4
    1 10 10 1
    2 20 20 2

    -in 11.1.0.7
    1 10 10 1
    2 20 20 2
    4
    3


    Please tell us what could be the reason for the behaviour of offset lines thie.


    Thank you

    Piesset

    I think it is probably a bug in 11.1.0.7 (and possibly other versions), I get the same results as your 11.2.0.4 9.2.0.7, 10.2.0.3 and 11.2.0.3, and this is the result, I expect.

    Your not in the paragraph is equivalent to:

    SELECT *.

    OF tab_main, tab_sub

    WHERE tab_main.sos = tab_sub.sos (+) AND

    tab_main. Contract = tab_sub.contract (+) and

    tab_main. Contract <> 1;

    Since you have null values in tab_main.contract they are lost by the predicate since null = value is never true (or false).

    John

  • query return different values

    Hi all


    We have EBS 11.5.10.2 installed on solaris

    The Apps schema owns all objects and public synonyms created for all objects in the apps schema.

    now when I run the query of applications such as:

    Select * from PA_REP_UTIL_ORG_GE_V;

    get the error:

    ERROR on line 1:
    ORA-00600: internal error code, arguments: [kksfbc-analysis-infinite-loop],.
    [[0xFFFFFFFF7C7432B8], [] [] [], [], [],]



    Whereas, where sys is the same mark. She gives the value...

    also raised a SR with oracle and they said to apply a patch... but the question remains...


    Please notify

    Kai

    The request that we have in the crontab is given below. We reel to a sql and run the sql.

    Select 'Edit'. object_type | » '|| owner: '. ' || object_name |' compile;' of
    DBA_OBJECTS where object_name in (d_name select do.name)
    of sys.obj$, sys.dependency$, sys.obj$ po
    where P_OBJ #= po.obj #(+)
    and D_OBJ #= do.obj #.
    and do.status = 1
    and po.status = 1
    (and po.stime! = p_timestamp);

    HTH,
    http://borndba.com

  • If a view object query returns no rows, can the vacuum to be tested at all?

    All those who know or have also experienced:

    I guess that the answer should be Yes, but I tried anyway, I still didn't worked. Here is the code (it's a method behind a command button, a bean of support (I use JDeveloper 10.1.3.4).) In the code, LoggedInStudent is the name of a view object; ZBLCModule is the name of the application module):
        public String commandButton1_action() {
            FacesContext fc = FacesContext.getCurrentInstance();
            ValueBinding vb = fc.getApplication().createValueBinding("#{data}");
            BindingContext bc = (BindingContext)vb.getValue(fc);
            DCDataControl dc = bc.findDataControl("ZBLCModuleDataControl");
            ApplicationModule am = (ApplicationModule)dc.getDataProvider();
            ZBLCModuleImpl zblcam = (ZBLCModuleImpl)am;
            LoggedInStudentImpl studentsFound = (LoggedInStudentImpl)zblcam.getLoggedInStudent();
            
            String navCase = null;
            
            // Test (1): if the view cache is empty; always bombs up the application if it IS empty:
            if(studentsFound.getAllRowsInRange().length == 0) {
                navCase = "userNotFound";
            // (2) The following three tests gets to run only when the cache is not empty; they work fine.
            } else if (((Number)studentsFound.first().getAttribute("HoursAttm")).floatValue() == 0.0) {
                navCase = "noHours";
            } else if (((Number)studentsFound.first().getAttribute("Balance")).floatValue() > 0.0) {
                navCase = "notZero";
            } else if (!(studentsFound.first().getAttribute("Validated").equals(" "))) {
                navCase = "validated";
            } else {
                navCase = "zeroBal";
            }
            return navCase;
        }
    When the view object query returns a line, the whole of the application works without error. When the query returns no rows, test (1) always bombs toward the top of the application, prompting a Houston-30003 error.

    (1) test, I tried the following:
      if (studentsFound.getAllRowsInRange().length == 0)
      if (studentsFound.first() == null)
      if (studentsFound.getEstimatedRowCount() == 0)
      if (studentsFound.isDead()) //I do not know what isDead() does; just tried desperately.
      if (studentsFound.equals(null))
      if (studentsFound.getCurrentRow() == null)
    With each of these events, I got an error of Houston-30003. It does not matter what looks like the conditional test; It is important only when the objects from view cache is empty. If the view cache is not empty, everything, including the test (1), works very well. And when the cache is empty is not because of the failure of the connection to the database, but because the student is not in the data table and line are for the student.

    It is a requirement of the company to do something when the view object query returns no rows. Can it be tested at all? How?

    Or is there something wrong in the first lines in the method before the {color: green} String navCase = null; {color} line?

    Thank you very much for your help!


    Newman

    Hello

    What you have done, is to get a handle to the object that CAN execute queries to the database.
    However, you do not query the database.

    Just add:

      LoggedInStudentImpl studentsFound = (LoggedInStudentImpl)zblcam.getLoggedInStudent();
      //New line
      studentsFound.executeQuery();
    

    The code that Shay has given you is when you do not have a request for all module, but since you are talking about a command etc button I guess that the module of the application is already active.
    The line I gave you should be enough to make it work.

    I'd be careful with the

    studentsFound.hasNext();
    

    I suggest to use estimatedRowCount();

    -Anton

  • Can I use NetMeeting to connect two computers in different physical locations using NetMeeting to dial a modem line with another computer

    original title: Microsoft Netmeeting

    Can I use NetMeeting to connect two computers in different physical locations but a local call using NetMeeting to dial a number to the other computer by a traditional dial-up 56K modem via telephone lines, (US Robotics ISA 56 K Win Modem kVoice) dialing the telephone number of the other person & their dial-up Modem too?  NetMeeting there software to do this, or do we need to use other software, downloaded or already in Windows XP?  Can we use NetMeeting on Windows XP Home Edition or XP Professional?  We do NOT want to go through the Internet, as our students do not have at this time of money to afford Internet connectivity.  . You want to use NetMeeting for tutoring purposes.

    Hi Rafael,

    Yes, you can use NetMeeting to connect two computers. Follow the steps in the article.

    How to turn on the feature Windows NetMeeting Remote Desktop Sharing in Windows XP Service Pack 2 or Microsoft Windows XP Tablet PC Edition 2005

    http://support.Microsoft.com/kb/878451

    Reference: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/app_netmeeting.mspx?mfr=true

  • Definition of different number of REB for each key

    Hello

    Assuming I have the following tables and sample data:

    create table test_tbl_aa
    (aa number(2));
    
    insert all into test_tbl_aa(aa) values(aa)
    select level aa
       from dual
       connect by level<=4;
       
    create table test_tbl_aa_n
    (aa number(2), n number(1));
    
    insert all into test_tbl_aa_n(aa, n)
      select aa, lv
        from test_tbl_aa
        cross join (select level lv
                    from dual
                    connect by level<= trunc(dbms_random.value(1,3))
                    ) v;
    

    For example, running the stmt insert in the table test_tbl_n the inserted rows are:

    AA    N
    --------
    1     1
    1     2
    2     1
    2     2
    3     1
    3     2
    4     1
    4     2
    

    In the example above defined result a stable set of records for each aa (for each series).

    Is it possible to generate different number or records in the table for each data value test_tbl_n

    column aa?

    For example for:

    AA    N
    --------
    1     1
    1     2
    2     1
    3     1
    4     1
    4     2
    

    Note: Oracle db 11g. v2

    Thank you very much

    SIM

    Do you mean like this?

    SQL > insert while test_tbl_aa_n (aa, n)
    2 Select aa, level
    test_tbl_aa 3
    4. connect by level<=>
    5 and aa = aa prior
    sys_guid() 6 and prior is not null
    7.

    6 rows created.

    SQL > select * from test_tbl_aa_n;
    AA N
    ---------- ----------
    1          1
    1          2
    2          1
    2          2
    3          1
    4          1

    6 selected lines.

  • RowNumber = 1 return different data

    We are preparing the upgrade to oracle 11g 2 to 12 c.

    We have some test environment to test extracts which is in c 11g 2 and 12.

    Even extract script, the same data, another server with a different version of the database a to 11 g 2, the other is 12 c.

    Most of the snippets returned exactly the same data.

    But for a small number of extracts in .dat file returns a little bit different. We checked into it, it's because the script extracts using a function in the database and it uses rownumber = 1, same order. But another server returns a different record. For example, they return guardian meeting certain criteria, in this case, relatives are Ok, but we wonder why he returned differently. Is there a setting or is there a default sorting of columns in oracle if not specifically using order by?

    Thank you

    Hello

    Oracle does not guarantee that queries would return the same results if used as below.

    Select * from sample_table

    where rownum = 1;

    You may need to use like below to get the same results (Top N queries)

    SELECT column_name, rownum AS rnum

    FROM (SELECT column_name

    OF sample_table

    ORDER BY column_name)

    WHERE rownum<=>

    Kind regards

    Wilson

  • Add a string when the query returns all records

    DB version: 11.2

    create table t (empname varchar2 (25), salary number, varchar2 (20) months, number of over_time);

    insert into values t ('JOHN', 2000, "NOVEMBER2014", 0);

    insert into values t ('KATE', 2000, "NOVEMBER2014", 300);

    insert into values t ('HANS', 5000, "NOVEMBER2014", 100);

    insert into values t ("KRISHNA", 2500, "NOVEMBER2014", 0);

    insert into values t ("SIEW", 3000, "NOVEMBER2014", 0);

    commit;

    SQL > select * from t;

    EMPNAME MONTHS SALARY OVER_TIME

    ------------------------- ---------- -------------------- ----------

    JOHN 2000 NOVEMBER2014 0

    KATE 2000 NOVEMBER2014 300

    HANS 5000 NOVEMBER2014 100

    KRISHNA 2500 NOVEMBER2014 0

    SIEW 3000 NOVEMBER2014 0

    SQL > select * from t where MONTH = 'NOVEMBER2014' and OVER_TIME! = 0 ;

    EMPNAME MONTHS SALARY OVER_TIME

    ------------------------- ---------- -------------------- ----------

    KATE 2000 NOVEMBER2014 300

    HANS 5000 NOVEMBER2014 100

    What I need is:

    If the query above returns at least one record, it should display the line ' Yes. We have one or more employees who worked overtime in November2014'

    before the documents are printed

    Thus, the expected production is

    Yes. We have one or more employees who worked overtime at the November2014

    EMPNAME MONTHS SALARY OVER_TIME

    ------------------------- ---------- -------------------- ----------

    KATE 2000 NOVEMBER2014 300

    HANS 5000 NOVEMBER2014 100

    If the query returns no records then usual 'no rows selected' isn't enough

    Lothar G.f. says:

    In fact, sql * more is no good tool for use considered.

    Really?  It may be a good reporting tool if you learn to use it as such...

    for example

    SQL > ttitle left 'Yes. We have one or more employees who worked overtime in November2014.
    SQL > select * from emp where empno = 1234;

    no selected line

    SQL > select * from emp where empno = 7788;

    Yes. We have one or more employees who worked overtime at the November2014
    EMPNO, ENAME, JOB HIREDATE DEPTNO COMM SAL MGR
    ---------- ---------- --------- ---------- -------------------- ---------- ---------- ----------
    7788, SCOTT, ANALYST, 7566 19 APRIL 1987 00:00:00 3000 20

    This is just a basic example.  It is possible to get SQL * more to ask for the required criteria and that the title could adjust according to this criterion, as well as the query building on it also.

    However, the OP did not specify SQL * as the reporting tool, so there is little interest providing a complete solution which, until they specify what user interface that they are actually using.

  • reload the page when SQL query returns a value

    Hello world

    the title of this discussion may seem strange, but I'll try to explain why I need this:

    A user has the ability to connect on my APEX application. There are several tabs in my application that are visible only if a certain SQL statement returns a value which is not the case by default. The user has also the ability to download a file that is transferred to an external system that analyzes the file and writes the data in the database. During this writing process - which may take several minutes - conditions for some of the tabs to show the will becomes real (-> the query will return a value). When the user refreshes the page manually, the tabs will be displayed. However, I want the tabs will appear automatically when the condition is met.

    Is it possible to refresh the page as soon as the query returns a value? It is perhaps possible to check it on the client side and trigger a refresh of the page when the condition is met. It would be even better if only the tabset has been updated, but refreshing the full page is fine as well.

    Thank you!

    Here is an overview of how it can be done

    This is possible thanks to a dynamic action being performed on a timer.

    View default tabs and dynamic action hide them on loading the page if they are not to be considered

    Create a dynamic action that will execute your query every 5 seconds or more

    If the query returns data, you can use the dynamic action to show your tabs using javascript

  • Select ROLE_TAB_PRIVS as sys and schema_owner return different data; Why?

    This code returns seven points of view that are not valid, and therefore not in the role that grants select access to them.



    sys@database > select view_name

    2 of all_views

    3 where owner = "SCHEMA_OWNER."

    4 and view_name not in)

    5. Select TABLE_NAME

    role_tab_privs 6

    7 where role = "SELECT_SCHEMA_OWNER")

    8.

    VIEW_NAME

    ------------------------------

    VIEW001

    ...

    VIEW07

    7 selected lines.

    sys@database > user conn [schema_owner]

    Enter the password:

    1. Connected.

    schema_owner@database > select view_name

    2 of all_views

    3 where owner = ' SCHEMA_OWNER)'

    4 and view_name not in)

    5. Select TABLE_NAME

    role_tab_privs 6

    7 where role = "SELECT_SCHEMA_OWNER")

    8.

    VIEW_NAME

    ------------------------------

    VIEW001

    ...

    VIEW077

    77 selected lines.

    schema_owner@database >

    If a view is invalid, you cannot grant select on it for anything.

    I found my answer "Information is provided only on the roles to which the user has access" privileges granted to roles [ROLE_TAB_PRIVS] table

    Once I got the role of select_schemaOwner in schemaOwner, the query returns results.  It has to do with the x$ dealios in the role_tab_privs view.

  • Returns the number of records

    IM under the sub query, it returns the number of records, but how can I count the number of records is reurning?

    I use version 12.0.0.61 (toad for oracle)

    Thank you

    Select * from object

    where owner = 'FIRST '.

    AND OBJECT_TYPE = 'FUNCTION '.

    AND OBJECT_NAME LIKE '% FDR_ % '.

    If you want just the County

    select count(*)
      from all_objects
     where owner='PREMIER'
      AND OBJECT_TYPE='FUNCTION'
      AND OBJECT_NAME LIKE'%FDR_%'
    

    If you want the number on each line in addition to the line-level data

    select a.*, count(*) over () cnt
      from all_objects a
     where owner='PREMIER'
      AND OBJECT_TYPE='FUNCTION'
      AND OBJECT_NAME LIKE'%FDR_%'
    

    Justin

  • Studio EN - is there a work around for the problem of referencing data from a grid with a different connection of DB and # different dimensions?

    Hello

    I'm making reference to a column in a different grid with a different database connection. I did some searching in the forums, and it seems that it is a known problem with EN Studio. The problem is that if 2 different database connections have different number of dimensions, then the reference will throw an error.

    For example, what I try to do, is below:

    In grid2.column [A], I have the following formula:

    Grid1. Column [A]

    The result is an error.

    The ultimate goal is to have a base of variance formula in the grid between grid1 and grid2, who have connections to different database with a different number of dimensions. Is there a solution to this bug? The example of the basic formula is less to:

    Grid1. Column [A] - grid2.column [A]

    Any help is very appreciated!

    Thank you

    Tiffany

    Have you tried to change the database connection in a row instead of create a new grid?

  • PLS-00362: Invalid cursor return type; 'NUMBER' must be a record type

    Hello

    Having a little trouble with the following code example provided to http://www.dba-oracle.com/plsql/t_plsql_cursor_variables.htm:
      1  DECLARE
      2    TYPE t_ref_cursor IS REF CURSOR RETURN NUMBER;
      3    c_cursor  t_ref_cursor;
      4    l_row   NUMBER;
      5  BEGIN
      6    DBMS_OUTPUT.put_line('Strongly typed REF CURSOR using SCALAR type. Expect an error!');
      7    OPEN c_cursor FOR
      8      SELECT COUNT(*) cnt
      9      FROM   cursor_variable_test;
     10    LOOP
     11      FETCH c_cursor
     12      INTO  l_row;
     13      EXIT WHEN c_cursor%NOTFOUND;
     14      DBMS_OUTPUT.put_line(l_row);
     15    END LOOP;
     16    CLOSE c_cursor;
     17* END;
     18  /
      TYPE t_ref_cursor IS REF CURSOR RETURN NUMBER;
                           *
    ERROR at line 2:
    ORA-06550: line 2, column 24:
    PLS-00362: invalid cursor return type; 'NUMBER' must be a record type
    ORA-06550: line 2, column 3:
    PL/SQL: Item ignored
    In the code above, SELECT COUNT (*)... returns a NUMBER. I know it's an aggregation function, but it returns a single value.
    Why can't return a value in a column of a row in a NUMBER?
    How can I change the SQL code so that I can do this?

    Furthermore, I wonder about the use of FETCH with a count (*)... FETCH is supposed to fetch the next row... How it works when you select an aggregate as County?

    Thank you very much
    Jason

    >
    TYPE t_ref_cursor IS REF CURSOR RETURN NUMBER;
    *
    ERROR on line 2:
    ORA-06550: line 2, column 24:
    PLS-00362: Invalid cursor return type; 'NUMBER' must be a record type
    ORA-06550: line 2, column 3:
    PL/SQL: Ignored Element

    In the code above, SELECT COUNT (*)... returns a NUMBER. I know it's an aggregation function, but it returns a single value.
    Why can't return a value in a column of a row in a NUMBER?
    How can I change the SQL code so that I can do this?
    >
    The exception is in line 2: your cursor statement. And the answer is in the text that you access
    >
    The return value of a strongly typed REF CURSOR must be a folder that can be defined using % TYPE % ROWTYPE attributes or record structure.
    >
    You said the CURSOR to return a NUMBER. And as the text says, he must be a 'record '.
    >
    Furthermore, I wonder about the use of FETCH with a count (*)... FETCH is supposed to fetch the next row... How it works when you select an aggregate as County?
    >
    As you said already FETCH retrieves the next line, if any. A query is a request is a request. It returns a result set. A query that uses aggregates returns a result set. A query that does not aggregate returns a result set.

    Your simple COUNT (*) SELECT query returns a result set that consists of a LINE and a line a ONE COLUMN of type NUMBER. Although there is only one column in the result set, what is returned is a RECORD or a LINE. That's why you have to report your data cursor return type a document using the % ROWTYPE or % TYPE attributes or a record structure.

  • Coding - returns the number of characters in a text box.

    I am trying to create an animation/simulation of cellular phone on board animate CC for use in a course of Captivate. In fact, when a user clicks on the number keys on the virtual keyboard, it displays the numbers in a text box, just as a real cell phone will display the phone number on the screen as a caller to connect. Thus, the user must click seven buttons and a seven-digit phone number is displayed on the screen of the virtual phone.  This part of my animation works fine and all seven digits appear, but I want to change the code so that a hyphen appears after that the third button clicked. In this way, the output looks like better a phone number instead of just a string of seven digits.

    Here is an example of the code that I currently assigned to the #2 in the virtual keyboard button:

    var text = sym.$("PhoneNum").html ();

    text = text + 2;

    SYM.$("PhoneNum").html (Text);

    PhoneNum is the name of my text box on the stage where the numbers appear as a click is performed on every key on the keyboard.

    To incorporate the hyphen after the third button clicked, I need to return the number of characters in the text PhoneNum sort box, then create an if/else scenario that applies the hyphen after the third button clicked.

    Anyone know how I can use JavaScript or jQuery to return the number of characters currently in the text box PhoneNum ?

    SYM. $("PhoneNum") .text () .length;

Maybe you are looking for