Query: Can we write Triggers in a Packages??

Hi Al

Triggers provide a way of executing PL/SQL code on the occurrence of specific database events. For example, you can maintain an audit log by setting triggers to fire when insert or update operations are carried out on a table. The insert and update triggers add an entry to an audit table whenever the table is altered.
The actions that Informix Dynamic Server triggers perform are constrained to multiple insert, update, delete, and execute procedure clauses; whereas, Oracle allows triggers to execute arbitrary PL/SQL code. Oracle triggers are similar to stored procedures in that they can contain declarative, execution, and exception handling code blocks.if you mean trigger call package, yes!
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7004.htm
Edited by: Surachart (HunterX) on Jun 14, 2009 8:46 PM

Similar Messages

  • Crystal Report XI: Can you write your query in SQL instead of using the GUI

    Hello
      In crystal report version XI, can you write your query in sqlplus and then use the crystal report designer to build your report instead of using the GUI . I would like to be able to go database and show sql query and open that query and make changes directly there, is that possible on this version, if yes is there a setting somewhere? Please let me know.
    Thank you
    alpha

    Moved to Database forum.
    No you can no longer modify the SQL directly. Use a Command Object to enter the SQL directly.
    Thank you
    Don

  • Can I write a SELECT query on maintenance view?

    Hi,
    Can we write a select query on maint. view? If not what are the views on which we can write the select queries?

    hi,
    you can write select query for maintenance view, database view and projection view but not helpview as it is only intended for f4 help.
    reward if helpful
    prasanth

  • Can u write the following query without using group by clause

    select sp.sid, p.pid, p.name from product p, supp_prod sp
    where sp.pid= p.pid and
    sp.sid = ( select sid from supp_prod group by sid
    having count(*) =(select count(*) from product));
    thru this, we retrieving all the products delivered by the supplier.
    Can you write the following query without using the group by clause

      select sp.sid, p.pid, p.name
        from product p, supp_prod sp
       where sp.pid= p.pid the above query will still retrieve all the products supplied by the supplier. sub-query is not necessary.
    maybe if you can post some sample data and output will help us understand what you want to achieve.

  • How can i write two ?DDL in one query

    how can i write two ?DDL statment in one query?

    Issuing two DDL statements requires two edxecutions. Getting around it is possible by creating a procedure that issues the two DDL statements. But they would still have to be issues one at a time, but you would only have to write one statement to invoke it.

  • SQ01 DIsplay Problem (Can v write abap code ) Sql Query

    Hi
    Need help in SQL Query
    I generated one sql query which has the following output in general .
    Customer   name   description   amount
    asrq1  sharekhan      Amount payed      10
    asrq1  sharekhan     Amount Advance     20
    asrq1  sharekhan    Amount due             30
    but i need the output in the following way
    Customer  name  AMount payed     Amount  Advance                  Amount Due
    asrq1   sharekhan  10    20     30
    and iam new this sql query but came to know we can write code ..but iam unable to initiliaze to write
    a peace of code as i dont know what are the select-options defined ..i saw in the include but didnt got it
    % comes prefix of select-options,and iam unable to get he internal table which is displayed in the query .
    can anyone help me in this answers will be awarded points.

    First, I will suggest to go for ABAP report for this kinda requirement.
    If you really want to go for it through SQ01, even then you will have to write some ABAP to display the records in one row. You will need to create three custom fields.
    I will give Psudo for one field:
    Field Name := ZAmountPayed
    Select Amount_Payed into varAmountPayed from Table Where Emp# = '12345'
    ZAmountPayed := varAmountPayed
    Convert the above into relative ABAP code and create 2 more similar fields, and you should be all set.
    You have to know the table names and any other calculations to get the right data.

  • Can we have triggers that get fired when we Query a table?

    Hi All,
    What could be the pricise answer to the following question?
    1. Can we have triggers that get fired when we Query a table?
    2. What the relation of triggers and delete, truncate statement in one line?
    3. What is data modelling? Why is it necessary?
    4. Which are not mandatory but essential files in Oracle?
    Regards,
    AAK

    1. Can we have triggers that get fired when we Query a table?for INSERT, UPDATE and DELETE statement, yes
    for SELECT statement, no.
    Question 2 is not clear for me.
    Question 3 is very very general ...
    4 >Which are not mandatory but essential files in Oracle?
    all database files (initialization file, control files, datafiles, redo log files) are mandatory. What is not mandatory but considered as a (very) bad practice is
    to have only 1 control file and only 1 redo log group with 1 redo log file.

  • Can we write query for fomatted search without from clause

    can we write query for fomatted search without from clause as below.
    SELECT (($(u_amt)*14)/100)
    here U_amt is a UDF .I want to assign this to another field .
    Rgds,
    Rajeev

    Hi Rajeev,
    You can write query for FMS without from.  That is because you can omit it when you get value from active form by default.  The grammar of it is:
    Select $[$38.u_amt.0\] * 14/100 in your case if you have item type marketing document @line level.
    From View-System Information, you can get the info you need for your FMS query at the left bottom of your screen.
    Thanks,
    Gordon

  • CAn we write a query like this

    CAn we write a query like this?
    If not how can this be changed?
    select col1,col2,col3.col4
    from table 1
    where col1,col2 in(select col1,col2 from table2)

    Or it may be identical:
    SQL> CREATE TABLE t1 (c INT NOT NULL);
    Table created.
    SQL> CREATE TABLE t2 (c INT NOT NULL);
    Table created.
    SQL> INSERT ALL
      2  INTO t1 VALUES (rn)       
      3  INTO t2 VALUES (rn)
      4  SELECT rownum AS rn FROM user_tables WHERE rownum <= 15;
    30 rows created.
    SQL> BEGIN                                       
      2  DBMS_STATS.GATHER_TABLE_STATS(user,'T1');
      3  DBMS_STATS.GATHER_TABLE_STATS(user,'T2');
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM t1
      2  WHERE  EXISTS
      3         ( SELECT 1 FROM t2 WHERE c = t1.c )
      4 
    SQL> @xplan
    | Id  | Operation            |  Name       | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT     |             |    15 |    90 |     5 |
    |*  1 |  HASH JOIN SEMI      |             |    15 |    90 |     5 |
    |   2 |   TABLE ACCESS FULL  | T1          |    15 |    45 |     2 |
    |   3 |   TABLE ACCESS FULL  | T2          |    15 |    45 |     2 |
    Predicate Information (identified by operation id):
       1 - access("T2"."C"="T1"."C")
    SQL> SELECT * FROM t1
      2  WHERE  c IN
      3         ( SELECT c FROM t2 )
      4 
    SQL> @xplan
    | Id  | Operation            |  Name       | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT     |             |    15 |    90 |     5 |
    |*  1 |  HASH JOIN SEMI      |             |    15 |    90 |     5 |
    |   2 |   TABLE ACCESS FULL  | T1          |    15 |    45 |     2 |
    |   3 |   TABLE ACCESS FULL  | T2          |    15 |    45 |     2 |
    Predicate Information (identified by operation id):
       1 - access("T1"."C"="T2"."C")

  • Can't write cache file for while creating domain in soa 11.1.1.5 on HP-UX

    Hi,
    Installing SOA 11.1.1.5 on HP-UX and during domain creation/configuration I am getting the below errors
    **sys-package-mgr: can't write cache file for**
    and have lots of cache file errors for different packages
    Any idea what might be wrong and whats the cause of these errors and is it safe to ignore these errors if not what is the work arround. As I already looked at the below post but I don't find */var/tmp/wlstTemp* on my machine as suggested in the post below.
    SOA 11.1.1.5 install got can't write cache file
    So wondering if there's anything else I can do i.e. while creating or configuring a Domain pass some parameter to config.sh etc.
    Thanks

    Hi,
    I don't see python.cachedir in config.sh. Here is config.sh
    #!/bin/sh
    mypwd="`pwd`"
    # Determine the location of this script...
    # Note: this will not work if the script is sourced (. ./config.sh)
    SCRIPTNAME=$0
    case ${SCRIPTNAME} in
    /*)  SCRIPTPATH=`dirname "${SCRIPTNAME}"` ;;
      *)  SCRIPTPATH=`dirname "${mypwd}/${SCRIPTNAME}"` ;;
    esac
    # Set the ORACLE_HOME relative to this script...
    ORACLE_HOME=`cd "${SCRIPTPATH}/../.." ; pwd`
    export ORACLE_HOME
    # Set the MW_HOME relative to the ORACLE_HOME...
    MW_HOME=`cd "${ORACLE_HOME}/.." ; pwd`
    export MW_HOME
    # Set the home directories...
    . "${SCRIPTPATH}/setHomeDirs.sh"
    # Set the config jvm args...
    CONFIG_JVM_ARGS="${CONFIG_JVM_ARGS} -DCOMMON_COMPONENTS_HOME='${COMMON_COMPONENTS_HOME}'"
    export CONFIG_JVM_ARGS
    # Delegate to the main script...
    "${WL_HOME}/common/bin/config.sh" "$@"Thanks

  • How can i write the code in xml publisher desktop

    hi all
    How and where can i write the code in xml publisher desktop ???
    shall i know how to write xml code or what ??
    in which part can i write the code if i have more than one query ?

    hi dear
    Thanks for ur replay...
    What i mean is : i used to work on reports builder,so :
    1- i used to create more than query in some reports.
    2- create formulas ,procedures....
    NOW i want to create the same reports by using xml publisher desktop, so how can i do that...
    when i use {color:#ff0000}report wizard{color}, i can not or i don`t know how to use more than one query, create formulas or procedures.
    Please help me.
    Thanks again.

  • How can i write the floats value in Unitronics vision230 plc using modbus Ethernet

           How can i write the Float value in unitronics Vision230 PLC usinsg modbus ethernet (MB Ethernet Master Query.vi) I  read and write  the 32 bit register,  for e.g i want to write the 23.45 value on 2nd add. of MF. And MF register is 32 bit register. I  read and write  the 32 bit register.
    Narendra.
    Solved!
    Go to Solution.

     Thanks Amit for your solution but i can not use the string to write the value because  MB Ethernet master Query.vi only accepet the integer value its not take string values or any other i.e floats values etc.....otherwise i have  no problem to write or read the 32 bit register values , only problem is that the MB Ethernet master Query.vi only accept the integer value there4 how can write the float value.
    Narendra
    Message Edited by Artemistech on 01-30-2009 11:06 PM

  • Can we write X.25 program in Java

    hello friends
    can we write X.25 (protocal) program in Java , like we write socket program in Java.
    If we write means, kindly give a note, how to write.
    thank you
    seenu

    X.25 is connection oriented in that the sending party must initiate a connection to the receiving party. This connection
    establishes a virtual circuit that remains throughout the session. Because the virtual circuit is established at the time of
    connection, it is a switched virtual circuit (SVC).
    JTAPI is the set of classes, interfaces, and principles of operation that constitute a Java extension package in the javax.* name space. JTAPI implementations are the interface between Java computer telephony applications and telephony services, whether those services are implemented as software, as in the case of a soft PBX, or hardware. JTAPI defines the access to one or more of the following areas of functionality: Call Control, Telephone Physical Device
    Control,X.25
    my advice would be read and use JavaTM Telephony API
    it is at http://java.sun.com/products/jtapi/

  • Can we declare a Cursor in Package Specs?

    Dear buddies
    Can I Declare a Cursor in Package Specs so that I can call that cursor and use its data in some procedures and functions of package. Otherwise I've to write that cursor for every sub-program of a package which I don't feel a smart way to accomplish the job.

    Hi,
    here is a short example with the whole way down. Maybe the concept is getting clearer with this:
    first of all, if you do not have the table emp, here the DDL for this example.
    Be carefull, works only for german clients because of the names of months, sorry for that.
    CREATE TABLE EMP
    (EMPNO NUMBER(4) NOT NULL,
    ENAME VARCHAR2(10),
    JOB VARCHAR2(9),
    MGR NUMBER(4),
    HIREDATE DATE,
    SAL NUMBER(7, 2),
    COMM NUMBER(7, 2),
    DEPTNO NUMBER(2));
    set echo on
    INSERT INTO EMP VALUES
    (7369, 'SMITH', 'CLERK', 7902,
    TO_DATE('17-DEZ-1980', 'DD-MON-YYYY'), 800, NULL, 20);
    INSERT INTO EMP VALUES
    (7499, 'ALLEN', 'SALESMAN', 7698,
    TO_DATE('20-FEB-1981', 'DD-MON-YYYY'), 1600, 300, 30);
    INSERT INTO EMP VALUES
    (7521, 'WARD', 'SALESMAN', 7698,
    TO_DATE('22-FEB-1981', 'DD-MON-YYYY'), 1250, 500, 30);
    INSERT INTO EMP VALUES
    (7566, 'JONES', 'MANAGER', 7839,
    TO_DATE('2-APR-1981', 'DD-MON-YYYY'), 2975, NULL, 20);
    INSERT INTO EMP VALUES
    (7654, 'MARTIN', 'SALESMAN', 7698,
    TO_DATE('28-SEP-1981', 'DD-MON-YYYY'), 1250, 1400, 30);
    INSERT INTO EMP VALUES
    (7698, 'BLAKE', 'MANAGER', 7839,
    TO_DATE('1-MAI-1981', 'DD-MON-YYYY'), 2850, NULL, 30);
    INSERT INTO EMP VALUES
    (7782, 'CLARK', 'MANAGER', 7839,
    TO_DATE('9-JUN-1981', 'DD-MON-YYYY'), 2450, NULL, 10);
    INSERT INTO EMP VALUES
    (7788, 'SCOTT', 'ANALYST', 7566,
    TO_DATE('09-DEZ-1982', 'DD-MON-YYYY'), 3000, NULL, 20);
    INSERT INTO EMP VALUES
    (7839, 'KING', 'PRESIDENT', NULL,
    TO_DATE('17-NOV-1981', 'DD-MON-YYYY'), 5000, NULL, 10);
    INSERT INTO EMP VALUES
    (7844, 'TURNER', 'SALESMAN', 7698,
    TO_DATE('8-SEP-1981', 'DD-MON-YYYY'), 1500, 0, 30);
    INSERT INTO EMP VALUES
    (7876, 'ADAMS', 'CLERK', 7788,
    TO_DATE('12-JAN-1983', 'DD-MON-YYYY'), 1100, NULL, 20);
    INSERT INTO EMP VALUES
    (7900, 'JAMES', 'CLERK', 7698,
    TO_DATE('3-DEZ-1981', 'DD-MON-YYYY'), 950, NULL, 30);
    INSERT INTO EMP VALUES
    (7902, 'FORD', 'ANALYST', 7566,
    TO_DATE('3-DEZ-1981', 'DD-MON-YYYY'), 3000, NULL, 20);
    INSERT INTO EMP VALUES
    (7934, 'MILLER', 'CLERK', 7782,
    TO_DATE('23-JAN-1982', 'DD-MON-YYYY'), 1300, NULL, 10);2. Package Spec:
    create or replace
    package test_cursor as
      --Type for the returncode of the function
      TYPE typ_emp IS TABLE OF emp%rowtype;
      --Array for fetching, of course also possible in the body
      t_emp typ_emp;
      --function wich returns the array from fetching the cursor
      function get_emp return typ_emp;
      --function for manupilation data retrieved by the function
      PROCEDURE man_emp;
    end test_cursor;3. Package Body
    create or replace
    package body test_cursor as
      FUNCTION get_emp RETURN typ_emp AS
      cursor c_emp is select * from emp;
      BEGIN
        open c_emp;
        fetch c_emp BULK COLLECT INTO t_emp;
        CLOSE c_emp;
        --t_emp returns the whole table set from emp
        return t_emp;
      end get_emp;
      PROCEDURE man_emp AS
      --just for not confusing names, is the same as t_emp of course
      v_emp_array typ_emp;
      BEGIN
        --call the function and retrieve the whole data set
        v_emp_array := get_emp;
        --now manipulate the data, in this case just write the names to the calling client
        FOR rec IN v_emp_array.FIRST .. v_emp_array.LAST
        loop
          dbms_output.put_line(v_emp_array(rec).ename);
        end loop;
      end man_emp;
    end test_cursor;4. Calling the procedure
    SET serveroutput ON
    exec test_cursor.man_emp;5. And this is the result:
    anonymer Block abgeschlossen
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLERPlease be aware, this is just for demonstration purpose, of course it makes no sense to display the names this way. But how to call a funktion returning arrays with datasets from fetching cursors is shown here.
    Hth
    Joerg

  • SOA 11.1.1.5 install got can't write cache file

    Hi,
    I installed 2 node cluster of SOA 11.1.1.5 on linux and during domain configuration I got errors i.e.
    **sys-package-mgr: can't write cache file for**
    Installation was done and all the servers start/stop fine am able to deploy the processes, am able to access all the urls fine everything coming up fine BAM, SOA, OSB etc . Just wondering if the error above have any effect on the installation or any piece that might not work. As I have already did the installation and ignored those errors above so just wanted to see if anything I need to look for.
    Thanks

    Hi,
    It's a cluster install and took sometime to do the full install so it will be a pain to re-install everything over. Currently have tested the processes and seems to be working fine.
    Also I don't find
    /var/tmp/wlstTemp
    I do see wlstTemp appended with linux users who did Oracle SOA install.
    Also in-future when creating a new environment besides the above chmod 777 on /var/tmp/wlstTemp is there any parameter we can supply when running config.sh. I read some where that in-order to get by these errors at the time of domain creation we can also pass some parameter.
    Thanks

Maybe you are looking for

  • How do i keep home sharing on on my apple tv after cosing my computer

    I want to be able to keep a movie going on my apple tv and also have my laptop closed but whenever i do that my apple tv says i need to turn on home sharing

  • Adobe Interactive Forms Runtime Error: Unknown host

    I have installed the NW2004s sneak preview, configured the J2EE services for Adobe Interactive Forms, and am trying to test the TravelRequest sample web dynpro  that uses interactive form. I get the following runtime error: com.sap.tc.webdynpro.clien

  • I updated my iphone to the ios6 and now it wont work.

    i updated my iphone to the ios6... and now it wont work at all. it wont even turn on, it keeps going back and forth between the black screen and then the apple mark pops up for a few seconds, and then turns back to the black screen again... and that

  • How to attach document using Generic Object Service

    Hi all, How can i create attachment to the parked invoice using Generic Object services? i want function modules which are used to do it. Actually I want to do this from the business object method. I am having word document as one of the workitem ste

  • JSTL unicode xml does not display after x:parse call

    I am trying to display an xml file on the web using JSTL xml tags. The file is encoded in utf-8 containing ancient Greek characters (x1f92, etc.). The file displays properly from a servlet + xslt (http://163.1.169.41/testapp), but I want to use JSTL.