Question about a view inline or function within SQL

Hi all


I would like to know if using a view inline with a sql query is better or a call of function within the sql query is preferable.

When I check the plan explained in both cases I see no difference in the cost.

Appreciate your valuable suggestions on this.


Thank you
Maddy K.

A function of a query will be worse than an inline view, given the context of switching between SQL and PL/SQL engines.

See http://asktom.oracle.com/pls/apex/f?p=100:11:0:P11_QUESTION_ID:60122715103602
Bonus http://www.oracle.com/technetwork/database/features/plsql/overview/doing-sql-from-plsql-129775.pdf

Tags: Database

Similar Questions

  • Questions about the APEX 5 hash functions

    I have two questions:

    1. the wwv_flow_item.md5 function seems to have changed from 4.2 to 5.0.  It used to produce a hexadecimal string of 32 characters, but now it produces a 128 character string. My guess is that it uses more MD5 hash, but perhaps SHA-3?  Can anyone confirm this?

    2. the APEX_UTIL package now has the GET_HASH function.  This function produces a significantly different hash string because it contains arbitrary printable characters, those not just hex. It seems that the hash chains are still 86 characters.  I can't find any explanation for this function.  Should I also use SHA - 3?  The API said to use it like this:

    APEX_UTIL. GET_HASH (apex_t_varchar2 ("val1", "val2", "val3"))

    My guess is that the apex_t_varchar2 function is to convert the input to an inner type.  If anyone can say more about it?

    3. (bonus question) APEX_UTIL API seems to indicate that get_hash function is now the hash function of choice for tasks such as the lost update detection.  Am I reading this right?

    Ed Sciore

    Hi Ed!

    1. you can configure the algorithm of checksum with the instance parameter CHECKSUM_HASH_FUNCTION (for example, on the Security tab of the admin app instance). During installation, we define the most secure algorithm that is supported on the version of your database (SHA-1 on 11 g, SHA-2 on 12 c). Unfortunately, a few settings and existing features had the old MD5 algorithm in their name. Maybe it's a bit misleading that they are not necessarily more using md5, but the alternative of the duplication of functions and give them different names was not ideal, either.

    2. the result is base64 encoded instead of a hexadecimal value, because it is more compact. APEX_T_VARCHAR2 is a table of varchar2, not a function.

    3 APEX_UTIL. GET_HASH is just a utility function. You can certainly use it for construction of the checksum for the lost update detection.

    Kind regards

    Christian

  • Question about creating view

    Hi all

    for example, I need to give permission for a user that has select permission on a table, but I need to hide certain columns in the table for that user.

    I know for this application there need create a view and assign the columns needed to this point of view, then give

    access to select this point of view of a user.

    My question is: this view will affect anything if I create? He will take the tablespace volume?

    Or there is no effect and I can create?

    the table to which it is necessary to create point of view is very large.


    A view is nothing else than a stored query, so no, it's not going to take place to create, with the exception of a very trivial amount of space in the data dictionary to store the definition.

  • Question about LogMiner Viewer GUI

    Good evening

    I wanted to start the graphical interface of LogMiner Viewer (which the Concepts book said done in Enterprise Manager).

    I found nothing in Enterprise Manager, who seemed to be the LogMiner Viewer GUI. (might have missed)

    After a little research on Google, I found this:
    oemapp.bat lmviewer
    I've looked everywhere and there is no oemapp.bat anywhere on my machine.

    I searched the area to download Oracle, thinking that maybe it was something that I needed to download. Has not found such a thing. (found a lot of good documentation)

    The question: How can I get the LogMiner Viewer GUI? (I am running Windows XP Pro SP2 - 32-bit Oracle GR 11, 2)

    Thank you for your help,

    John.

    Published by: 440bx - 11 GR 2 on August 9, 2010 18:38 - added "GUI viewer" in the thread title

    John,

    Unfortunately, it's a little confusing. I have check the Concepts guide that asks the person to consult the guide for LogMiner Utlities. But in the guide to public services, they mention this sql interface only one graphical interface is not displayed. In the search for the RTO, all the Log Miner, this brilliant page will appear that except by saying that it is good and can be called through GUI, does not say anything else.
    http://www.Oracle.com/technetwork/database/features/availability/logmineroverview-088844.html

    I tried to find the same in Enterprise Manager help, but he also didn't tell em anything on this subject. But further research has revealed that Arup article that does not explain the flow of Logminer in EM.
    http://www.Oracle.com/technetwork/articles/SQL/11g-transactionmanagement-092065.html

    According to this article, there is no direct link to call the tool, but it happens in action in the backend. I'll give it a try today while I am running 11.2 here in my session as well.

    It will be useful.

    Aman...

  • Questions about the views system...

    Hello

    (1) why this 2 queries are not similar?

    Select count (*) from SAMPLE_TABLE;
    Select num_rows from user_all_tables where table_name = 'SAMPLE_TABLE. "

    (2) in the views system, I can learn about primary piece?

    (3) where I can the description of each of the views system and what information it contain?

    Best.

    (a) the statistics in views because _TABLES are only updated when you calculate freshly statistics, while the number of rows in a table established by count (*) is dynamic and always up-to-date.
    (b) what do you know about primary keys? The columns that make up their, for example? USER_CONSTRAINTS where constraint_type = 'P' will tell you what primary key constraints exist and the indexes are used to enforce them. You can then do a query of USER_INDEXES and USER_IND_COLUMNS to work on the columns are part of these indices, where they are stored and so on.
    (c) the official documentation lists each view (see part II of this page, for example: http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/toc.htm)

  • a question about VMware View

    Hello

    I want to know when we prepare a parent VM and install us one application on which allowed as Kaspersky endpoint security or other, what is happening with this when the composer creates the linked clones? How the linked clones take permit?

    and if the virtual machine is not persistent (I mean whenever a client connects to it, she creates, and every time it disconnects the virtual machine will be deleted) then what happens to software with license? and what about the name of the computer? and what is being added to the Active directory?

    Thank you

    Thank you Mohammed.

    applications there volume licenses? What is the difference between the volume licensing and standard license and how do we get it?

    Thanks again

    My best regards

  • Questions about VMware View

    Hi, I need to provide always on desktops to remote 50 users. I have been using VMware workstation to provide these desktop computers, but it was a temporary solution that is quick and easy.

    I started by installing the free ESXi which works fine except that these virtual machines are running an application that requires DirectX. When reading information VMware views looks like it's maybe the solution I need, but I can't say if she can provide always on workstations or if desktop computers are provided according to the needs. My 2nd concern is cost. I don't mind spending the money for VMware View, but looks like I have to have seen running in AD and that it will require me to install many other products such as VMware infrastructure 3.5. Someone has some good links to install VMware View and the provisioning of desktops?

    When you purchase View 4.5, business or first, you get ESX and vSphere vCenter / I.  If you are supported on this part.  You don't need to buy that separately.

    With respect to reviews, the guides are:

    To start using the doc started get: http://pubs.vmware.com/view45/ol/wwhelp/wwhimpl/js/html/wwhelp.htm#href=get_started/t_getstarted.html

    http://www.VMware.com/files/PDF/VMware-View45-evaluators-Guide.PDF -> is excellent for your POC on VMWare View.

    http://www.vmware.com/pdf/view45_installation_guide.pdf -> installation guide.

    You will need to have Active Directory in your environment.  View is used to automatically configure your desktop to your users.

    If you use clones of link or local mode (the ability to check your workstations), then you will need to Prime Minister, Enterprise edition will be beneficial.

    Hope this helps,

    Larry

  • Question about Get-View

    Note:

    I use () instead of media because this page don't like the media.

    Hello

    For some reason when I use the following code:

    Get - VM | Get-View | % {

    $_. CustomFields ("Barcode")

    I get a cannot index into a table null error.

    But... If I use this code:

    $Vms = get - VM

    {foreach ($vm to $vms)

    $Vm.CustomFields ("Barcode")

    }

    It takes more time, but it works without error.

    Does anyone know why this is? Is there a known issue with the cmdlet Get-view?

    Thank you

    Looking to 2 things different here.

    The Get - Vm cmdlet returns a VirtualMachineImpl object that contains the CustomFields property.

    Get - VM | Get-views as you watch a VirtualMachine object that has a property customValue (but no CustomFields property).

  • question about a view that I have created to solve performance problems

    Dear alll;

    I have an interesting problem. I created a view to help solve some performance problems, I've had with my query

    See below
    create or replace view view_test as 
    
    Select trunc(c.close_date, 'YYYY-MM-DD') as close_date, t.names
    from tbl_component c, tbl_joborder t
    where c.t_id = t.p_id
    and c.type = 'C'
    group by trunc(c.close_date, 'YYYY-MM-DD'), t.names
    ;
    and I tried test the view using the following syntax and I get the following errors
    select k.close_date, k.names from view_test k
    where k.names = 'Kay'
    and k.close_date between to_date('2010-01-01', 'YYYY-MM-DD') and to_date('2010-12-31', 'YYYY-MM-DD')
    However, I get the below error messages
    ora-o1898: too many precision specifiers
    I Googled it and tried a lot of things online but I can't solve the problem unfortunately, and I don't know why.



                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    What you trying to accomplish with TRUNC:

    SQL> select trunc(sysdate, 'YYYY-MM-DD') from dual;
    select trunc(sysdate, 'YYYY-MM-DD') from dual
                          *
    ERROR at line 1:
    ORA-01898: too many precision specifiers
    

    I think you meant simply TRUNC (c.close_date)

  • Questions about Chapter 2 in Oracle DB 10g: SQL Fundamentals, II

    Hello

    first of all, I'm happy to be a member of your forum. I joined a beginner Oracle courses: introduction to SQL. I am facing some problems understanding some of the concepts in Chapter 2 of Oracle Database 10 g: SQL Fundamentals II text book. I got about 15 questions. However, I will only ask two questions initially. Since I am a newbie, please respond in a simplistic form. Excuse me if you see any grammatical errors.

    Remove a column can take some time if the column contains a large number of values. In this case, it may be better to put it's unused and drop when the number of users of the system is less to avoid the long locks.

    Issues related to the:

    "When the number of users of the system is less to avoid long locks."

    1. can you explain it to me please? less than before? less than? What happens if users continued to increase over the years! then this 'less' can occur until society not collapse!

    2. Why do we need to use unused columns? When to use unused columns?

    user11164565 wrote:
    "Drop column command will do table in exclusive mode lock, thus making it unavailable for others."

    Good explanation. For how long remains of this lock mode?

    The locks are kept as long as the transaction is not completed.

    This book is trying to say, but who use the unused clause to an unused column. It would eliminate the possibility of too many locks on the table, and later when you've got less users connected, you can delete the column as well.

    HTH
    Aman...

  • A question about the number of error indicated by SQL line * more

    Hello everyone,

    OS: Fedora Core 17 x86_64
    Oracle version: Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    I have a question for the line number specified by SQL * more whenever he is in error (syntax error, for example) in your script file. Consider the following script file (myscript.sql) which includes exactly 12 lines. Before the instruction to START I just put 4 blank lines by using - just to make the code clearer to read.
    HOST clear;
    SET SERVEROUTPUT ON;
    SET PAGESIZE 0;
    SET LINESIZE 1000;
    --
    --
    --
    --
    BEGIN
      DBMS_OUTPUT.PUTLINE('Hello');
    END;
    /
    DBMS_OUTPUT. PUTLINE at line 10 is obviously a mistake and it should be DBMS_OUTPUT. Put_line. However, if you run the script here is the output:
    SQL> @myscript.sql;
    
      DBMS_OUTPUT.PUTLINE('Hello');
                  *
    ERROR at line 2:
    ORA-06550: line 2, column 15:
    PLS-00302: component 'PUTLINE' must be declared
    ORA-06550: line 2, column 3:
    PL/SQL: Statement ignored
    
    
    SQL>
    for SQL * the error is in the line 2 and not 10.

    Any idea?

    Thanks in advance,

    >
    for SQL * the error is in the line 2 and not 10.
    >
    No - for Oracle, the error is in the line 2 and not 10.

    This is the code that sees the parser. What is the 2 line?

    BEGIN
      DBMS_OUTPUT.PUTLINE('Hello');
    END
    
  • Ask questions about the functionality of EA8500 MU-MIMO

    Dear Linksys

    I bought EA8500, and it arrived today.

    I have two questions about the functionality of MU-MIMO of EA8500 AP.

    1. I want to compare the performance between SU-MIMO and MU-MIMO, but there is no option to control this feature in the router admin page. Is that one of the possible ways?

    2 EA8500 supports 1733 Mbps wireless speed, but it resembles the speed of 1 Gbps ethernet cable.

    This router supports really speed 1 Gbps ethernet? or y at - it an option to support more throughput as the aggregation of links?

    Thank you

    Hi, hyeonu. For your first query, it is not possible because there is no option to disable the feature of MU-MIMO on your Linksys EA8500 router. In addition, with regard to your second, you can get a higher throughput of 1 Gbps since this is the maximum capacity of your ethernet connection.

  • Question about DISCHARGE (expr, 1016) function

    Hello

    I have a question about the DUMP function, specifically the DUMP (expr, 1016). What character set is the function of report? The only logical answer seems to me the characters of data. The http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions055.htm#SQLRF00635 docs it says: "by default, the return value contains no character set information. To retrieve the name of character of expr, add 1000 to all the values of previous format. "For example, a return_fmt of 1008 returns the result in octal * and provides the character set name of expr.*.

    I ask this question because a client complains that there a database with database EE8MSWIN1250 (obtained from DATABASE_PROPERTIES) characters and when I asked him to run a SELECT that could empty the contents of a column, he gave me this result:
    select dump(some_col, 1016) from some_table;
    
    Typ=1 Len=8 CharacterSet=AL32UTF8: c5,bd,c5,a0,54,45,53,54
    Now I can't imagine how the data can be stored in the AL32UTF8 character set if the characters of the database are EE8MSWIN1250. This scenario is still possible? I tried in vain to reproduce on my test database.

    I don't know if the column is defined with the characters of database or the national database characterset, but even if it was a NVARCHAR2, the dump function could not return AL32UTF8 since he is not a national character set.

    If anyone has an explanation, I will be very grateful.

    Thanks in advance and best regards,
    Swear

    1. to help with the confusion about the DUMP function: index realizes that the DUMP function can be performed in the remote database. Oracle tries to push as many functions as possible and semantically correct on the remote site. Therefore, it sends the statement of simple table on the remote site after stripping the DB link. In this case, the DUMP function sees the character set of the remote database and creates the resulting string of information. This string of AL32UTF8 to EE8MSWIN1250, as described in the note, but as all the characters in the string of information are pure ASCII, some codes are actually changed.

    Things get more interesting if you start to combine the tables of local and remote databases. For example, the following query is will normally return the character of local database defined for the two columns:

    select dump(xx,1016),dump(yy,1016) from (select x.dummy xx, y.dummy yy from dual x, dual@dblink y);
    

    This is because the first dual@dblink is transported to the local site and the join is performed here with application of DUMP.

    The following query returns the set for two columns of characters in remote database:

    select dump(xx,1016),dump(yy,1016) from (select x.dummy xx, y.dummy yy from dual@dblink x, dual@dblink y);
    

    This is because all the tables are remote and the entire query is sent to the remote database and y.

    The following query returns the remote character set thus:

    select dump(xx,1016),dump(yy,1016) from (select /*+driving_site(y)*/ x.dummy xx, y.dummy yy from dual x, dual@dblink y);
    

    Here, the DRIVING_SITE hint asks the database to perform the join in the database of the table, for example dual@dblink.

    2. to answer your question:

    Your understanding of the way of conversion is generally correct, but conclusions are not quite correct. In the scenario [client EE8ISO8859P2, EE8MSWIN1250 local database, remote database AL32UTF8], Eastern and Central European characters will work correctly, but the other characters to the remote database will not be (for example, French, Greek, Chinese). It is, I think, quite clear and is usually not a major problem, as usually only compatible languages EE8 are interesting for an EE8ISO8859P2 customer. However, in the scenario [customer AL32UTF8, EE8MSWIN1250 local database, remote database AL32UTF8], the problem becomes more visible. Having a taking customer support Unicode, you can recover some data French or Greeks of the remote database but you will fail as all of these characters will be "killed" by the conversion of distance at the local level (link DB conversion).

    EE8ISO8859P2 is also for the same group of languages, such as EE8MSWIN1250, indeed, but it lacks some interesting characters. The most important of them is the symbol of the Euro. Others are "' quotes, long dashes, TM symbol, and a few other less frequently used punctuation. Therefore, always define a database as EE8MSWIN1250, even if you run some clients (Unix) with EE8ISO8859P2. Do not run Windows with EE8ISO8859P2 clients, except for purposes of loading/generation of special file.

    -Sergiusz

  • Question about to_date() function?

    Hello
    I have a question about the to_date() function.
    I am aware that for the to_date() function, we should give the format of the input string.
    My current settings for the NLS_DATE_FORMAT parameter in the NLS_SESSION_PARAMETERS table is "DD-MON-YY."
    Then, when I give
    SELECT TO_DATE('15-DEC-2008','DD/MM/YY') it should error out because the format is not same as the format of the input string('DD-MON-YY').
    But this isn't any error out.why?
    Also please tell me if the format of SYSDATE is taken NLS_SESSION_PARAMETERS table or another table.

    Please take a look at Unexpected result with to_date

  • I have a question about the functionality of Oracle Identity Manager...?

    Hi friends
    I have a question about the features of Oracle Identity Manager.
    Here's my question:
    Self-management is possible network passwords (reset / unlock) with Oracle Identity Manager 9.1.0.2

    Very grateful.

    What Kevin suggested this means that you are managing accounts and their password by IOM. If your condition is the same then follow:

    Re: error during password reset using the self-service portal

Maybe you are looking for