Cannot query v$database in a function ?

Hi, probably a simple explaination for this...
I'm trying to implement a solution using the flashback feature to roll back a table if a process flow hits errors.
I have defined a function that tries to return the CURRENT_SCN from V$DATABASE but it says "ORA-00942: table or view does not exist" when I try to deploy from the code editor.
I can get the same code to work fine against a test table I have.
Anything special I need to do before I can query V$DATABASE ?
I can issue the same select statement from Oracle SQL Plus and it works ok.
Thanks
Paul

Hi,
I think you have no select permission on this view. In a function you have the same permissions as the user who created this function and you have no permissions granted by role - only direct granted to the user.
This is the same for functions and procedures.
Regards
Detlef

Similar Messages

  • Query in an Access database executing a function defined in a module

    Hi all,
    I have an Access 2003 database in which some function is defined in a module.
    I also have a query defined which calls this function with no problem.
    Both the query and the function work well when the query is executed from Access.
    But when I try to execute the same query from ColdFusion, I get an error claiming that the function is not defined.
    Any Idea ?

    I believe that UDFs in Access can only be run inside of the Access runtime environment, and cannot be called through the JDBC/ODBC bridge that ColdFusion is using.
    -Carl V.

  • POST-QUERY trigger cannot retrieve the database field in TEMPLATE.fmb

    I have tried to create a form using TEMPLATE.fmb in Oracle Apps R11i. I found that the POST-QUERY trigger cannot retrieve the database field (which is display item property) properly. Can anyone tell me how to retrieve the displayed database fields? Thanks for any helps.

    POST-QUERY would fire after the query has been executed, it does not do the actual data retrieve.
    See if the items you have put have the data source properties set and are not control items.
    btw, this forum is for OA users, you would get better response to your query if you post it in forms forum
    Thanks,
    Tapash

  • Cannot connect oracle database follwing path.

    Hi experts,
                       cannot connect oracle database in the following path.
    i take sap daily backup on testing server ,but it is fail.
    F:\oracle\MPQ\sapcheck\cegvmynv.chk' at location main-11.
    but the following path not found in the testing server \sapcheck\cegvmynv.chk
    what can i do?
    Text removed by moderator
    Job started
    Step 001 started (program RSDBAJOB, variant &0000000001074, user ID SUPERUSER)
    Execute logical command BRCONNECT On host mpq
    Parameters: -u / -jid CHECK20110923162500 -c -f check
    BR0801I BRCONNECT 7.00 (43)
    BR0477I Oracle pfile D:\oracle\MPQ\102\database\initMPQ.ora created from spfile D:\oracle\MPQ\102\database\spfileMPQ.ora
    BR0805I Start of BRCONNECT processing: cegvmynv.chk 2011-09-23 16.25.51
    BR0252E Function fopen() failed for 'F:\oracle\MPQ\sapcheck\cegvmynv.chk' at location main-11
    BR0253E errno 2: No such file or directory
    BR0121E Processing of log file F:\oracle\MPQ\sapcheck\cegvmynv.chk failed
    BR0806I End of BRCONNECT processing: cegvmynv.chk2011-09-23 16.25.54
    BR0280I BRCONNECT time stamp: 2011-09-23 16.25.54
    BR0804I BRCONNECT terminated with errors
    External program terminated with exit code 3
    BRCONNECT returned error status E
    Job finished
    Regards,
    A.Sithanandan
    Edited by: Matt on Sep 26, 2011 9:07 AM

    Hi Justin,
    I can connect the database where I use Oracle ODBC Driver. But Microsoft driver didn't work.
    However, I can connect to the database where I use Microsoft driver in W2K (server side)...
    Catherine
    Can you connect with the Oracle driver? I'm not sure whether the Microsoft driver is supported against a 9i database (I have no information either way).
    Justin

  • Call query from database as item source

    Hello!
    I have a query that is too long to paste it as the record source for an Apex item. It exceeds the limit of 32K.
    Is there a way to save that query at database level and call it from the apex item?
    If there is, please be so kind and give a small example!
    Thank you,
    Sebastian

    Hello,
    Why not put that code into a PL/SQL packaged function and use the "PL/SQL Function Body" or "PL/SQL Function or Expression" types instead?
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • How to Query a database table of a remote system in a program.

    How to Query a database table of a remote system in a program.
    Thanks in adv.
    -Satish

    1.Create an RFC(SE37) in Source (To Where you want to get data)
    IMPORTING MATNR
    EXPORTING : SYS TYPE SY-SYID
                         I_MARA TYPE MARA
    SELECT SINGLE * FROM MARA INTO I_MARA WHERE MATNR EQ MATNR
    2.Copy the same RFC to Target(From Where you want to get data)
    3.Create a RFC destination(SM59.) in Source
    Enter the connection type as 3 and enter the target host  and system number ( may be 00)
    4.Create a program to calling RFC in Source.
    PARAMETERS: p_matnr LIKE mara-matnr.
    PARAMETERS: p_dest LIKE rfcdes-rfcdest DEFAULT 'NONE'.
    DATA: system LIKE sy-sysid.
    DATA :i_mara TYPE mara.
    CALL FUNCTION 'XX_RFC_GET_TEST' DESTINATION p_dest
      EXPORTING
        matnr                 = p_matnr
      IMPORTING
        sys                   = system
        i_mara                = i_mara
    :-Gopeekrishnan

  • How to query a database file on my hard drive?

    Hi,
    I have a filer called "server.dbs" on my hard drive. It is a database file. I use a simple program that allows you to view databases, and it loads up and I can traverse the database and see all the entries as any standard database.
    So I figured that Java's ability to handle SQL would allow me to make a standard SQL statement querying the database, and be able to get the results. The software stores servers in SID fields, and the value is the port the server runs on. I want to make a simple query to select a server by SID, and print the port in which that server is running on.
    So is there any way to, via my java application, load a database from a file (rather than a url) which has no authentication required, and simply make my queries directly to that file? If so, how?
    Thanks!
    -Josh

    Normal database access is via JDBC.
    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    To use that JDBC driver is needed to access the database. Databases in wide usage all have one. It isn't clear from your posting that you have a common database though.

  • Build dynamic SQL query in Database Adapter.

    Hi All,
    I have a requirement to build dynamic sql query at Database Adapter.
    My BPEL process is getting search spec as input from siebel. I need to process this searchspec in BPEL and need to build the SQL query dynamically at Database Adapter to fetch the records from DB.
    it goes like this....
    1. Sieble Search Spec: city1 OR city2 OR city3 OR city4 .....
    I need to build query as
    select * from S_ADDR_PER where city like 'city1' OR city like 'city2' OR city like 'city3' OR city like 'city4' ......
    2. Siebel Search spec: city1 AND country1 AND state1....
    I need to build query as
    Select * from S_ADDR_PER where city like 'city1' AND country like 'country1' AND state like 'state1' ....
    3. Siebel Search spec: state
    I need to build query as
    select * from S_ADDR_PER where state like '%state%';
    Is it feasible in Database Adapter? if its Yes.
    Any guidelines to achieve this?
    Thank you
    Chandra

    Hi All,
    I have a requirement to build dynamic sql query at Database Adapter.
    My BPEL process is getting search spec as input from siebel. I need to process this searchspec in BPEL and need to build the SQL query dynamically at Database Adapter to fetch the records from DB.
    it goes like this....
    1. Sieble Search Spec: city1 OR city2 OR city3 OR city4 .....
    I need to build query as
    select * from S_ADDR_PER where city like 'city1' OR city like 'city2' OR city like 'city3' OR city like 'city4' ......
    2. Siebel Search spec: city1 AND country1 AND state1....
    I need to build query as
    Select * from S_ADDR_PER where city like 'city1' AND country like 'country1' AND state like 'state1' ....
    3. Siebel Search spec: state
    I need to build query as
    select * from S_ADDR_PER where state like '%state%';
    Is it feasible in Database Adapter? if its Yes.
    Any guidelines to achieve this?
    Thank you
    Chandra

  • Dynamically Pass sql query in Database adapter

    hi',
    How can we dynamically pass sql query in Database adapter, is there any way, I am using SOA 11G.
    Thanks
    Yatan

    Hi,
    Tried that too. No luck. Gives me this.
    The selected operation process could not be invoked.
    An exception occured while invoking the webservice operation. Please see logs for more details.
    oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'selectUsingIn' failed due to: Pure SQL Exception.
    Pure SQL Execute of select interface_id, property_name, property_value from ( (?) ) failed.
    Caused by java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
    Regards,
    Neeraj Sehgal

  • Can a web service query a database at set intervals?

    Can someone verify if this is feasible?
    I need to display live data via browsers .  I would like to have the query to the database executed server side and have the web service provide the data to the browsers.
    Here is what I propose :
    I would like to have a web service run on a web server for an intranet.
    Have the web service  query a database every 20 seconds and update the data into a table or an array variable. 
    On the browser side I want the browser to refresh every 20 seconds with the updated data from the web service.
    Any other recommendations would be greatly appreciated.
    Thank you.
    Chris W.

    Hi ChrisTW1,
    Thank you for posting in MSDN forum.
    Based on your issue, I suggest you can try to use the JS to call the web service to set the intervals. For more information about how to use the JS to call the web service to set the intervals, please see:
    http://www.codeproject.com/Tips/647322/Calling-ASP-NET-Webservice-using-JavaScript-on-Reg
    In addition, since
    this forum is to discuss: Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor. If you have any issues about the set the
    intervals for the web service, I suggest you can post this issue directly to the WCF forum:https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wcf, maybe
    you will get more help.
    Hope it help you!
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • FRM - 41105 You Cannot query records without a saved parent record

    I have 3 data blocks. The contro data block have document type and document number if we come to new record(I have written execute query for both header and detail part) the header block will show the detail of the documnet header(Header Details) and detail block will show the detail part.
    But my problem is when new record instance only the header block is querying and detail block is not querying and giving an error message(*FRM - 41105 You Cannot query records without a saved parent record*)!!
    Plz help me!!
    Thanks in advance,

    yea header tables PK is refered in the details table.
    and i have master record created already and have the detail record for those master records in the table.
    i want to query the detail record related to that master when we select a document number and document code in the control block.
    Its querying the master detail relevent to that header and giving this error messge while quering the detail record..

  • I am trying to update My Microsoft Office 2011 14.4.2 for mac update cannot close Microsoft Database Daemon or SyncServices Agent how do i do this?

    Help, I am trying to update My Microsoft Office 2011 14.4.2 for mac update cannot close Microsoft Database Daemon or SyncServices Agent how do I do this please?

    Launch Acitvity Monitor in your Utilities foilder and search for both proccess and quit.

  • Query distributed database with different character sets.

    Hello experts, this is my situation:
    I have two databases A and B, the same version 11.1.0.7, the same OS Suse Linux Enterprise 10 but with different character sets, A has WE8MSWIN1252 while B has AL32UTF8. The database B is my XML DB repository so there I have some XML type tables. I need to query this tables from the database A using a dblink and in fact I have done that but the XML content is trasformed due to the different character sets between the databases. Some time there are data loss and some time there are data missmatch.
    Is there any way to query the tables stored in the database B without problems? I do not know if the following is correct: Maybe I can set the character set for the session in the database A during the time it query the database B. That is, change the character set in fly at session level.
    Do you have any special suggestion?
    I hope you can help me, thank you in advance.

    The Globalization Support Guide for 11.1.0.7 has a chapter on character set migration that should be helpful. AL32UTF8 is a superset of WE8MSWIN1252 but it is not a strict superset. That is, it doesn't meet the second prong of the test in the documentation
    The new character set is a strict superset of the current character set if:
    Each and every character in the current character set is available in the new character set.
    Each and every character in the current character set has the same code point value in the new character set. For example, many character sets are strict supersets of US7ASCII.Exporting the data from the A, changing the character set (or creating a new database with the AL32UTF8 character set), and then importing the data may be the easiest approach in your case.
    Justin
    Edited by: Justin Cave on Jan 13, 2011 12:08 PM

  • Is it possible to query which databases are on a databaseserver

    I am trying to create a list of databases to which a specified user can connect.
    The user has to specify the database server, user name and password and I want to show a list of possible databases.
    Can this be accomplished?
    Thanks.

    Thanks for the help. The code below lists the databases in a MS SQL Server. For MySql I think the trick is to use the query "SHOW DATABASES;" with as column name 'Database', but I don't have a MySql Server here at this moment to test it.
        public static List getDatabases(final Connection dbCon) throws Exception {
            List databases = new ArrayList();
            try {
                String databaseName = null;
                ResultSet rs;
                Statement stat;
                stat = dbCon.createStatement();
                rs = stat.executeQuery("exec sp_databases");
                while (rs.next()) {
                    databaseName = rs.getString("DATABASE_NAME");
                    if (!databases.contains(databaseName)) {
                        databases.add(databaseName);
            } catch (SQLException e) {
                throw new Exception("Get databases failed:" + e.getMessage());
            return databases;
        }

  • Problems with query via Database-Link (Oracle 7.3.4)

    I made the following simple query via database-link.
    select count (*) from [email protected]
    I got the result in about 200 miliseconds.
    Then I4ve tried the following query.
    select * from [email protected]
    It took about 2 hours end ended with an error message "ORA-03113: end-of-file on communication channel"
    So I made another choice
    select * from [email protected] where rownum <=1
    Took about 200 miliseconds.
    So I made the query again an changed only the number of rownums,until I was at rownum <=8
    then it went sleeping again(I've canceled the statement because I didn't want to wait 2 hours again).
    We made the same things from another server with the same database-link on the same remote server
    and we had no problems.
    Any Idea???

    No, network is OK!
    Other links are running, I have also no problems when I connect directly to the remote server.

Maybe you are looking for