Can't compile stored functions in forms trigger

I have put this code in POST_QUERY trigger. But it does not compile.
select substr(wds(round(d2h(h2d(max(to_number(to_char(msg_time))))
- h2d(min(to_number(to_char(msg_time))))),2)),1,40) into :tm1 from test_hst_msg;
Please note all the fucntions are existed and are successfully compiled.
It is giving compilation error.
function 'WDS' may not be used in sql.
do you have any remeady to anyone.
Thanks.

May need to add PRAGMA RESTRICT_REFERENCES compiler directive.

Similar Messages

  • How can I compile all functions, procedures and packages with a script?

    I need to compile all functions, procedures and packages of 5 schemas (users) with a script.
    How can I do it?
    Thanks!

    you can create a script to select all invalid objects in those schemas Since Oracle 8 introduced NDS this approach has struck me as a trifle old fashioned. It's much simpler to loop round the query in PL/SQL and use EXECUTE IMMEDIATE to fire off the DDL statements. No scripts, no muss, no fuss.
    Having said that, the problem with this approach and also with using DBMS_UTILITY.COMPILE_SCHEMA is that they do not compile all the invalid objects in dependency order. This may result in programs being invalidated by the subsequent compilation of dependencies. This is due to the introduction of Java into the database.
    The UTLRP script is much better, because it (usually) avoids cyclic references. But you still may need to run it more than once.
    In general it is better to avoid sledgehammer recompilations (like DBMS_UTILITY.COMPILE_SCHEMA, which starts by invalidating all the objects). If we have twenty invalid objects, nineteen of which are dependencies of the twentieth, we actually only need to recompile the master object, as recompiling it will trigger the recompilation of all the others.
    Cheers, APC

  • Form6i Builder (Form can't compile pll function)

    I'm upgrading our application from Form 4.5 to Form 6i. I open the pll and a form in the 6i Form Builder. When I try to run or compile the form, the builder complaints that all the function calls (where the functions are in the pll library) get errors. It says "identifier 'function_name' must be declared". I compile the pll without any error. If I link the pll to the form then the form compiles but can't run. Any suggestion? Thanks.

    I recompiled the pll already still have the same problem. I'm using the Windows version, not sure that has anything to do with it.
    I figure out that I have to attach the library in the form under "Attacted Libraries". When it askes me "non-portable directory specification and remove the path", I have to choose "no". Is this how it work?

  • Can a workflow process continue from form trigger?

    in my workflow project i have launched a workflow process from a form.in the process there is a notification from which i can open a form for further modification of data .currently i am continuing this particular process by pressing an 'updated' button in the notification after updating the data from form. if not updated it'll send that notification back again.can i do the same functionality through a button say 'updated' in the form called from the notification?
    ie i want to continue my process from my custom form called from notification,not by responding the notification's button itself .
    anyway i have completed the project succesfully.if anybody needs any help related to the functionalities noted above ( like 1.launching workflow from form or concurrent program
    2.opening(querying a custom form with particular data) a custom form from notification.
    3.submitting concurrent program from a workflow process ) can contact me at [email protected]

    When we consider that email is simply a communications protocol being leveraged by the workflow, it becomes clear that the problem most likely lies in the email enablement of your Archive list.  If your Archive list is indeed identical to the Requests
    list, then I would take a look at configuration for email on that list as it probably isn't configured correctly.  Additionally, you may wish to double check the email alias you're using in the workflow.  Sending email to the wrong email address
    is just a slip of the keyboard but can result in many hours of debugging.  Ultimately, I would recommend tracking the email through Exchange logs to see if it's received and sent correctly.
    I trust that answers your question...
    Thanks
    C
    |
    RSS |
    http://crayveon.com/blog |
    SharePoint Scripts | Twitter |
    Google+ | LinkedIn |
    Facebook | Quix Utilities for SharePoint

  • Can't use Export Functionality from form?

    Hi experts,
    I got a problem now, can anyone help me??
    This's my system information:
    APPLICATION: 11.5.10.2
    DATABASE: 9.2.0.6.0
    And the problem is:
    - Open 1 Form
    - File > Export
    - The progress bar update to 100%
    - The browser is opened
    And it suddenly disappear.
    I've checked metalink and see this note: 423261.1 How to Troubleshoot Forms Hanging Using Export Functionality
    I think it's fail in phase 4:
    4) Finally generate the URL, and display the file in the browser window by calling the Forms built-in web.show_document
    But i don't know how to solve this problem. Can anyone show me?
    Thank you so much

    Hi everybody,
    I solved my problem. In my case, it's because tablespace CTXD was not have enough free extent. You can check this note
    Information You Should Upload When Creating an SR for File Export and Attachments      Doc ID:      Note:427964.1
    Hope that helps,

  • How can I use MESSAGE function in forms 6i

    Hello
    I have an err_msg table that store collections of application message on utf8 database in one language not in english
    I have selected data from the err_msg table and put on variable .I want to display the message on the variable using MESSAGE function(MESSAGE(variable)).Unfortunately what i have seen on message dialog box is replaced characters like rectangles .
    What should I do please?

    Hi,
    We have the same problem in our project . In this case we are upgrading from an older version of forms (3.0) to 6i. The UE worked fine in the older version, but now we get a NON ORACLE ERROR. Our DLL is written in MS-VC++ project.
    We'd like to know whether , besides the common version and platform, you have also written the DLL using MS-VC++ ; otherwise please tell us .
    Regards,

  • Can't compile the pngencoder.swc form the sample/libpng

    Hi,
    I tried without success to compile the png lib port form the Alchemy's sample. Is it possible to find this file pngencoder.swc already compiled?
    Thanks
    Julien Félix

    I found it, thank you fT!

  • Call Stored Procedure from Forms 6i -- Urgent Plz...

    Dear All,
    I am first writing a stored procedure as:-
    CREATE OR REPLACE FUNCTION
    good_hire
    (birthdate_in IN DATE,
    reqsal_in IN NUMBER)
    RETURN BOOLEAN
    IS
    too_young BOOLEAN :=
    ADD_MONTHS
    (SYSDATE, -216) >
    birthdate_in;
    too_expensive BOOLEAN :=
    reqsal_in > fin.dept_bal;
    BEGIN
    RETURN NOT (too_young
    OR too_expensive);
    END;
    Now in my forms also i have the same function,which i defined in in my program unit i.e., with the same name good_hire,but with different parameters.
    If I want to call this stored procedure(good_hire)in my form
    I am writing this code in the pre-Insert trigger.
    IF good_hire
    (:newemp.birthdate,
    :newemp.proposed_sal)
    THEN
    SELECT empseq.NEXTVAL
    INTO :newemp.empno
    FROM dual;
    ELSE
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    Notice that i am sending bind variables from my form to the
    stored procedure. Now my question :
    1) Can i pass bind variables to the stored procedures from
    forms or is there any other way i can access the
    stored roceures from forms(Expecting a detailed answer) and
    from which triggers can I access the stored procedures(like pre-
    Insert here)?
    2) If at all I have the same parameters in my program unit
    function and with the same name good_hire, I know that the code
    in the pre-Insert trigger will call only the function in my
    program unit and not the stored procedure, but if I like to
    call my stored procedure instead of the local function good_hire
    then what should I do?
    2)As I said before if i have different parameters, for the
    stored procedure good_hire and local function good_hire and If
    I call good_hire from my pre-insert trigger .. Is it that the
    Forms will decide and call the Local function or stored
    procedure depending on the parameter list?
    I hope all my points are very clear.
    I am expecting the best and detailed answer for my
    Queries, I also hope these Quests will clear the doubts of many
    members in our esteemed group.
    Thnx in Advance...
    Regards
    siree....

    Dear Siree,
    Oh!! how many Questions? Each how much big??
    Ok First of all the answer to your first question.
    You can use the Stored procedures in the same way as the Forms procedures. You can pass bind variables to the stored procedures as well. You can also use the stored procedures in any triggers, I think there are no restrictions for that. The only thing is you should be connected to database while compiling the trigger where you are calling the stored procedure.
    Answer to your second question.
    You cannot direct Forms (I don't know about version 10g), untill 9i, you cannot tell forms to take the stored procedure and leave the local procedure. It will always take the local procedure, once a procedure is called. If not found locally then only it will go for the Stored procedures.
    For your third question.
    As I told you b4 forms searches for the procedure being called locally first, if locally present, does not go to the stored procedure. If declared by different paramaters in the stored procedure and it is called, then it will throw error (as it first searches for the name locally and if found will take up the one present locally and since that procedure is with different parameter, will throw up error). It is after all a stupid machine and can't think like us.
    Regards,
    Senthil .A. Perumal

  • Calling Stored procedure from Forms 6i

    Dear all,
    I have a stored procedure having INand INOUT parameters. I need to call it from Forms 6i triggers. Will you please tell me the syntax for calling stored procedure and stored function from Forms 6i and report 6i.
    Saibaldas
    [email protected]

    Just the same as for a local procedure, the only restrictions concern package public variables which are not visible from client side PL/SQL, and you probly want to keep the interfaces simple as client side PL/SQL (e.g. the Forms and Reports engines) don't support the same range of datatypes that the database does.

  • Using stored function in the Report Trigger

    I have faced this problem in Reports6.0.
    When a stored function is called in the after form trigger as
    below
    val := func1(abc,def);
    the report is hanging
    If I write like this i.e.,
    select func1(abc,def) into val
    from dual;
    it is working fine . Is this a bug ? Or Is there any reason
    behind it . Please Clarify !
    ThanX in Advance !
    Rajesh Mudiganti
    null

    Hi,
    You can define your own PF-STATUS and in that assign the function code for BACK button anything except 'BACK'.
    The code would somewhat look like this:
    SET PF-STATUS 'TEST'.
    write : itab-col1,
               itab-col2.
    in the PF-STATUS 'TEST', assign the function code to BACK button as 'BCK'.
    Now in your program you can use the event AT USER-COMMAND.
    In this you can handle the functionality of BACK button.
    Hope this helps.
    Regards,
    Himanshu

  • How can i return a SDO_GEOMETRY value in a Java-Stored-Function?

    For a example, Ive got a java-function witch returns a
    oracle.sdoapi.geom.Geometry like:
    public static Geometry GetQPoint(String sF_TABLE_NAME, long lFID)
    And now, Ill try to deploy this function as a PL-SQL stored-function like:
    GET_Q_POINT(
    F_TABLE_NAME IN VARCHAR2,
    FID IN NUMBER
    ) RETURN MDSYS.SDO_GEOMETRY;
    I can't deploy this above mentioned java-function with Oracle9i JDeveloper because oracle.sdoapi.geom.Geometry can not mapped in any PL-SQL data type.
    Is there any possibility to do it in a other way?
    Please help me.

    a quick example that takes as input a longitude and latitude,
    and return a point geometry in wgs 84:
    CREATE OR REPLACE FUNCTION get_geom (
         longitude IN          NUMBER,
         latitude     IN          NUMBER )
         RETURN mdsys.sdo_geometry
         DETERMINISTIC IS
         BEGIN
    RETURN mdsys.sdo_geometry (2001,8307,
              mdsys.sdo_point_type (longitude, latitude, NULL), NULL, NULL );
    END;
    other pl/sql examples:
    REM
    REM This function doesn't really do anything, but demonstrates some simple
    REM mechanisms on how to manipulate the array portion of the geometry object, and
    REM also how to write a function that returns a geometry object.
    REM
    REM The function demonstrates:
    REM 1) .EXTEND (there is also .DELETE)
    REM 2) .COUNT
    REM 3) Any function that returns an object (including the SDO_GEOMETRY object)
    REM should be declared as DETERMINSTIC (see below).
    REM
    create or replace function create_geometry return mdsys.sdo_geometry deterministic as
    temp_geom mdsys.sdo_geometry := mdsys.sdo_geometry (2002, 8307, null,
    mdsys.sdo_elem_info_array (1,2,1),
    mdsys.sdo_ordinate_array ());
    begin
    for i in 1 .. 10 loop
    temp_geom.sdo_ordinates.extend (2);
    temp_geom.sdo_ordinates(temp_geom.sdo_ordinates.count-1) := i;
    temp_geom.sdo_ordinates(temp_geom.sdo_ordinates.count) := i+1;
    end loop;
    return temp_geom;
    end;
    select create_geometry from dual;
    set linesize 80
    set pages 1000
    drop table TEST_MODIFY;
    create table TEST_MODIFY (geom mdsys.sdo_geometry);
    insert into TEST_MODIFY values
    (mdsys.sdo_geometry (2002, 8307, null,
    mdsys.sdo_elem_info_array (1,2,1),
    mdsys.sdo_ordinate_array (1,1, 2,2, 3,3, 4,4)));
    insert into TEST_MODIFY values
    (mdsys.sdo_geometry (2002, 8307, null,
    mdsys.sdo_elem_info_array (1,2,1),
    mdsys.sdo_ordinate_array (21,21, 22,22, 23,23, 24,24)));
    REM
    REM Select values before update.
    REM
    select geom from TEST_MODIFY;
    REM
    REM This PL*SQL block updates all the ordinates of a geometry by adding 10 to each x value
    REM and 20 to each y value.
    REM
    declare
    i NUMBER;
    cursor c1 is select geom, rowid
    from TEST_MODIFY;
    begin
    for r in c1 loop
    i := 1;
    while (i < r.geom.sdo_ordinates.count) loop
    r.geom.sdo_ordinates(i) := r.geom.sdo_ordinates(i) + 10;
    r.geom.sdo_ordinates(i+1) := r.geom.sdo_ordinates(i+1) + 20;
    i := i + 2;
    end loop;
    update TEST_MODIFY set geom = r.geom where rowid = r.rowid;
    end loop;
    end;
    REM
    REM Select values after update.
    REM
    select geom from TEST_MODIFY;

  • Can we write function in a trigger??

    Can we write function in a trigger??

    3360 wrote:
    810534 wrote:
    Can we write function in a trigger??This can be better phrased as two questions.
    Would we want to write a function in a trigger?
    Answer - No.
    Is there any problem that needs to be solved by writing a function in a trigger?
    Answer - No.Even better would be the same two questions with "a function in " removed.
    Same answers.

  • Can I Execute a function whose name is stored in a string variable?

    Can I execute a function whose name is stored in a string variable?
    Like
    Depending on the condition I will stroed the name of the function in a string variable. Then using that string variable i want to execute the function.
    String str=��
    iVal an int can take ne value
    Switch(iVal)
    Case 1:
    str=�test1()�;
    Case 2:
    str=�test2()�;
    I want whatever function name is in str to be executed.
    ----------------------------------------------------------------------------------

    For just executing a method or two, reflection might be easier than beanshell (or it might not). For executing entire scripts, beanshell will be preferable over reflection.
    (I assume beanshell uses reflection under the hood, but I've never bothered to peek.)

  • Can i invoke a function of a compiled script from java?

    Hi,
    Can i invoke a function of a 'CompiledScript' from java with parameters?
    TIA

    sabre150 wrote:
    I don't know about anyone else but I don't understand what you are trying to do.<Goldie mode>
    Bwahahaha, you are one of the oligarchs here and yet you don't know what Compiled Scripts are? Even Chaucer wrote about them, which the Queen of England told me when we shared a kebab in my working-class pals' kebab shop.
    </Goldie mode>

  • Can we call a stored procedure from a Trigger

    Hello Everyone,
    I need some help in writing the triggers in Oracle 10g Database.
    Can we call a stored procedure from a trigger?

    Can we call a stored procedure from a trigger? Yes. Why did you think we couldn't?
    Cheers, APC

Maybe you are looking for

  • " Questions on  SAP BO "

    Dear guys/Girls,                          CAN ANY BODY SEND ME THE ANSWERS FOR THE FOLLOWING QUESTIONS :: FOLLOWING ARE THE QUESTIONS : (1) HOW TO SEE THE PERFORMANCE OF BO REPORTS ? (2) WHAT IS THE ROW LEVEL SECURITY IN ADMINISTRATION OF SERVERS? (3

  • TS1717 I cannot open Itunes.

    Error message (translated): "The iTunes Library.itl can not be read, because it is created in a newer version of iTunes". I can not re-install iTunes as get error message that a newer version is already intstalled on my Mac. Pls help!

  • How to convert PDF file into binary using APIs of Adobe Workflow server?

    I m using the Adobe Workflow Server 6.2. I want to write a web services to convert PDF file into binary and embed this binary data with XML. I want to use the APIs (or libraries) of Adobe Workflow server but dont know abt the APIs or Libraries that c

  • Exec "alter system" and setup UTL_MAIL on Primary and replicate to Standby

    Hi! I have the next configuration: DGMGRL> show configuration verbose; Configuration - work_DataGuardConfig Protection Mode: MaxAvailability Databases: primary - Primary database physical1 - Physical standby database physical2 - Physical standby data

  • Service Provider Error in Dispute Management

    Dear Experts, Iam working on Dispute Mangement. I have created the dispute case and system generated the case number. But when iam displaying the case from SCASE the system is not displaying the case instead it is giving Service Provider error (Msg.