Oracle limitation? function created using "or replace" clause

How I can know if function is created using "or replace" clause?
I mean we can use "create function xxx" or "create or replace function xxx" to create function.
when we check all_source (select text from all_source) to get the function body. The "or replace" clause is missing. Both are like "Function xxx".
We are asked to be able to identify if the function create using "create" or "create or replace".
what we should do? Is this Oracle limitation?

That only works if nothing other than create create/replace happens tot he function over time. consider:
SQL> CREATE TABLE t AS
  2  SELECT rownum id, TO_CHAR(TO_DATE(rownum, 'J'), 'Jsp') descr
  3  FROM all_objects
  4  WHERE rownum < 10;
Table created.
SQL> CREATE FUNCTION f (p_num IN NUMBER) RETURN VARCHAR2 AS
  2     l_v VARCHAR2(30);
  3  BEGIN
  4     SELECT descr INTO l_v
  5     FROM t
  6     WHERE id = p_num;
  7     RETURN l_v;
  8  END;
  9  /
Function created.
SQL> SELECT object_name, created, last_ddl_time, timestamp
  2  FROM user_objects
  3  WHERE object_name = 'F';
OBJECT_NAM CREATED              LAST_DDL_TIME        TIMESTAMP
F          09-aug-2010 09:45:39 09-aug-2010 09:45:39 2010-08-09:09:45:39As a brand new function, all dates agree, as expected. But now, I want someone to actually be abl to use this function so:
SQL> GRANT EXECUTE ON f TO john;
Grant succeeded.
SQL> SELECT object_name, created, last_ddl_time, timestamp
  2  FROM user_objects
  3  WHERE object_name = 'F';
OBJECT_NAM CREATED              LAST_DDL_TIME        TIMESTAMP
F          09-aug-2010 09:45:39 09-aug-2010 09:47:00 2010-08-09:09:45:39Note that grant is ddl and it was performed on this function, so last_ddl is different, but I have not done a create or replace. The timestamp is still the same, so maybe that is a possibility? But ...
SQL> ALTER TABLE t ADD (descr2 VARCHAR2(30));
Table altered.
SQL> SELECT status
  2  FROM user_objects
  3  WHERE object_name = 'F';
STATUS
INVALID
SQL> SELECT f(1) FROM dual; -- auto recompile
F(1)
One
SQL> SELECT object_name, created, last_ddl_time, timestamp
  2  FROM user_objects
  3  WHERE object_name = 'F';
OBJECT_NAM CREATED              LAST_DDL_TIME        TIMESTAMP
F          09-aug-2010 09:45:39 09-aug-2010 09:49:03 2010-08-09:09:49:03So, I have still not explicitly done a create or replace, but timestamp is now different. Does this auto recompile count as create or replace?
John

