What is native sql when i use native sql

what is native sql & when i use native sql plz give with me example

I imagine you mean Native Dynamic SQL, NDS. An example would be:
EXECUTE IMMEDIATE 'select count(*) from ' || v_tablename INTO v_count;
i.e. you construct the SQL "dynamically" as a string and then execute it.
You would use it in situations where you could not know the precise query when building the code - e.g. as above, if you don't know which table to count the rows from until run time.

Similar Messages

  • What is it called when you use typography to make a design?

    What is the name of the style of design when you use typography to make a design such as in this example?
    http://walyou.com/darth-vader-typography/
    Thanks.

    I do not believe there is an official name for this, but searching for type art will give you plenty of samples.
    You could say this style evolved from ascii art but using typefonts to create mosaics.  I would use Type Mosaic if I had to describe this to someone.
    http://www.wordle.net/
    http://www.phombo.com/art-photography/amazing-type-faces-pictures/page-1/

  • What is "netfront" and when to use it (or not)?

    Just wondering and the Xen FAQ is not giving a satisfying answer: what does "type=netfront" in vm.cfg (regarding the vif) stand for and when do I have to use it (or not)?
    Is it really needed? Under what circumstances? And only for specific types of virtual machines (HVM / PV)? Etcetera.
    Please enlighten us if you know. TIA!

    If the virtual machine is a hardware virtualized machine (fully virtualized), you can configure the virtual interface (VIF) type to be either ioemu or netfront.
    The netfront driver is a paravirtualized driver which can be used with a paravirtualized machine, or with a hardware virtualized machine. The ioemu driver is a hardware virtualized driver, and can only be used with a hardware virtualized machine. Both drivers contain the BIOS and device emulation code to support hardware virtualized machines.
    For hardware virtualized machines, the default is ioemu. For paravirtualized machines, the default is netfront.
    After you configure the virtual interface type for one network interface card, all the network interface cards in the virtual machine will be set to the same type.

  • What to look for when buying used

    I'm planning on replacing my oooollddd G4 desktop, likely with a used MacBook if I get my way.
    I figure there are some things I know I can do to make sure it's in good, working condition. (And yeah, I realize there'll be some wear from having had an owner already) Checking for a noisy hard drive or dvd drive, the display and making sure ports work are obvious points but I was wondering if anyone can suggest anything I can do to be a little more thorough?
    I don't want to have to download software to run tests. I'm hoping there are things that are already part of OS X that can help. (eg. I'm looking through the utilities apps to see what might be good to run if anything)

    Rather than take the risk of buying another person's problems, consider purchasing an Apple refurbished unit. You get newer model, it comes with a complete standard warranty, you can purchase an extended AppleCare warranty, and they are less expensive than the new models. You will find them at Apple's Online Store.

  • In Safari I can define what pages are loaded when I open a "New Window". How do I achieve the same in Firefox (and supress the current begavior of it opening all of the tabs that I defined as my home page all the time)?

    I am returning to Firefox after having used Safari on Mac for the past year. One thing I liked about Safari was that I could define what page gets loaded when I used the File Menu command to open a new Browser Window. I defined this as opening up with my Bookmarks Menu where I then was able to select the page I wanted to go to.
    I have not been able to find a way to define this in Firefox and was surprised to see that "New Window" in Firefox opens all of tabs that I've defined as my Home Page.
    Is there a way to manage this?

    This issue can be caused by an extension that isn't working properly.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • What is native sql?

    hi all,
    what is native sql? can any one provide me some examples with native sql? and when do we go for writing prgm in native sql?
    is native sql stms are supported for pool and cluster tables?
    regds
    hari

    Hi Hari,
    DATA: BEGIN OF wa,
            connid   TYPE spfli-connid,
            cityfrom TYPE spfli-cityfrom,
            cityto   TYPE spfli-cityto,
          END OF wa.
    DATA c1 TYPE spfli-carrid VALUE 'LH'.
    EXEC SQL PERFORMING loop_output.
      SELECT connid, cityfrom, cityto
      INTO   :wa
      FROM   spfli
      WHERE  carrid = :c1
    ENDEXEC.
    FORM loop_output.
      WRITE: / wa-connid, wa-cityfrom, wa-cityto.
    ENDFORM.
    The system displays the following information:
    The program uses the work area WA and the field C1 in the Native SQL SELECT statement. WA is the target area into which the selected data is written. The structure WA in the INTO clause is treated as though its components were all listed individually. INTO :WA-CONNID, :WA-CITYFROM, :WA-CITYTO. C1 is used in the WHERE clause. The subroutine LOOP_OUTPUT writes the data from WA to the screen.
    Scope of Native SQL
    Native SQL allows you to execute (nearly) all statements available through the SQL programming interface (usually known as SQL Call Interface or similar) for executing SQL program code directly (using EXEC IMMEDIATE or a similar command). The following sections list the statements that are not supported.
    The parameters are separated by commas. You must also specify whether the parameter is for input (IN), output (OUT) or input and output (INOUT). For further information, refer to SAP Note 44977.
    EXEC SQL
       EXECUTE PROCEDURE proc1 ( IN :x, OUT :y )
    ENDEXEC.
    Cursor Processing
    Cursor processing in Native SQL is similar to that in Open SQL:
    OPEN <cursor name> FOR <statement>
    FETCH NEXT <cursor name> INTO <target(s)>.
    CLOSE <cursor name>
    EXEC SQL
      OPEN c1 FOR
        SELECT client, arg1, arg2 FROM table_001
         WHERE client = '000' AND arg2 = :arg2
    ENDEXEC.
    DO.
      EXEC SQL.
        FETCH NEXT c1 INTO :wa-client, :wa-arg1, :wa-arg2
      ENDEXEC.
      IF sy-subrc <> 0.
        EXIT.
      ELSE.
        <verarbeite Daten>
      ENDIF.
    ENDDO.
    EXEC SQL.
      CLOSE c1
    ENDEXEC.
    This example opens a cursor, reads data line by line, and closes the cursor again. As in Open SQL, SY-SUBRC indicates whether a line could be read.
    Data Types and Conversions
    Using Native SQL, you can
    Transfer values from ABAP fields to the database
    Read data from the database and process it in ABAP programs.
    Native SQL works without the administrative data about database tables stored in the ABAP Dictionary. Consequently, it cannot perform all of the consistency checks used in Open SQL. This places a larger degree of responsibility on application developers to work with ABAP fields of the correct type. You should always ensure that the ABAP data type and the type of the database column are identical.
    If the database table is not defined in the ABAP Dictionary, you cannot refer directly to its data type. In this case, you should create a uniform type description in the ABAP Dictionary, which can then be used by all application programs.
    If the table is defined in the ABAP Dictionary, you should remember that the sequence of fields in the ABAP Dictionary definition may not be the same as the actual sequence of fields in the database. Using the asterisk (*) in the SELECT clause to read all columns into a corresponding work area would lead to meaningless results. In the worst case, it would cause an error.
    The
    Native SQL module of the database interface passes a description of the type, size, and memory location of the ABAP fields used to the database system. The relevant database system operations are usually used to access and convert the data. You can find details of these operations in the manuals for the programming interface of the relevant database system. In some cases, Native SQL also performs other compatibility checks. 
    The documentation from the various database manufacturers provides detailed lists of combinations of ABAP data types and database column types, both for storing ABAP field values in database tables (INSERT, UPDATE) and for reading database contents into ABAP fields (SELECT). You can also apply these descriptions for the input and output parameters of database procedures. Any combinations not listed there are undefined, and should not be used.
    The following sections provide details of the data types and conversions for individual databases. Although they are database-specific, there are also some common features.
    Recommended type combinations are underlined. Only for these combinations is behavior guaranteed from release to release. For any other combinations, you should assume that the description only applies to the specified release.
    The results of conversions are listed in a results column:
    "OK": The conversion can be performed without loss of data.
    Operations that fail are indicated by their SQL error code. Errors of this kind always lead to program termination and an ABAP short dump.
    In some cases, data is transferred without an SQL error occurring. However, the data is truncated, rounded, or otherwise unusable:
    Right truncation.
    "Left" or "right" applies to the normal way of writing a value. So, for example, if a number is truncated, its decimal places are affected.
    : Left truncation
    : Number is rounded up or down during conversion
    : A number that was "too small" is rounded to 0 (underflow)
    : The conversion result is undefined.
    There are several possible results. The concrete result is either not known at all, or can only be described using a set of rules that is too complicated for practical use.
    : The conversion returns the SQL value NULL.
    : The conversion is performed without fields and unchecked.
    The original data is converted, but without its format being checked. The result may therefore be a value invalid for the result type, which cannot be processed further. An example of this is a date field containing the value "99999999" or "abcdefgh" after conversion.
    Combinations of ABAP data type and database column type can be divided into finer subcategories. Here, for example, using the transfer direction ABAP ® database (INSERT, UPDATE):
    If the width of the ABAP field is greater than that of the database column, the ABAP field may contain values for which there is not enough space in the database column. This can produce other cases: The concrete data value in ABAP finds space in the database column, or not.
    If the ABAP field is at most as long as the database column, there is always space for the ABAP value in the database column.
    Some types, such as numeric columns, expect values in a particular format. This is particularly important in connection with character types, for example, when you want to write an ABAP character field (type C) into an integer column.
    Reward pts if found usefull :)
    regards
    Sathish

  • Please explian what is native compilation and how to use it

    hi all.
    please explian what is native compilation and how to use it
    regards

    It's explained well in the PL/SQL User's Guide and Reference
    Compiling PL/SQL Code for Native Execution
    http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/12_tune.htm#48419

  • What is PL/SQL Catridge, where it will be used and when?

    What is PL/SQL Catridge, where it will be used and when? I am using Devloper 6i, Oracle 8i.
    Thanks in advance.

    Hi,
    In the application Special Purpose Ledger, you can define ledgers for reporting purposes. You can keep these user-defined ledgers as general ledgers or subsidiary ledgers with various account assignment objects. Account assignment objects can either be SAP dimensions from various applications (such as account, cost center, business area, profit center) or customer-defined dimensions (such as region).
    The special purpose ledgers enable you to report at various levels using the values from the various application components. The functions available in the special purpose ledgers enable you to collect and combine information, create and modify totals, and distribute actual and plan values. The values are transferred to the special purpose ledgers from other SAP applications and external systems.
    You can find more info here:
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/d5/6ada3889432f48e10000000a114084/frameset.htm
    Regards,
    Eli

  • What is native Sql data types and does oracle support this?

    what is native Sql data types
    Does oracle support this?

    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#g31099

  • What is "native" stands for in "DBMS_SQL.native"

    Dear All,
    What is native stands for in DBMS_SQL.native
    Thanks & Regards
    Phani

    pl/sql supplied packages manual
    dbms_Sql chapter
    "Constants
    v6 constant INTEGER := 0;
    native constant INTEGER := 1;
    v7 constant INTEGER := 2;
    further down, same chapter
    "language_flag
    Determines how Oracle handles the SQL statement. The following options are recognized:
    V6 (or 0) specifies version 6 behavior.
    NATIVE (or 1) specifies normal behavior for the database to which the program is connected.
    V7 (or 2) specifies Oracle database version 7 behavior.
    "

  • What is native for EP and what is needed to develop and how...

    Hi guys!
    I have to prepare a presentation of possibilities of the SAP's EP 6.0. I need to know, what is "native" - just plug n' play and how to develop other things... Can you help me please? Any links, documents .... are welcome!
    Another question: If I have an independent web application...  - how is it possible to develop it wthin the portal?
    Thanx 4 answer... Points are guaranteed!
    Peter

    Hi Peter,
    There is a wealth of information you can pull from SAP sites by looking at presentations and product info.  If you need a short cut, I have a simple presentation I put together with some talking points about the SAP Portal.  eMail me at [email protected] to get it.
    In a nut shell, the "native" things you can get from the SAP Portal is quick and easy access to SAP systems.  For example, you can create and display a page to users with a SAP R/3 transaction, an ITS screen, or a BW report in just a few minutes.  With some simple configuration work, users will not have to login to the separate systems.  One of the key advantages of the portal is that it creates an environment for administrators to create/modify views to information using configuration (templates) instead of having to do any coding.
    SAP Portal out-of-the-box also has some support for connecting to web services (SAP and non-SAP) and for displaying content from external/internal sites using an IFrame.
    If you are not familiar with Portals, I would read some of the product information on the SAP Portal.  There you will learn more about the use of Roles to secure and display information, delegated administration of content, end user features, etc.
    Another key concept is the use of Business Packages provided by SAP and other vendors.  Business Packages are pre-built content that you import into the portal.  These packages do require some configuration, however, they are really meant to be "plug and play."  Depending on your companies license agreements, a lot of these packages may be free.  Examples, include Employee Self Service and Manager Self Service business packages that interface with the HR Module in R/3 and BW.  You can get to a listing of the packages here: https://www.sdn.sap.com/irj/sdn/developerareas/contentportfolio   If you look at some of them, you will see documents and screen shot examples.
    If you are not using out-of-the-box functionality then you will create your own templates and applications.  Custom development is done based on JAVA or ABAP development stacks or by using visual toolsets.   JAVA development is done using SAP Netweaver Developer Studio which is based on the Eclipse IDE.  There are two main styles of JAVA development: JSPDynPage model or WebDynpro model.  The first is pure JAVA, the second is designed to speed up development with some JAVA and some Configuration/Visual development.  ABAP development can be done using SE80 and writing a BSP or I beleive you can run a JAVA and ABAP stack for your portal.  .NET development of iViews can be done using the SAP Netweaver Developer Studio for .NET.  Visual development can be accomplished using Visual Composer (I would stay away from this until 2.0 comes out).
    My company has been successful deploying Business Packages, configuring SSO to systems, custom iView creation to R/3, BW, and ITS, custom JAVA development, BSP development. 
    We have also experimented with deploying our own web applications on the WAS and may move all JAVA development onto the WAS for hosting. 
    To take an exisiting web app and truly make it a portal app you would have to rewrite quite a bit of the front end.  You could almost completely separate out the back end of the app from the front end.  You would have to rewrite the front end of the app and possibly redesign the app to take advantage of portal functionality (eventing, centally managed styles, etc).
    Another option besides a full rewrite of the app is just to create a url iView (basically an IFrame) to your existing application.  This way it is in portal and then you can take advantage of Roles and security.  With this option though, the portal doesn't control the display of the app (if your buttons and color are different they will remain different).  This is nice for working with a vendor app.
    Yet another option would be to integrate the app enough to take advantage of portal events.  To do this you would write a quick custom Portal application to accepts events and call your app with parameters.  With this option though the portal doesn't control the display of the app.
    Sorry for the book, but you asked a few open ended questions, which, there probably are books out there to cover.  I know I only touched on a few of the capabilities.

  • Got my 1st Mac!  I have an iMac with Nvidia GT640M.  What great native OSX FPS or MMO games will run well on it, if any?

    Got my 1st Mac!  I have an iMac with Nvidia GT640M.  What great native OSX FPS or MMO games will run well on it, if any?
    I'm an Android developer and got my iMac primarily for coding at home as well as general home computing (after being issued a macbook air at work and falling in love with OSX).  I was a huge Windows gamer  in the past but not in years.  I switched from Windows to Linux a few years ago (when I transitioned my career from Windows development to Android).  So gaming wasn't a big consideration in fact I didn't want anything too great for gaming so that I don't get sucked into gaming 24x7.  However if I can enjoy a game or two on my iMac that would be cool.
    I want a native Mac game and I want it to run well (not just barely on the lowest settings) or I would not bother.  Will anything run great on my iMac or at least very good?

    It's the same Deus Ex franchise.
    If you want multyplayer games, again see App store where you will find Call of duty, Call of Duty 2, Call of Duty Black ops, and Modern Combat.
    You can also search online for Mac compatible games.

  • What is Native Compilation

    Hi Gurus,
    What is Native Compilation?
    Naresh

    A very good document on PL/SQL native compilation is on Note 151224.1 .

  • 1)Now I use Lightrom 5.7 how to upgrade to 6 or CC? 2) What is the difference between 6 and CC vercion? 3) When I used lightromm 3, I could see inEXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is ve

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    2) What is the difference between 6 and CC version?
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?

    1)Now I use Lightrom 5.7 how to upgrade to 6 or CC?
    Purchase the standalone upgrade from here: Products
    Download CC version from here: Explore Adobe desktop apps | Adobe Creative Cloud
    2) What is the difference between 6 and CC version?
    See this comparison chart: Compare Lightroom versions | Adobe Photoshop Lightroom CC
    3) When I used lightromm 3, I could see in EXIF the distance in meters till the object I took, in the later virsions that function disappeared, it is very sad  I am stiil waiting and hope that it would be possibble in the new  versions. Or this indication may  possible by setting?
    Rob Cole's ExifMeta plugin displays the Subject Distance field (and much more).  Unfortunately, his Web site appears to be down again.  He used to be very active here, but he hasn't posted in several months.

  • Not right data when row_number used in inner-view sql query...

    Hi ,
    I use the below sql statement which displays the right data
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA , row_number() over(partition by code_farmakou order by sum_posotita desc) from
      (SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES ,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_CLINIC A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_FOREON_MS A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_KLIN A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS)The data are:
    CODE_FARMAKOU                            EMP_NAME                                                                         PACKTYPE                     PACKSIZE                  SUM_POSOTITA ROW_NUMBER()OVER(PARTITIONBYCO
    0000002419                               FACTREL INJECTION                                                                VIAL                         2 ML                                 5                              1
    0000014071                               DOPAMINE HYDROCHLORIDE                                                           VIAL                         5 ML X 25                           30                              1
    0000086289                               DETUSSIN EXPECTORANT                                                             BOT                          120 ML                               3                              1
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        2                              1
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        1                              2
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                       45                              1
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1                              2
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1                              3
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              6                              1
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              2                              2
    1000016655                               KABIVEN                                                                          BT                           50ÖÕÓ.×1,7ML                        21                              1
    1000016655                               KABIVEN                                                                          BT                           50ÖÕÓ.×1,7ML                         2                              2However , when i use the below statement , in order not to display the row_number (so i use row_number function in inner-view) the data are different--in different order... why is that????
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA from
    select CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE , SUM_POSOTITA , row_number() over(partition by code_farmakou order by sum_posotita desc) from
      (SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES ,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_CLINIC A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_AT_SINT_FOREON_MS A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_KLIN A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS
      UNION ALL
      SELECT CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, TO_DATE(DATES_EKTELESIS,'DD/MM/RRRR') DATES,SUM(POSOTITA) SUM_POSOTITA
              FROM  EKTELESI_GEN_SINT_EX_IATR A, MITROO_FARMAKOU B
               WHERE CODE_FARMAKOU = FARMAK_CODE
               GROUP BY CODE_FARMAKOU,EMP_NAME,PACKTYPE,PACKSIZE, DATES_EKTELESIS)
      )and its data are:
    CODE_FARMAKOU                            EMP_NAME                                                                         PACKTYPE                     PACKSIZE                  SUM_POSOTITA
    1000016655                               KABIVEN                                                                          BT                           50ΦΥΣ.Χ1,7ML                        21
    1000016655                               KABIVEN                                                                          BT                           50ΦΥΣ.Χ1,7ML                         2
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        2
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              2
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                       45
    0000014071                               DOPAMINE HYDROCHLORIDE                                                           VIAL                         5 ML X 25                           30
    0000086289                               DETUSSIN EXPECTORANT                                                             BOT                          120 ML                               3
    1000014127                               DEPON VIT. C                                                                     BT                           2TUBX10                              6
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1
    1000003279                               MOXACEF                                                                          BT                           40(BLIST10X4)                        1
    0000002419                               FACTREL INJECTION                                                                VIAL                         2 ML                                 5
    1000000760                               DEPON                                                                            BT                           20(BLIST2X10)                        1NOTE :Sorry, I tried to pose some sample data using the "with" statement but i couldn't...the error ORA-32035 : unreferenced query name defined in WITH clause was displayed..
    Regards,
    Simon

    The optimizer has, well, optimized out the row_number because you never refer to its value in the outermost query.
    sql>select deptno, cnt, row_number() over (order by cnt desc) rn
      2    from (select deptno, count(*) cnt
      3            from emp
      4           group by deptno);
       DEPTNO       CNT        RN
           30         6         1
           20         5         2
           10         3         3
    3 rows selected.
    -- here because we include rn in the outermost query,
    -- the results are still ordered based on the analytical function result
    sql>select deptno, cnt, rn
      2    from (select deptno, cnt, row_number() over (order by cnt desc) rn
      3            from (select deptno, count(*) cnt
      4                    from emp
      5                   group by deptno));
       DEPTNO       CNT        RN
           30         6         1
           20         5         2
           10         3         3
    3 rows selected.
    -- but if we don't include rn in the outermost query,
    -- the optimizer leaves out the window sort and the results are in a different order
    sql>select deptno, cnt
      2    from (select deptno, cnt, row_number() over (order by cnt desc) rn
      3            from (select deptno, count(*) cnt
      4                    from emp
      5                   group by deptno));
       DEPTNO       CNT
           10         3
           20         5
           30         6
    3 rows selected.This just reinforces the point that if you want your results in a particular order, you need to provide an ORDER BY clause - don't rely on execution plans to do your sorting for you.

Maybe you are looking for

  • Cannot delete two stubborn video files

    Hello all, I have two files that I have downloaded by accident from a p2p site. They are both .mkv files, which I believe makes them Matroska video files. They are trailers for movies. They appear to work fine in VLC, but when I delete them and empty

  • 2011 MacBook Pro hard drive power consumption

    Does anyone know the differences in power consumption between the Apple-supplied 750GB 5400rpm HDD, 500GB 7200rpm HDD, and 256GB SSD drives?  I'm currently using a 2011 MacBook Pro with an Apple-supplied 256GB SSD and I'm getting between 5-8 hours of

  • System name for alias GD4_500 not found in portal

    Hi people, I want to launch a query from analyzer, but i have the next error message "System name for alias GD4_500 not found in portal". What can i do?? More thanks

  • My Applet crashes java.exe to crash

    Ok, I'm not sure why, but on some computers my applet is making java.exe crash. When i attach a debugger to java.exe when it crashes I see a "Access Violation Error". The oddest part is that while one computer will crash and another identical compute

  • Text Determination in Shipment

    Hi Experts, We have a requirement to copy the delivery header texts to shipment document. But there is no access sequence for text in the shipment. Can anyone advise how to get the text copied from delivery to shipment? Many Thanks! BR, Helen