How to see created trigger description and SQl stament , to confirm new or old is used ?

I was looking for a SQL query which can display the Trigger description, like while creating a trigger what condition was used especially which key word used like new or old. The below SQL query helped me to know such details.

How to see created trigger description and SQl stament , to confirm new or old is used ?

Launch the SQL prompt and connect to you database as sysdba.

Then run the below commands to know about the trigger you created ...

SQL> drop trigger TSIN_TR;

Trigger dropped.

SQL> CREATE OR REPLACE TRIGGER TSIN_TR
  2  AFTER INSERT ON TARGET_SERVER
  3  FOR EACH ROW
  4  BEGIN
  5  INSERT INTO ADJUST_DISTRIBUTION (PACKAGE_ID) SELECT PACKAGE_ID FROM TARGETLIST_MAP T
  6  WHERE T.TARGETLIST_ID = :NEW.TARGETLIST_ID;
  7  END;
  8  /


Trigger created.

SQL> set linesize 200
SQL> set pagesize 500
SQL> desc user_source;
 Name                                                                                                              Null?    Type
 ---------------------------------------------------------------------------------------------------
 NAME                                                                                                                       VARCHAR2(30)
 TYPE                                                                                                                       VARCHAR2(12)
 LINE                                                                                                                       NUMBER
 TEXT                                                                                                                       VARCHAR2(4000)

SQL> select distinct type from user_source;

TYPE
------------
TRIGGER

SQL> select text from user_source where name='TSIN_TR' order by line asc;

TEXT
----------------------------------------------------------------------------------------------------
TRIGGER TSIN_TR
AFTER INSERT ON TARGET_SERVER
FOR EACH ROW
BEGIN
INSERT INTO ADJUST_DISTRIBUTION (PACKAGE_ID) SELECT PACKAGE_ID FROM TARGETLIST_MAP T
WHERE T.TARGETLIST_ID = :NEW.TARGETLIST_ID;
END;

7 rows selected.

SQL> select DESCRIPTION, TRIGGER_BODY from user_triggers where trigger_name = 'TSIN_TR';

DESCRIPTION
----------------------------------------------------------------------------------------------------
TRIGGER_BODY
--------------------------------------------------------------------------------
TSIN_TR
AFTER INSERT ON TARGET_SERVER
FOR EACH ROW
BEGIN
INSERT INTO ADJUST_DISTRIBUTION (PACKAGE_ID) SELECT PACKAGE_ID FROM TARGET

SQL >

Hope this helps ...

Read more


How to root android phones ?

The below is the procedure I tried to root my Motorola Milestone Android 2.1. Hope this will help the rest of the phones like HTC, Samsung etc.
I felt this is the simple and easy way to root your Android phone. Before going to implement this rooting procedure let's understand the need for it.
If you are not a gadget geek or you don't want to play with your phone, please stop reading this article here only and browse your other favorite site.
Though we all know that android is a Unix mobile OS built on Linux kernel, new users mind will flash a question that "with which user I am logged in to this OS?" . If you got this question you can directly follow the procedure to gain root privileges. Otherwise read through need for rooting.
Need for rooting :  
  1. By default Android login will be a non root user.
  2. So if you gain root privileges you can have full control over the hardware for which you spent lot of money.
  3. In other words rooting your phone will unveil the functionalities hidden by vendor which can be supported by costly hardware.
  4. Rooting Android OS helps you in tweaking the android OS functionalities.
  5. To install lattest Apps supported in next Version android you need to root your old Android version OS.
  6. Improving your keyboard interaction with possible tools.
  7. Bluetooth and Wifi tethering made available with rooting
  8. Install your new apps directly on to SD card instead of overloading the phone memory.

Like above there will lot more advantages if you take control of your phone which will be only possible by rooting your Android.

 
Now we are ready to root your phone and let's follow the below process.

Required :

 
  1. Android phone.
  2. USB connector
  3. superoneclick installer (Win 32 app)

 Where to download superoneclick ?

  1. Link1
  2. Link2
 Procedure :
  1. Install superoneclick application on your windows(32 bit) laptop.
  2. Enable USB debugging on your phone. To do this go to Settings->Applications->Development and enabling “USB Debugging“.
  3. Now connect your android phone using USB cable to laptop. (You should see notification on phone "USB debugging connected").
  4. Now after unziping the downloaded superoneclick.zip run the superoneclick.exe by clicking it.
  5. In the launched GUI you will see large buttons with "Root", "Allow non market Apps" etc.
  6. Click on Root..it will do it's job by running several steps and at last it will run "SU test". If it is success.  
  7. You finished rooting your phone.
  8. Disconnect your phone, disable "USB debugging" and reboot your phone.
  9. So from next time onwards if you install any app which requests root access will be notified through a message saying that app was granted super access.
P.S  : If you root your phone your warranty terms will expire. 
Related : [1] [2] [3]

Read more


K-Tube (Krishna's page official channel KTube)

Hi All,
This is my official Tube on which I livecast some of the important events ...

Leave ur valuable comments either in the website or below...

Read more


shell script to capture OS and hardware details along with DB2 level and Websphere version details

Here I would like post a simple shell script which will help to capture multiple details in a test environment like ..

  1. Linux OperatingSystem name Version and level
  2. OS Bit level 
  3. Hardware (Processor) bit level
  4. DB2 Version and level
  5. Websphere version and level
  6. Hostname / IP
    The important re-usable things in shell script includes extracting the jar file contents in to a desired directory, logging the stdout (Output of shell script) on to a file, validating the number of arguments passed to a shell script etc ....

    #!/bin/sh
    # Log the stdout to a file in parameter 2
    exec 1> $2
    if [ $# != "2" ]; then
    echo "Usage: checkEnv.sh db2inst1 /opt/myEnv.log"
    exit
    else
    > $2
    chmod 777 $2
    echo "DCD Build Tested in this environment"
    for i in `find / -name MgmtCenterVersion.jar`
    do
    echo $i
    done
    jar -xvf $i
    echo "DCD Version and build number:"
    cat com/ibm/tivoli/cds/MgmtCenterVersion.properties
    rm -rf com/ META-INF/
    echo -e "\n########################################################################## "
    echo "System information :"
    uname -a
    nslookup `hostname`
    echo "Linux Level:"
    cat /etc/issue
    echo "Operating system Bit Level :"
    getconf WORD_BIT
    echo "Processor Bit Level : "
    getconf LONG_BIT
    echo "Websphere version:"
    /opt/IBM/WebSphere/AppServer/bin/versionInfo.sh
    file=`pwd`/$2
    echo $file
    echo "DB2 Version :"
    su - $1 << kris db2level >> $file
    exit
    kris
    echo "End of Script"
    fi


    Modify it according to your requirements.

    Read more

    Popular Posts

    Enter your email address:

    Buffs ...

    Tags


    Powered by WidgetsForFree