Similar Messages

  • How to write a java function for use in where clause in SQL statement

    Hi,
    Does anyone know a good tutorial on how to write and include a Java class/function into Oracle.
    I'd like to write mathematical function to use in my queries, but the resources available in PL/SQL are very limited.
    Many thanx

    Pim,
    I see you got an answer in the PL/SQL forum.
    But in case you haven't seen it, perhaps this Web page will help:
    http://www.oracle.com/technology/tech/java/jsp/index.html
    Good Luck,
    Avi.

  • In Oracle, Can i use if exits clause in a query?

    In Oracle, Can i use if exits clause in a query?
    For example, "Drop table if exists tablename"
    Is the above command valid in oracle?
    If not then is there any equivalent for if exists clause?

    Here is the SP code code that might help you to Drop a table if it exisit, whith out throwing an error if the table is not present.
    create or replace PROCEDURE DROP_TABLE(TabName in Varchar2)
    IS
    temp number:=0;
    tes VARCHAR2 (200) := TabName;
    drp_stmt VARCHAR2 (200):=null;
    BEGIN
    select count(*) into temp from user_tables where TABLE_NAME = tes ;
    if temp =1 then
    drp_stmt := 'Drop Table '||tes;
    EXECUTE IMMEDIATE drp_stmt;
    end if;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END DROP_TABLE;
    Call this SP in your Scripts by : CALL DROP_TABLE ('<Table Name>')
    Hope this Helps!
    Regards,
    Kaarthiik

  • Can I create a XSL function and use it in the Word Template

    I have a complicated logic (complicated if i have to repeat it 400 to 500 times) for determining if I should show a null expression. If the value is null or equal to 0 show N/A else show the value.
    If I have to repeat this over and over again and it turns out to need an update this would be a nightmare. But I don't have time to waste on a wild goose chase either. If I have to do something a couple thousand times i better get started basically.
    Can I create a function in the word template then call it throughout the word template for each field I have to check?
    Have a link to a tutorial that is doing this?

    If you really want to have a function, you have choice of using subtemplates (either RTF or XSL)
    You can check for steps here
    http://www.oracle.com/technetwork/middleware/bi-publisher/overview/bip-subtemplate-1-132933.pdf
    But if you have functions or use the code directly you anyway need to modify your 400-500 fields.
    i.e. either
    <?xdoxslt:ifelse(COLUMN='','NA',COLUMN)?>
    or <?call:template_name?>

  • Using of Oracle Text functions not working in JDev

    Hi,
    I'm confused about using Oracle Text functions in JDeveloper.
    It's not possible for me to pass the sql syntax test while creating a view object with a custom query:
    SELECT score (1) myScore,
    dokumente.titel,
    ctx_doc.snippet ('idx_dokumente_titel',
    TO_CHAR (dokumente.dkt_id),
    'searchstring'
    ) snippet
    FROM dokumente
    WHERE contains (titel, 'searchstring', 1) > 0;
    I retrieve "ORA-00911:     invalid character" for the contains-function.
    (Using this statement in sql-worksheet works.)
    Any ideas?

    Hi william,
       Yes you need code abap to maintein your data. look at <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/2f/696d360856e808e10000009b38f839/frameset.htm">Business Data Toolset</a>, in the part of Dialog.
    Regards.
    Manuel

  • Oracle stored functions and where clauses

    Hello everybody,
    I need to call an Oracle stored function and at the same time do a select on
    the result of the query, it works well except when I use a where clause. I
    am connecting to Oracle 8.1.7 through OLEDB using the Oracle provider for
    OLEDB distributed with this Oracle version.
    Here is the query I am doing:
    select * from {call MC.SEC.QryTermbases(?, ?) where ID = ?}
    If I remove the where clause it works well but I need to use the where. I
    know that I could pass the parameter to the procedure instead of doing that
    in the select but there are places where I can not do that since the SQL
    query is generated dynamically. The code above is just a demo.
    Thanks very much for your help,
    Jose.

    Thanks for answering, it is actually possible to do a select on the return of a function, I have tested it with other than "select *" and it has worked well. What has not worked for me is using a "where" clause. That is "select" without "where" has worked but not with the "where".
    I also suspect that it does not work but similar queries work well in MSSQL 2000 and Interbase 6.0 so I thought may be there was a way to do that with Oracle. That is in MSSQL I can treat the result of a function as a normal table and I can do the same thing with a stored procedure that returns a recordset in Interbase.
    Thanks again for answering,
    Jose.

  • Using an Oracle SQL Function from JPA/TopLink

    How do I get the return value from a simple (one string input parameter, returns a string) Oracle SQL Function?
    Thanks!

    If you mean calling a stored function in Oracle, you might try something like:
        ValueReadQuery vrq = new ValueReadQuery();
        SQLCall call = new SQLCall("begin ###res := pkg.funcInp(#inp); end;");
        vrq.setCall(call);
        Query q = em.createNativeQuery("");   // we need a Query; any query would do; we replace its contents below
        ((EJBQuery)q).setDatabaseQuery(vrq);
        q.setParameter("inp", "paramValue");
        String result = (String)q.getSingleResult();
        // #=input; ###=output; ####=input/output;
        // if you want to explicitly specify the type of an output parameter, use #### instead of ###,
        // because pure "output" parameters are always treated as java.lang.StringThis will only work in TopLink Essentials, though. I don't know how to do it in Hibernate. I have dealt mainly with TopLink, and just a little with Hibernate.
    In my opinion, it's a HUGE omission not to have support for stored procedures in JPA. Virtually every project I have worked on (in two large companies) has consisted of a large portion of code in stored procedures (sometimes as much as 50% of the overall code). It's a pain to have to go through all that trouble to call the stored procedures.
    Also, pay special attention to TopLink's shared L2 cache. If a stored procedure changes something in the database, TopLink won't know about it and chances are that you will end up with stale objects in the cache which you will either have to refresh, or you'd have to invalidate TopLink's cache for these objects.
    Best regards,
    Bisser

  • Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? Difference between Enterprise and SE?

    We’re seeing the following issue: sql - Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? - Stack Overflow (posted by a colleague of mine) and are curious to know if this behaviour is due to a difference between standard and enterprise, or could we doing something else wrong in our DB config.?
    We have also reproduced the issue on the following stacks:
    Oracle SE One 11.2.0.3 (with Spatial enabled)
    Redhat Linux 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    11.2.0.3.0 Standard Edition and 11.2.0.4.0 Standard Edition (both with Spatial enabled)
    Microsoft Windows Server 2003R2 Standard x64 Edition
    However, the SQL works fine if we try it on Oracle 11.2.0.3.0 *Enterprise* Edition.
    Any help or advice would be much appreciated.
    Kindest Regards,
    Kevin

    In my experience sdo_filter ALWAYS uses the spatial index, so that's not the problem. Since you did not provide the explain plans, we can't say for sure but I think yhu is right: Standard Edition can't use the bitmap operations, and thus it'll take longer to combine the results of the two queries (because the optimizer will surely split this OR up in two parts, then combine them).
    BTW: when asking questions about queries here, it would be nice if you posted the queries here as well, so that we do not have to check another website in order to see what you are doing. Plus it will probably get you more answers, because not everyone can be bothered to click on that link. It would also have been nice if you had posted your own answer on the other post here as well, because my recommendation would have been to use union all - but since you already found that out for yourself my recommendation would have been a little late.

  • Invoking a web service not created using oracle web service lib

    Hi All,
    I have a need to invoke my web service from oracle sql command. My web service not created using oracle web service library, but it is created using axis c++ libraries. Is it possible to do so,
    Thanks in advance,
    Regards,
    Monica

    In order to call out from the database process, is SQL (or PL/SQL) you need to generate some client code, that understand the details about the specific of the service you want to invoke and can produce the correct SOAP request. Once this proxy is uploaded in the Database, you can use it.
    There is a set of Database Web services samples that should help you get started. You can also take a look at the developer's guide - see Developing a Web Service Client in the Database.
    Hope it answers your question.
    --eric                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem with blob column index created using Oracle Text.

    Hi,
    I'm running Oracle Database 10g 10.2.0.1.0 standard edition one, on windows server 2003 R2 x64.
    I have a table with a blob column which contains pdf document.
    Then, I create an index using the following script so that I can do fulltext search using Oracle Text.
    CREATE INDEX DMCS.T_DMCS_FILE_DF_FILE_IDX ON DMCS.T_DMCS_FILE
    (DF_FILE)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('DATASTORE CTXSYS.DEFAULT_DATASTORE');
    However, the index is not searchable and I check the following tables created by database for my index and found them to be empty as well !!
    DR$T_DMCS_FILE_DF_FILE_IDX$I
    DR$T_DMCS_FILE_DF_FILE_IDX$K
    DR$T_DMCS_FILE_DF_FILE_IDX$N
    DR$T_DMCS_FILE_DF_FILE_IDX$R
    I wonder what's wrong with it.
    My user has been granted the ctx_app role and I have other tables that store plain text which I use Oracle Text are fine. I even output the blob column and save as pdf file and they are fine.
    However the database seems like not indexing my blob column although the index can be created without error.
    Please advise.
    Really appreciate anyone who can help.
    Thank you.

    The situation is I have already loaded a few pdf document into the table's blob column.
    After I create the Oracle text index on this blob column, I find the system generated index tables listed in my earlier posting are empty, except for the 4th table.
    Normally we'll see words inside the table where those are the words indexed by oracle text on my document.
    As a result, no matter how i search for the index using select statement with contains operator, it will not give me any result.
    I feel weird why the blob is not indexed. The content of the blob are actually valid because I tested this by export the content back to pdf and I can still view and search within the pdf.
    Regards,
    Jap.

  • Use of replace function

    I have an String which contains , and : in it. I want to replace , and : with some values.. How can i do this using single replace function..
    Note: Using only single replace function i have to replace these special charecters..
    Can you help me...

    Hi !
    Why not REPLACE(REPLACE(YourField, ',', 'value1'), ':', 'value2') ?
    Where value1 is the value that will replace the ',' and the value2 will replace ':'.
    Hope this will help, feel free to ask more !
    Max

  • Is there a way to load a movie file created using FlattenMovie() function ?

    Is there a way to load a movie file created using FlattenMovie() function ? I tried with NewMovieFromFile() , everything went well but the movie video track somehow had been corrupted.
    The thing is I could nicely convert the original Movie data structure using an export component. But the one I recreated after saving disk did not converted well ( It produced only sound ). Plz help I seached all over the documents to unerstand 'How to use flattened files' but could not.

    Hi telsenbroich,
    Have a look at this response
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=506500000005000000269A0100&HTHREAD=000104998&UCATEGORY_0=_8_&UCATEGORY_S=0
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Doubt when i try to create payroll function by using t/c PE04

    Hi,
    When i try to create payroll function by using t/c PE04. Dialog box is generating saying that 'Object can only be created in SAP development class'.
    Can i proceed with enter or i need any customer dev. class.
    Thanks in advance...
    Thrilleswar.

    Hi,
    I received the same message when I tried to create a new customer function on PE04. I assume that you are trying to create the function starting with Z*.
    Try creating the function that starts with Z_*. This will then allow you to save the object in your own develoopment package.
    Hope this helps.
    -Akshay

  • Can't use ";" in sql clause with Oracle 8.X

    Can't use ";" in sql clause with Oracle 8.X
    I can't use ";" at the ending of sql clause in VB program. First this program can use with Oracle 7.3.4 database. But now i need to upgrade DB to Oracle 8.1.7 ,program can't operate. It show error Runtime 40002
    and 37000:ODBC driver for oracle/invalid charactor
    Thankyou

    I've seen a lot of discussion about semicolons in SQL
    sent from 3rd party applications. A web search should
    bring up the discussions.
    Also you might get more response if you ask this question
    somewhere else. This is not a VB forum, so you may
    not reach relevant people.
    -- CJ

  • In between my new iPhone and a old one, I used a replacement iPhone. On the replacement phone there were two backups created. I have a new iPhone now, but only the 2 old backups from my replancement phone. How do I get a older backup on my new phone?

    In between my new iPhone and a old one, I used a replacement iPhone. On the replacement phone there were two backups created. I have a new iPhone now, but only the 2 old backups from my replancement phone. How do I get a older backup on my new phone?

    Not sure where you backup to.
    ITunes keeps the latest backup only.
    Icloud keeps the 3 last backup.

