Basic help needed creating a trigger

I'm completely new to SQL programming altogether, and I'm trying to set up a trigger that will make some checks before adding a new row to a given table. I am trying to do this because I need to enforce a CONSTRAINT that checks whether the dates entered for 'deadline' and 'startDate' are greater than sysdate and less than (sysdate + 365), and I found out that you cannot reference sysdate from a CONSTRAINT. Therefore I am now attempting to do this using a trigger, but I don't really know how to do this. Here is the sql code used to create the table:
-- PLACEMENT TABLE
DROP TABLE placement;
CREATE TABLE placement
contactId Int,
placementId Int,
position VARCHAR(60),
description CLOB,
lengMonths Int,
salary Number(7,2),
deadline DATE,
startDate DATE,
addrLine1 VARCHAR(120),
postCd VARCHAR(10)
And here is my attempt at creating the trigger that will only allow the deadline and startDate to be entered if they satisfy the following check: (sysdate < deadline/startDate <= sysdate+365)
CREATE OR REPLACE TRIGGER trg_deadline_low BEFORE INSERT OR UPDATE OF deadline ON placement
BEGIN
IF :deadline <= SYSDATE THEN
ROLLBACK;
END IF;
END;
CREATE OR REPLACE TRIGGER trg_deadline_high BEFORE INSERT OR UPDATE OF deadline ON placement
BEGIN
IF :deadline > SYSDATE + 365 THEN
ROLLBACK;
END IF;
END;
If possible, I would like for these triggers to display an error rather than just using ROLLBACK, but I'm not sure how! At the moment, these triggers do not work at all; I get an error message "Warning: Trigger created with compilation errors." when I attempt to create the triggers in the first place.
Can anyone tell me why I am seeing this error when trying to implement the triggers? And if anyone could also improve on my amateur attempt at coding a trigger, then that would be great! Thanks for any help!

Oops!
Nicolas, Thank you for correcting my mistake.
SQL> edit
Wrote file afiedt.buf
1 CREATE TABLE placement
2 (
3 contactId Int,
4 placementId Int,
5 position VARCHAR(60),
6 description CLOB,
7 lengMonths Int,
8 salary Number(7,2),
9 deadline DATE check (deadline between sysdate and sysdate+365),
10 startDate DATE,
11 addrLine1 VARCHAR(120),
12 postCd VARCHAR(10)
13* )
SQL> /
deadline DATE check (deadline between sysdate and sysdate+365),
ERROR at line 9:
ORA-02436: date or system variable wrongly specified in CHECK constraint
SQL> edit
Wrote file afiedt.buf
1 CREATE TABLE placement
2 (
3 contactId Int,
4 placementId Int,
5 position VARCHAR(60),
6 description CLOB,
7 lengMonths Int,
8 salary Number(7,2),
9 deadline DATE check (deadline between to_date('2007-03-21','yyyy-mm-dd') and to_date('2008-03-21','yyyy-mm-dd')
10 startDate DATE,
11 addrLine1 VARCHAR(120),
12 postCd VARCHAR(10)
13* )
SQL> /
Table created.
On the contrary, I think that OP want an error instead of rollback : "I would like for these triggers to display an error rather than just using ROLLBACK"Ah, I had misread additionally. Sorry.

Similar Messages

  • Need Help in creating this trigger

    I need your help to create this trigger. I need to set the default fl in this table depending on various conditions:
    If there is only one indvl with end date as null then set the default_pk column for that indvl as 'Y'
    ELSE
    If there are multiple indvl_pks in this table with NULL end date then set the default_fl column to 'Y' for the indvl_pk with the earliest start date .
    ELSE if there are multiple indvls with same start date then set the dflt_fl to 'Y' with the minimum br_pk
    I am unable to get this to work due to the mutating trigger problem.
    For example in this one rows with emplt_pk with 1001 and 1003 will be set to 'Y'.
    create table emplt
    emplt_pk number,
    indvl_pk number,
    start_dt date,
    end_dt date,
    lct_fl char(1),
    sup_fl char(1),
    br_pk number,
    nro_pk number,
    default_fl
    char(1) default 'N' );
    INSERT
    INTO emplt
    values(1001, 101, to_date ('01-01-2005', 'MM-DD-YYYY' ), NULL, 'Y','N' ,123,NULL,NULL );
    INSERT INTO emplt values(
    1002, 101, to_date ('02-01-2005', 'MM-DD-YYYY' ), NULL, 'Y','N' ,NULL,0001,NULL );
    INSERT INTO emplt values(
    1003, 102, to_date ('02-01-2005', 'MM-DD-YYYY' ), NULL, 'Y','N' ,NULL,0001,NULL );
    Thanks in advance

    the Easy Tabs could be useful for your requirement
    http://usermanagedsolutions.com/SharePoint-User-Toolkit/Pages/Easy-Tabs-v5.aspx
    /blog
    twttr @esjord

  • Help with create a trigger

    hello all
    i have a 4 tables and i would like to create a trigger in a tables
    CREATE TABLE CLIENT_INFO
    ( CLIENT_NO     VARCHAR2(10) CONSTRAINT CLIENT_INFO_CNO_PK PRIMARY KEY,
      CLIENT_NAME   VARCHAR2(50) NOT NULL,
      ORDERS_AMOUNT NUMBER(7)
    CREATE TABLE STOCK_INFO
    ( ITEM_NO              VARCHAR2(10) ,
      ITEM_DESCRIPTION     VARCHAR2(100),
      SELLING_PRICE        NUMBER(6),
      QTY_IN_HAND          NUMBER(6)    NOT NULL,
      CONSTRAINT ITEM_NUM_SPRICE_PK PRIMARY KEY (ITEM_NO , SELLING_PRICE)
    CREATE TABLE ORDER_INFO
    ( ORDER_NO     VARCHAR2(10) CONSTRAINT ORDER_INFO_ONO_PK PRIMARY KEY,
      CLIENT_NO    VARCHAR2(10),
      ORDER_DATE   DATE,
      ORDER_AMOUNT NUMBER(6),
      CONSTRAINT ORDER_INFO_CNO_FK  FOREIGN KEY (CLIENT_NO) REFERENCES CLIENT_INFO (CLIENT_NO)
    CREATE TABLE ORDER_LINES
    ( ORDER_NO       VARCHAR2(10),
      ITEM_NO        VARCHAR2(10),
      LINE_QTY       NUMBER(6),
      SELLING_PRICE  NUMBER(6),
      TOTAL_PRICE    NUMBER(6)
    ALTER TABLE ORDER_LINES
    ADD  CONSTRAINT ORDER_LINES_ONO_FK FOREIGN KEY (ORDER_NO) REFERENCES ORDER_INFO (ORDER_NO);
    ALTER TABLE ORDER_LINES
    ADD  CONSTRAINT ORDER_LINES_INO_FK FOREIGN KEY (ITEM_NO) REFERENCES STOCK_INFO (ITEM_NO);i would like to create this trigger
    1-order_amount in table 3 due to any (insert,update or delete ) in total_price in table 4
    2-orders_amount in table 1 due to any (insert,update or delete ) in order_amount in table 3
    i would like to ask another quotations r this relations in good for tables
    thank's all

    >
    plz i need a help to create a trigger
    >
    Using a trigger won't solve your problem. You are trying to use child table triggers to maintain parent table information.
    There is no transaction control to ensure that the parent table will be updated with the correct information.
    One process could update child record 1 while another process is updating child record two. Each process will see a different total if they try to compute the sum of all child records since the first process will see the 'old' value for the child record that the second process is updating and the second process will the 'old' value for the child record that the first process is updating.
    So the last process to commit could store the wrong total in the parent record withoug an exception ever being raised.
    See Conflicting Writes in Read Committed Transactions in the Database Concepts doc
    http://docs.oracle.com/cd/E14072_01/server.112/e10713/consist.htm
    >
    some one ask me this quotation in interview
    and im told him i can't understand this structure for database he said just do it
    >
    And I would tell them that using a trigger is not the right way to accomplish that since it could invalidate the data concurrency and data consistency of the tables.
    Sometimes you just have to tell people NO.

  • Help on creating update trigger(urgent)

    Hii all,
    I have a situation like this
    I have 10 different tables like a,b,c,d,e,f
    But i have same columns in all tables
    like
    updated_by,
    updated_date
    I need to create a procedure and call that procedure in update triggers for all tables
    Can anybody help
    In creating Procedure and trigger
    Thanks

    There is nothing wrong with the trigger, but the procedure is another story. You cannot do DML on the table that is firing the trigger inside the trigger, that is the mutating table error.
    I am not really sure why you are doing the DML anyway. you have defined a BEFORE UPDATE trigger on k_constituent, and the procedure checks for the existence of a row in the same table where the currt_user_id field is the same as the id of the user making the update. Without knowing anything about the application, this implies one of two things to me. Either you are trying to make sure the row to be updated does exist, or, this is some kind of security check.
    If it is the first, then it is unneccessary, since the before update trigger will only fire if the row to be updated exists viz.
    SQL> CREATE OR REPLACE TRIGGER jt_bu
      2  BEFORE UPDATE ON JTEST
      3  FOR EACH ROW
      4
      5  BEGIN
      6     :new.updby := USER;
      7     :new.updon := SYSDATE;
      8     DBMS_OUTPUT.Put_Line('Trigger fired ok');
      9  END;
    10  /
    Trigger created.
    SQL> SELECT * FROM jtest;
            ID DESCR      UPDBY                     UPDON
             1 YES        OPS$ORACLE                24-APR-03
             2 NEWDES     OPS$ORACLE                23-APR-03
             3 ORACLE     OPS$ORACLE                23-APR-03
    SQL> UPDATE jtest SET descr = 'NO' WHERE id = 1;
    Trigger fired ok
    1 row updated.
    SQL>  UPDATE jtest SET descr = 'NO' WHERE id = 5;
    0 rows updated.If you are doing this for security, then you are way too late. The user should not be in the database doing updates if they are not a valid user (whatever valid user means to you).
    As a side note, you do realize that if there is more than one record in k_constituent with currt_user_id = updating user, then the procedure will not set update_date and update_by?
    TTFN
    John

  • Help needed creating a linked list program

    I have been trying to create a linked list program that takes in a word and its definition and adds the word to a link list followed by the definition. i.e. java - a simple platform-independent object-oriented programming language.
    the thing is that of course words must be added and removed from the list. so i am going to use the compareTo method. Basically there a 2 problems
    1: some syntax problem which is causing my add and remove method not to be seen from the WordList class
    2: Do I HAVE to use the iterator class to go thru the list? I understand how the iterator works but i see no need for it.
    I just need to be pointed in the right direction im a little lost.................
    your help would be greatly appreciated i've been working on this over a week i dont like linked list..........
    Here are my 4 classes of code........
    * Dictionary.java
    * Created on November 4, 2007, 10:53 PM
    * A class Dictionary that implements the other classes.
    * @author Denis
    import javax.swing.JOptionPane;
    /* testWordList.java
    * Created on November 10, 2007, 11:50 AM
    * @author Denis
    public class Dictionary {
        /** Creates a new instance of testWordList */
        public Dictionary() {
            boolean done=false;
    String in="";
    while(done!=true)
    in = JOptionPane.showInputDialog("Type 1 to add to Dictionary, 2 to remove from Dictionary, 3 to Print Dictionary, and 4 to Quit");
    int num = Integer.parseInt(in);
    switch (num){
    case 1:
    String toAdd = JOptionPane.showInputDialog("Please Key in the Word a dash and the definition.");
    add(toAdd);
    break;
    case 2:
    String toDelete = JOptionPane.showInputDialog("What would you like to remove?");
    remove(toDelete);
    break;
    case 3:
    for(Word e: list)
    System.out.println(e);
    break;
    case 4:
    System.out.println("Transaction complete.");
    done = true;
    break;
    default:
    done = true;
    break;
       }//end switch
      }//end while
    }//end Dictionary
    }//end main
    import java.util.Iterator;
    /* WordList.java
    * Created on November 4, 2007, 10:40 PM
    *A class WordList that creates and maintains a linked list of words and their meanings in lexicographical order.
    * @author Denis*/
    public class WordList{
        WordNode list;
        //Iterator<WordList> i = list.iterator();
        /*public void main(String [] args)
        while(i.hasNext())
        WordNode w = i.next();
        String s = w.word.getWord();
        void WordList() {
          list = null;
        void add(Word b)
            WordNode temp = new WordNode(b);
            WordNode current,previous = null;
            boolean found = false;
            try{
            if(list == null)
                list=temp;
            else{
                current = list;
                while(current != null && !found)
                    if(temp.object.getWord().compareTo(current.object.getWord())<0)
                        found = true;
                    else{
                    previous=current;
                    current=current.next;
                temp.next=current;
                if(previous==null)
                    list=temp;
                else
                    previous.next=temp;
                }//end else
            }//end try
            catch (NullPointerException e)
                System.out.println("Catch at line 46");
        }//end add
    /*WordNode.java
    * Created on November 4, 2007, 10:40 PM
    *A class WordNode that contains a Word object of information and a link field that will contain the address of the next WordNode.
    * @author Denis
    public class WordNode {
        Word object;//Word object of information
        WordNode next;//link field that will contain the address of the next WordNode.
        WordNode object2;
        public WordNode (WordNode wrd)
             object2 = wrd;
             next = null;
        WordNode(Word x)
            object = x;
            next = null;
        WordNode list = null;
        //WordNode list = new WordNode("z");
        Word getWord()
            return object;
        WordNode getNode()
            return next;
    import javax.swing.JOptionPane;
    /* Word.java
    * Created on November 4, 2007, 10:39 PM
    * A class Word that holds the name of a word and its meaning.
    * @author Denis
    public class Word {
        private String word = " ";
        /** Creates a new instance of Word with the definition*/
        public Word(String w) {
            word = w;
        String getWord(){
            return word;
    }

    zoemayne wrote:
    java:26: cannot find symbol
    symbol  : method add(java.lang.String)
    location: class Dictionary
    add(toAdd);this is in the dictionary class
    generic messageThat's because there is no add(...) method in your Dictionary class: the add(...) method is in your WordList class.
    To answer your next question "+how do I add things to my list then?+": Well, you need to create an instance of your WordList class and call the add(...) method on that instance.
    Here's an example of instantiating an object and invoking a method on that instance:
    Integer i = new Integer(6); // create an instance of Integer
    System.out.println(i.toString()); // call it's toString() method and display it on the "stdout"

  • Help Needed Created Standalone Network for iTunes DJ

    I use my MBP to manage backing tracks for a band. I would like to use iTunes DJ for requests from the audience via wireless connection via *iPhone/iPod Touch Remote app*. I would use this option in conjunction with a printed song list and small request cards (for those who don't have iPhones).
    I can't connect to an existing network as most venues do not have wireless. I would like to set up my MBP as a wireless base station that can be accessed via an iPhone/iPod Remote app. Besides, I would prefer to have a network that echo's the band's name.
    I know I have to use the "*Create computer-to-computer Networks*", but I am unsure of what settings I need to get the network working.
    I will use Locations to quickly activate the MBP as the base station.
    Any help or suggestion setting up my MBP as a wireless base station would be greatly appreciated.
    TIA

    TSG wrote:
    yep, tried changing cables....even upto cat6!!! no joy.
    starting to do my head in now.....might call in a network person/tech but i hate the idea of being charged to see him repeat all i have already done!
    Agreed. I'd keep at it yourself. I guarantee it will be something simple.
    what are the benefits of a switcher? (never used one before) any recomends?
    A switch is just like a hub, except that instead of always sending packets to your entire network, it only sends them where they need to go. The benefits grow with the size and speed of your network. Switches used to be much more expensive than hubs but not any more. Normally I'd recommend almost any Linksys device, but in this case dlink seems to have a better one:
    http://www.amazon.com/D-Link-DGS-2205-5-port-Desktop-Switch/dp/B000FIVDIA
    Again, I don't think your dlink hub is responsible for this dramatic bottleneck though.

  • Help needed, Createing Dynamic User input

    Hello,
    I am attempting to create some dynamic user input by "predicting" what the user requires in a text box.
    For example if the user enters "Smi" I have a select list pop up which gives the user all options that begin with "Smi".
    I am able to achieve the popups but the interface is quite jerky and not terribly responsive I am trying to solve this by using a thread which starts and stops when new input is received but it is still not quite right.
    The program uses a Sorted TreeSet to hold the data (I thought this would give me a quick search time) and a simple interface at this stage.
    Any help would be fantastic
    Thanks in advance :P
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.text.*;
    import java.util.*;
       /** This program represents part of a larger user interface for allowing the
       user to select data from a file or database.
       <p>
       When the program starts up, it will read in data from a given file, and hold
       it in some type of container allowing rapid access.
       <p>
       The user may then type in the first few letters of the surname of a person,
       and this program should immediately present in a popup dialog the names which
       match.  The user will be able to click on one of the names in the popup and
       that will cause all data about that person to be displayed in the JTextArea
       at the bottom of the window.
       <p>
       This program requires the FormLayout.class, FormLayout$Placement.class, and
       FormLayout$Constraint.class files in the same directory
       (folder) or in its classpath.  These is provided separately.
    class PartMatch extends JFrame implements Runnable
                        /** Close down the program. */
       JButton quitbtn;
                        /** Field for the surname. */
       JTextField namefld;
                        /** Full details of the person(s). */
       JTextArea  results;
                        /** Popup dialog to display the names and addresses which
                        match the leading characters given in namefld. */
       Chooser matches;
                      /** Default background color for a window. */
       final static  Color            defBackground = new Color(0xD0C0C0);
                      /** Default foreground color for a window. */
       final static  Color            defForeground = new Color(0x000000);
                      /** Default background color for a field */
       final static  Color            fldBackground = new Color(0xFFFFFF);
                      /** Default background color for a button */
       final static  Color            btnBackground = new Color(0xF0E0E0);
       final static  Color            dkBackground = new Color(0xB0A0A0);
                      /** Larger font */
       final static  Font bold = new Font("Helvetica", Font.BOLD, 30);
       TreeSet members;
       String input;
       String[] found;
       public static void main(String arg[])
          UIManager.put("TextField.background",fldBackground);
          UIManager.put("TextField.foreground",defForeground);
          UIManager.put("TextField.selectionBackground",btnBackground);
          UIManager.put("TextArea.background",fldBackground);
          UIManager.put("TextArea.foreground",defForeground);
          UIManager.put("TextArea.selectionBackground",btnBackground);
          UIManager.put("Panel.background",defBackground);
          UIManager.put("Label.background",defBackground);
          UIManager.put("Label.foreground",defForeground);
          UIManager.put("Button.background",btnBackground);
          UIManager.put("Button.foreground",defForeground);
          UIManager.put("CheckBox.background",defBackground);
          UIManager.put("ScrollBar.background",defBackground);
          UIManager.put("ScrollBar.thumb",btnBackground);
          UIManager.put("ComboBox.background",btnBackground);
          UIManager.put("ComboBox.selectionBackground",dkBackground);
          PartMatch trial = new PartMatch(arg);
       public PartMatch( String [] arg )
          super("Part Match");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          Container cpane = getContentPane();
          FormLayout form = new FormLayout(cpane);
          JLabel lab1 = new JLabel("Fetch details") ;
          lab1.setFont( bold );
          form.setTopAnchor( lab1, 4 );
          form.setLeftAnchor( lab1, 4 );
          JLabel lab2 = new JLabel("Surname: ") ;
          form.setTopRelative( lab2, lab1, 4 );
          form.setLeftAlign( lab2, lab1 );
          namefld = new JTextField( 30 );
          form.setBottomAlign( namefld, lab2 );
          form.setLeftRelative( namefld, lab2, 4 );
          namefld.addCaretListener( new CaretListener()
             public void caretUpdate(CaretEvent e)
                 showMatches();
          quitbtn = new JButton( "Quit" );
          quitbtn.addActionListener( new ActionListener()
             public void actionPerformed(ActionEvent e)
                quitProcessing();
          form.setBottomAlign( quitbtn, namefld );
          form.setLeftRelative( quitbtn, namefld, 15 );
          results = new JTextArea( 10,50 );
          results.setEditable(false);
          JScrollPane jsp = new JScrollPane( results,
                                     JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
          form.setTopRelative( jsp, lab2, 6 );
          form.setLeftAlign( jsp, lab2 );
          form.setBottomAnchor( jsp, 5 );
          form.setRightAnchor( jsp, 5 );
          form.setRightAnchor( quitbtn, 5 );
          matches = new Chooser( this );
          //matches.setUndecorated(true);
          pack();
          setVisible(true);
          namefld.requestFocus();
          if (arg.length > 0) init(arg[0]);
          else init("triathlon.txt"); //<<<<<<<<<<<<<<<< Place the default filename here
          /** Called once only, at the end of the constructor, to read the data
            * from the membership file.
       public void init( String fname )
          members = new TreeSet();
           try {
               FileReader fr = new FileReader(new File (fname));
               Scanner scan = new Scanner(fr);
               trimember cmem;
               String cLine, eTag, memberNo, first, last, gender, yob, tel ,addr,
                       club;
               while(scan.hasNextLine())
                   cLine = scan.nextLine();
                   Scanner scan2 = new Scanner(cLine);
                   scan2.useDelimiter(";");
                   eTag = scan2.next().trim();
                   memberNo = scan2.next().trim();
                   first = scan2.next().trim();
                   last = scan2.next().trim();
                   gender = scan2.next().trim();
                   yob = scan2.next().trim();
                   tel = scan2.next().trim();
                   addr = scan2.next().trim();
                   club = scan2.next().trim();
                   cmem = new trimember(eTag, memberNo, first, last, gender, yob,
                           tel, addr, club);
                   members.add(cmem);
           catch (FileNotFoundException ex)
               results.append("Sorry can't find the input file\n");
               results.append("Please check file name and location and try again");
               ex.printStackTrace();
          /** Called every time there is a change in the contents of the text field
            * namefld.  It will first clear the text area.  It then needs to search
            * through the container of data to find all records where the surname
            * starts with the characters that have been typed.  The names and
            * addresses need to be set up as strings and placed in
            * an array of Strings.  This can be placed in the "matches" window and
            * displayed for the user, inviting one to be selected.
            * <p>
            * The performance of this is very important.  If necessary, it may be
            * necessary to run as a separate thread so that the user interface is
            * not delayed.  It is essential that the user be able to type letters at a
            * reasonable speed and not have the keystroke processing held up by
            * previous text.
       public void showMatches( )
           run();
                // First clear the text area
          //results.setText("");
                // Determine the leading characters of the surname that is wanted
                input = namefld.getText();
                // Locate the data for this name, and display each matching item
                //  in the JTextArea ...
                // Example of how to set the data in the popup dialog
          matches.list.setListData(found);
          matches.pack();   // resize the popup
                // set the location of the popup if it is not currently visible
          if ( ! matches.isVisible())
             Dimension sz = matches.getSize();
             Point mouse = getMousePosition();
             Point framepos = getLocation();
             int x=0, y=0;
             if (mouse == null)
                Point pt = results.getLocation();
                x = pt.x + 20 + framepos.x;
                y = pt.y + 20 + framepos.y;
             else
                x = mouse.x - 2 + framepos.x;
                y = mouse.y - 2 + framepos.y;
             matches.setLocation(x,y);
          matches.setVisible(true);
          namefld.requestFocus();
          /** Perform any final processing before closing down.
       public void quitProcessing( )
          // Any closing work.  Then
          System.exit(0);
        public void run()
            ArrayList<String> foundit = new ArrayList<String>();
            System.out.println(input);
            if(input != null)
            Iterator it = members.iterator();
            while(it.hasNext())
               trimember test = (trimember) it.next();
               if (test.last.startsWith(input))
                   foundit.add(test.last +", "+ test.first);
            found = new String[foundit.size()];
            for(int i=0; i<foundit.size();i++)
                found[i] = foundit.get(i);
         /** A window for displaying names and addresses from the data set which
          match the leading characters in namefld.
          <p>
          This will automatically pop down if the user moves the mouse out of the
          window.
          <p>
          It needs code added to it to respond to the user clicking on an item in
          the displayed list. */
       class Chooser extends JWindow
                /** To display a set of names and addresses that match the leading
                characters of the namefld text field. */
          public JList list = new JList();
          Chooser( JFrame parent )
             super( parent );
             Container cpane = getContentPane();
             cpane.addMouseListener( new MouseAdapter()
                public void mouseExited(MouseEvent e)
                   Chooser.this.setVisible(false);
             cpane.add("Center",list);
             list.addListSelectionListener( new ListSelectionListener()
                public void valueChanged(ListSelectionEvent e)
                   Chooser.this.setVisible(false);
                   System.out.println("ValueChanged");
                   // First clear the text area
                   results.setText("");
                   String in = (String) list.getSelectedValue();
                   System.out.println("Selected Value was : "+in);
                   String[] inlf = in.split(", ");
                   System.out.println("inlf[0]:"+inlf[0]+" inlf[1]:"+inlf[1]);
                   results.append("Surname \tFirst \teTag \tMemberNo \tSex \tYOB " +
                           "\tTel \tAddress \t\t\tClub\n");
                   Iterator it = members.iterator();
                   while(it.hasNext())
                       trimember test = (trimember) it.next();
                       if (test.last.equals(inlf[0])&&test.first.equals(inlf[1]))
                           results.append(test.toString()+"\n");
                   namefld.requestFocus();
          public class trimember implements Comparable
           String eTag;
           public String memberNo;
           public String first;
           public String last;
           String gender;
           String yob;
           String tel;
           String addr;
           String club;
           public trimember(String eT, String me, String fi, String la,
                   String ge, String yo, String te, String ad, String cl)
               eTag = eT;
               memberNo = me;
               first = fi;
               last = la;
               gender = ge;
               yob = yo;
               tel = te;
               addr = ad;
               club = cl;         
           //To String method to output string of details
           public String toString()
               return last + "\t" + first + "\t" + eTag + "\t" +
                       memberNo + "\t" + gender + "\t" + yob + "\t"+ tel + "\t" +
                       addr + "\t" + club;
           //Compare and sort on Last name
           public int compareTo(Object o)
               trimember com = (trimember) o;
               int lastCmp = last.compareTo(com.last);
               int firstCmp = first.compareTo(com.first);
               int memCmp = memberNo.compareTo(com.memberNo);
               if (lastCmp == 0 && firstCmp !=0)return firstCmp;
               else if (lastCmp==0&&firstCmp==0)return memCmp;
               else return lastCmp;
    }

    Please don't cross-post. It is considered very rude to do that here:
    http://forum.java.sun.com/thread.jspa?messageID=9953193

  • Help With creating a trigger

    Hello All!
    I am writing regarding a trigger I must create. I have a table that has roughly 10 columns. I must insert rows into a 'history' table when any column in the parent table is updated or, of course if there is an insert on the parent table. Is there a way to specify multiple columns in the triggering statement (i.e., UPDATE OF parts_on_hand ON inventory) to insert rows into the child table if any of the columns is updated? I am very new with triggers, and am hoping that someone might be able to offer any suggestions, or maybe sample code if available just to help start me out.
    Thanks in advance!
    Julie

    If you do not include a specific column(s), then the trigger will fire on an update to any column. So, for your case:
    create or replace trigger t_trigger
    before insert or update on t
    for each row
    begin
      insert into t_history values (:new.c1, :new.c2, ...);
    end;
    /

  • Help needed creating Web Service Proxy with SSL

    Hi All, I really need your help. I need to create a Web Service proxy for a web service which is SSL enabled and developed in Netbeans. I have been given keystore as well as certificates files and I have copied "keystore.jks" in my c:\Documents and Settings\<user> and the certifcates to <JAVA_HOME>\jre\lib\security\cacerts. Now when I run the Proxy creation wizard and give the location of the WSDL file, JDeveloper gives an error "Error importing schemas: Default SSL Context init failed: Invalid keystore format". Can anyone please guide me what I am doing wrong here. I will appreciate your help.
    Thanks in advance.
    John

    I am using JDeveloper 10.1.3.3.0. Thanks Heaps

  • Basic help needed very much

    Hi,
           I have an Epson 3800 printer and Adobe Elements 7 (Epson advised me that I should buy some version of Photoshop to take full advantage of the printers capabilities).....Problem is need basic info on how to set all the buttons to make a decent print. There are many,many choices on various drop down tabs all through the process of making a print. Also, It seems that all my pictures are 72 ppi ...is this a default setting ? Or, did I do something wrong when I downloaded them from my camera ?  PLEASE help !   If at all possible someone could guide me through the process step by step I would be very, very grateful.  I need guidance from the download, through the myriad of buttons (ie: color management, size selections (why do I have to tell both Elements and the printer the size of my paper?!!$#@) what's up with 72ppi on all my pics, if i change to 300 ppi wont pics get worse ? )
    I called Epson and asked them to walk me through a print but they wouldnt because  they said  I'm going through Elements first and that is not their responsibility!  BUT THEY ADVISED ME TO GET ELEMENTS IN THE FIRST PLACE !!!
    Please help...I am an artist (painter) ...my website is www.theeastcoastartist.com I will send a free 8 X 10 signed print of a painting to anyone that can help me get a decent print or just tell me which settings to make each step of the way.
    Thanks,
    Frank

    Frank, here's a couple links to tutorials that may help. They use Photoshop but the print settings in Elements are similar enough.
    http://www.wonderhowto.com/how-to/video/how-to-print-from-photoshop-to-the-epson-stylus-pr o-3800-260408/
    http://people.csail.mit.edu/ericchan/dp/Epson3800/printworkflow.html
    As far as the resolution, stated in pixels per inch (ppi), the images from your camera have a fixed number of pixels, so resolution is determined by the size of the print...the larger the print, the larger the pixels, the lower the resolution. 300 ppi is considered optimum for printing...higher won't hurt, lower than 250 ppi may start to be noticable.

  • Form help needed- creating a PRIORITY FIELD

    I cannot figure this out as i have looked all over the
    internet to no avail.
    I have a 30 question coldfusion flash form.
    I would like the user to select their top eight questions by
    having a drop menu labeled 1 thru 8 beside each question.
    The priority number can only be chosen once.
    Help please...

    zoemayne wrote:
    java:26: cannot find symbol
    symbol  : method add(java.lang.String)
    location: class Dictionary
    add(toAdd);this is in the dictionary class
    generic messageThat's because there is no add(...) method in your Dictionary class: the add(...) method is in your WordList class.
    To answer your next question "+how do I add things to my list then?+": Well, you need to create an instance of your WordList class and call the add(...) method on that instance.
    Here's an example of instantiating an object and invoking a method on that instance:
    Integer i = new Integer(6); // create an instance of Integer
    System.out.println(i.toString()); // call it's toString() method and display it on the "stdout"

  • SSH basics - help needed

    I'm new to networking, so bear with me. Here is what I am trying to do:
    I would like to get to websites that are blocked by a corporate firewall (websense). (I take full responsibility for what I am doing and am not putting myself at risk - don't worry).
    It seems like I could use SSH to connect to my home internet connection thus bypassing the firewall.
    Is that true? If so, what do I need to do?
    Here's my equipment - 2 Macbook Pros, one fuctioning as a desktop at home, one portable. Airport Extreme N router (not gigabit). Comcast home cable internet.
    I just downloaded a program salled SSHTunnel that sounds like it should help, but I don't know where to start.

    The easy route.
    Use TeamViewer <http://teamviewer.com>. Leave TeamViewer running on your home Mac. It will display a "Wait for session ID". Copy that session ID number, and take it with you to work.
    On your work system, run another copy of TeamViewer (there are both PC and Mac versions).
    Configure the work TeamViewer with your corporate Proxy settings
    TeamViewer -> Preferences -> General -> Proxy Settings...
    Now on your work TeamViewer enter the Wait for session ID you got from your home system, and enter that in your work system's Create session ID field. Then click Connect to Partner button.
    This is the easiest way I know about.
    The HARD WAY: You can do this via ssh, but there are a lot more detailed steps.
    1st question. Does your company allow "Out-Bound" ssh connections? If it does, that helps a lot. If they DO NOT, then you would need to mess with an OpenSource program called "Corkscrew" that will get ssh through a proxy server.
    Once you get through the firewall, then you will need to get a dynamic DNS name for your home system. No-IP.com and DynDNS.org offer free dynamic DNS names. You use this so you do not need to worry about your ISP changing your home IP address.
    Now you need to configure your home router so it Forwards Port 22 from the internet side to your destination Mac.
    On your destination Mac, you need to enable System Preferences -> Sharing -> Remote Login, and while you are at it, you should enable screen sharing preference.
    Now on your work system, you ssh to your home system. The form of the command depends on whether you need to use corkscrew or not.
    Without corkscrew:
    ssh -L 5901:localhost:5900 [email protected]
    With corkescrew:
    ssh -L 5900:localhost:5900
    -o 'ProxyCommand /path/to/corkscrew proxy.server.address 8080 %h %p'
    [email protected]
    Now you have an ssh tunnel which you can run screen sharing across. Using a VNC client. On a Mac you can use:
    Finder -> Go -> Connect to server
    vnc://localhost:5900
    If using a 3rd party VNC client, you still specify localhost and port 5900 as these what the ssh tunnel established as the path to the remote Mac's VNC server.
    Now you should be able to use your home Mac and its browser to surf anywhere you like.
    If you wish to increase your complication, you could use ssh to create a SOCKS proxy. You would add the following to your ssh command:
    -D 12345
    Then you configure your bowser to use the SOCKS proxy server via port 12345

  • RV120W VPN Setup - basic help needed

    Hi all,
    I've recently bought a RV 120W Wireless-N VPN Firewall hoping it would ease me in creating VPN and remote connectivity. But I seems to be struggling with this.
    Here is my situation.
    When I bought my Cisco router I didn't know it had an ethernet port for WAN. I thought it would have a RJ11 compliant port. So now I am having to put the router behind my modem.
    I gave my modem's LAN 192.168.2.1 and to RV120W I gave 192.168.2.2.
    All PC's are not connected to internet via RV120W. For RV120W, the local IP network is 192.168.1.0. I've set 192.168.1.1 as the management IP of the Cisco RV120W. All the PC's can get internet from the above layout arrangement.
    With frustration, I've portforwared all my ports on the modem (except 1 port) to RV120W i.e to IP 192.168.2.2.
    If I enable PPTP on RV120W I can ping its port (1723 i remember) from outside. If I connect to port 80 from outside my network, I can get the managemnt interface of the RV120W.
    With the help of the RV120W's userguide I managed to create VPN policy stuff via the 'basic VPN Setup' menu. The guides says to use a wizard but there is no wizard for VPN setup.
    With that I have even created users (of every type) but I just can't make the connection.
    When I use the QuickVPN to connect... its goes from "Connecting", "Activating Policy" again "Connecting" and then a big error saying a couple of things that might have caused the error.
    I want to start from the beginning.
    Can somebody please help me.
    First... what I am I supposed to put in the fields of the following screenshot. Especially the fields "Remote WAN's IP Address", "Local WAN's IP Address" and "Local LAN IP Address".

    Once I knew about the bridge mode thing from this discussion, I started reading the manual of the modem in regard to the brigde mode setup.
    According to the manual, the 'Data' bulb on the modem would be off if the modem is in bridge mode. and I've successfully put the modem on bridge mode I guess. It was pretty easy. I just deleted all the WAN setup rules/configs and began with the initial setup wizard which basically had the option to set the modem to bridge mode. After so, the 'Data' bulb got off meaning the modem is now in bridge mode. I am happy about that
    But... still not done.
    I put one ethernet cable into of the LAN ports of the modem and put the other end in RV120W WAN port. Logged into to RV120W, configured new PPPoE profile (I have the user and pass details) and attached it to the WAN internet setup config.
    I went back to the dashboard of RV120W to see if WAN was up. It didn't. I gave some time. It didn't work. It says 'connecting' but never connects.
    What am I doing wrong? Am I putting the cable between the modem and router the right way?
    ...and also, when the modem is in bridge mode will it forward all packets from lan to wan and vice versa or is it like forwarding packets to all ports once recieved.
    (I am learning so much with this RV120W )

  • HELP NEEDED CREATING VI WITH POTENTIOMETER

    Hi Everyone,
    I have a DAQ 6009, linear potentiometer and a spring.
    I want to measure the displacement of a spring using the linear pot and correspond this displacement into a force by multiplying by spring constant k. (F=-k.x)
    F=force, k = spring constant, x = displacment
    I need to create a VI that will,
    Take voltage readout of potentimeter and correspond it to  0-110mm displacement of spring. ie 0V=0mm, 5V =110mm.
    Multiply the displacement mm by k (which is 25).
    Record values into excel file and display when stop button is pressed.
    Record peak force (amplitude).
    When the pot is fully extented it would correspond to 0mm/0V.
    Please find attached current Labview VI and linear pot.
    As you can see it is multiplying the voltage reading by 25, I want to correspond this voltage to a displacment and then multiply by 25 so I will have output in Newtons.
    Thank you for your help,
    John

    I am fairly new to Labview, so excuse my lack of knowledge at the moment.
    I didn't use a custom scale. Can you inform me of what to do?
    I multiplied voltage by 20 to correspond it to mm then by k (25) to convert it to a force,  is this correct?
    I reversed the ground and 5V supply on the 6009 so it will be reading 0 when pot is fully extended?
    Below is DAQ Assistant and Block diagram/front panel.
    Also my read from measurement file graph is only generating a somewhat straight line instead of an actual waveform??

  • Help needed creating a Live Poll

    I am relatively new to flash.  I need to create a website that has only one question on it, and then displays the poll results automatically after a user makes a selection, showing the overall results updated in real time.  Can anyone point me in the right direction on where to get started with this.  I imagine I will need some php and possibly mysql to make this guy go.  Any help would be geatly appreciated.
    Scott

    in as2, use two different instances of loadvars.  one to send variables/values and the other to receive:
    var sendLV:LoadVars=new LoadVars();
    var receiveLV:LoadVars=new LoadVars();
    receiveLV.onData=function(src){
    // do whatever
    sendLV.var1=xxx
    etc
    sendLV.sendAndReceive("yourasp.asp",receiveLV,"POST");  // assuming your asp si expecting posted variables.

Maybe you are looking for

  • I can't install bootcamp drivers on my Windows 7 partition.

    As of now I am trying to run 32 Bit Windows 7 on my mid 2011 13 inch Mac Book Air.  I downloaded my version of Windows from Onthehub.com and went thru the process of coverting it to an ISO file, putting it on a flash drive, downloading the support so

  • My Shuffle no longer recognized in Windows

    I am having trouble with my 1 GB shuffle. It had been working rather well for several months but now it is not recognized by XP Pro or iTunes. It does however get charged when I connect it to the USB port. Also, the USB subsytem on my computer does w

  • Custom Central Monitor PI

    Hi, i need to create a custom central monitoring where i can trace message of XI 3.0  and centralize the Exchange of Idocs in one simple and common tool. is possible get access to APIs  and get information about processing message, Adapters, tRFC,qRF

  • LAYOUT.JS error

    hi all, Did you ever face the layout.js "error".while working with OATS,If yes What is it? Edited by: USoni on Jan 14, 2009 8:16 PM

  • Is there a dependency between source system patch level (IS-U) and BW 7.3

    Hello everybody, we think about upgrading our BW. Now there is the question if there is any dependency between source system patch level (IS-U) and BW 7.3. Perhaps someone knows a note. I don't find anything. Thanks