Maybe you are looking for

  • How do you add a dingbat to character viewer in order to select it?

    I understand that being unicode pages cannot use ITC Zaph dingbats from the keyboard that i need to use the special characters. very awkward! but how do i insert a character from zaph dignbat into special characters? thank you

  • Info Related to Material No, Process Order No

    Hi Gurus, Can you tell the Master and auxillary tables related to Process Order No, Material No and Plant. I have to run t-code : COPI which is used to generate Feedback list ( Process Order ) I have Process Order no with me but do not have material

  • FCPX upload to youtube in 1080, but showing up on youtube as 720

    I have been using the direct upload to YouTube feature on Final Cut Pro X now for several months and I have never had an issue until now. Today I went to upload a video like I always do, in 1080, and after uploading to YouTube the quality is only sho

  • Does setup tables shud be deleted every time in delta

    hi gurus can u tell me how the setup tables run(work) when delta loading taken place.... tell me the diffe between following tables and there names.. ex vbak, vbep etc.. application tables i know vbak,vbap,vbep, vbup etc application tables = update t

  • How to Stop FM procesing in program if it taking time

    hi all, i am caaling a FM in program and it is taking more time to process. i need to check if its takes more than 100sec i have to come out of the Fm process . Please let me know how to do this by code. Plz help mahesh