Simple Problem with hashmap

Hello,
I am having a problem creating a hashmap--I am not sure what is going wrong, but here is the code I am using:
import java.util.*;
public class HashMap{
public static void main(String args[]){
     HashMap myHashMap = new HashMap();
     myHashMap.put("one","1");
When I go to compile I get this error:
HashMap.java:6: cannot resolve symbol
symbol : method put (java.lang.String,java.lang.String)
location class HashMap
myHashMap.put("one","1");
^
If anyone could offer some help that would be great. Thanks!

THANK YOU!
I'm a newbie and this problem was driving me crazy also. I inadvertently created a HashMap.class. Once I deleted the class from the folder, all of my programs worked! (Duh!)

Similar Messages

  • A simple problem with sateful Session beans

    Hi,
    I have a really novice problem with stateful session bean in Java EE 5.
    I have written a simple session bean which has a counter inside it and every time a client call this bean it must increment the count value and return it back.
    I have also created a simple servlet to call this session bean.
    Everything seemed fine I opened a firefox window and tried to load the page, the counter incremented from 1 to 3 for the 3 times that I reloaded the page then I opened an IE window (which I think is actually a new client) but the page counter started from 4 not 1 for the new client and it means that the new client has access to the old client session bean.
    Am I missing anything here???
    Isn�t it the way that a stateful session bean must react?
    This is my stateful session bean source.
    package test;
    import javax.ejb.Stateful;
    @Stateful
    public class SecondSessionBean implements SecondSessionRemote
    private int cnt;
    /** Creates a new instance of SecondSessionBean */
    public SecondSessionBean ()
    cnt=1;
    public int getCnt()
    return cnt++;
    And this is my simple client site servlet
    package rezaServlets;
    import java.io.*;
    import java.net.*;
    import javax.ejb.EJB;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import test.SecondSessionRemote;
    public class main extends HttpServlet
    @EJB
    private SecondSessionRemote secondSessionBean;
    protected void processRequest (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    response.setContentType ("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter ();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet main</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Our count is " + Integer.toString (secondSessionBean.getCnt ()) + "</h1>");
    out.println("</body>");
    out.println("</html>");
    out.close ();
    protected void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    processRequest (request, response);
    protected void doPost (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    processRequest (request, response);
    }

    You are injecting a reference to a stateful session bean to an instance variable in the servlet. This bean instance is shared by all servlet request, and that's why you are seeing this odd behavior.
    You can use type-leve injection for the stateful bean, and then lookup the bean inside your request-processing method. You may also save this bean ref in HttpSession.
    @EJB(name="ejb/foo", beanName="SecondBean", beanInterface="com.foo.foo.SecondBeanRemote")
    public MyServlet extends HttpServlet {
    ic.lookup("java:comp/env/ejb/foo");
    }

  • Having Problems with Hashmap

    Hi, I'm currently creating a sparsematrix for my assignment using a hash map however i've come across a problem with how i can set an element and returning using key objects
    My setElement method is
    public void setElement(int nrow, int ncol, float value) throws
    MatrixException {
    data.put(new SparseNode(nrow,ncol), value);
    and my get element is
    public float getElement(int row, int col) throws MatrixException {
    SparseNode node = new SparseNode(row, col);
              if (!data.containsKey(node)) {
              return 0;
    return (Float) data.get(node);
    where data is the map and node would be the key. The problem comes when i set the value where i give a key and this is set into the hashmap. unfortunatly the key is lost when the method exits so using the getElement method by creating a sparsenode with same characteristics as the original key won't work simply because it's not the original key. Is there another way to get around this? or some way to store the key.

    ok well i changed to to not include the SparseNode. Now it works but very very slow. I also noticed another post with a user with the same problem but it didn't really explain how to fix it properly. Any suggestions to make this code faster?
    import java.io.*;
    import java.util.*;
    public class SparseMatrix implements Matrix{
        private HashMap data; // non zero elements
         private int rows;
         private int columns;
        public SparseMatrix(int row, int columns) {
            data = new HashMap(row*columns);
            this.rows=row;
            this.columns=columns;
        public float getElement(int row, int col) throws MatrixException {
                if (row < 0 || col < 0 || row > this.getNumRows() || col > this.getNumCols()) {
                throw new MatrixException("Row or Column Number Beyond Dimension");
                     if (!data.containsKey((row*this.getNumCols()+col))) {
                        return 0;
            return (Float) data.get((row*this.getNumCols()+col));
        public void setElement(int nrow, int ncol, float value) throws MatrixException {
    //        if (row > this.row || col > this.col) {
    //           throw new MatrixException("Matrix index out of range");
            data.put((nrow*this.getNumCols()+ncol), new Float(value));
        public boolean isZero() {
            return data.isEmpty();
        // return the total number of rows in the matrix
       public int getNumRows(){
            return rows;
       // return the total number of rows in the matrix
       public int getNumCols(){
            return this.columns;
       // transpose matrix and return result as new matrix
        public Matrix transpose() {
            SparseMatrix a = new SparseMatrix(this.getNumCols(), this.getNumRows());
            for (int i =1 ; i<=this.getNumRows();i++) {
                for (int j = 1;j<=this.getNumCols();j++){
                      float value = getElement(i,j);
                     a.setElement(j, i, value );
            return a;
        * Subtracts a matrix to the current matrix and returns result as new matrix
        * @param a The Matrix to be subtracted
        * @return Returns the new matrix
       public Matrix subtract(Matrix a) throws MatrixException{
                 if (this.getNumRows() != a.getNumRows() || this.getNumCols() != a.getNumCols())
                    throw new MatrixException("Subtraction Cannot be Done due to Matrix Dimension MisMatch");
                if (a.isZero())
                    return this;
                    SparseMatrix ResultMatrix = new SparseMatrix(this.getNumRows(), this.getNumCols());
            for (int i = 1; i <= rows; i++) {
                for (int j = 1; j <= columns; j++) {          
                     float value = a.getElement(i,j);
                     float result = this.getElement(i,j) - value;
                     if (result < 0 || result > 0) {
                         ResultMatrix.setElement(i,j,result);
                 return ResultMatrix;
        // add matrix and return result as new matrix
        public Matrix add(Matrix a) throws MatrixException {
                if (this.getNumRows()!= a.getNumRows() || this.getNumCols()!= a.getNumCols())
                throw new MatrixException("Addition Cannot be Done due to Matrix Dimension MisMatch");
            if (this.isZero())
                return a;
            if (a.isZero())
                return this;
                SparseMatrix ResultMatrix = new SparseMatrix(this.getNumRows(), this.getNumCols());
            for (int i = 1; i <= rows; i++) {
                for (int j = 1; j <= columns; j++) {          
                     float value = a.getElement(i,j);
                     float result = this.getElement(i,j) + value;
                     if (result < 0 || result > 0) {
                         ResultMatrix.setElement(i,j,result);
                 return ResultMatrix;
    // multiply matrix and return result as new matrix
         public Matrix multiply(Matrix a) throws MatrixException {
                              if (this.getNumCols() != a.getNumRows())
                throw new MatrixException("Multiplication Cannot be Done due to Matrix Dimension MisMatch");
            if (this.isZero() || a.isZero())
                SparseMatrix Temp = new SparseMatrix(this.getNumRows(), a.getNumCols());
                return Temp;
             SparseMatrix ResultMatrix = new SparseMatrix(this.getNumRows(), this.getNumCols());
              for(int i=1;i<=this.getNumRows();i++)
                   for(int j=1;j<=a.getNumCols();j++)
                                  float Result =0;
                                  for(int k=1;k<a.getNumCols();k++)
                                       Result = Result + this.getElement(i,k)*a.getElement(k,j);
                                  ResultMatrix.setElement(i,j,Result);
              return ResultMatrix;
         // print matrix in the format:
       // a11 a12 ... a1m
       // an1 an2 ... anm
        public void print(PrintStream out) {
             //System.out.println(data.toString() +"\n=====================");
            for (int i = 1; i <= this.getNumRows(); i++) {
                for (int j = 1; j <= this.getNumCols(); j++) {
                    float aData = this.getElement(i, j);
                    out.print(" " + aData + "");
                out.println();
    }

  • Simple problem with transitions

    Hi everyone
    I am having a small bit of a problem with transitions....
    When I drag a clip from the viewer over the canvas to get the menu bar pop up, and select insert with transition ( cross dissolve ) it puts in a transition but its very short and too fast and when i select it and try to make adjustments it doesn't seem to let me make any changes to the cross dissolve.
    I wander what i am doing wrong?
    Many thanks Tim

    Hi
    Just as David Harbsmeier indicates. Handles
    Transitions are handled differently in iMovie resp FinalCut.
    • iMovie - material that builds the transition is taken from the videoclips = the total length remains same
    • FinalCut (as pro- works) . You have to set of a piece of material in each end of the video clips.
    This is called In- resp. Out-points. The remaining parts are called Handles
    Transitions here are using material from these = Total lenght of movie increase
    per transition.
    I find books/DVDs by Tom Wolsky - Very valubale - Enjoyed them very much.
    • Final Cut Express 4
    • Final Cut Pro 6 - DVD course (now probably version 7)
    Yours Bengt W

  • Simple problem with input

    hi!
    i've a problem with user input in my application:
    Code:
    BufferedReader F_reader = new BufferedReader (new InputStreamReader(System.in));
    Fs_line = F_reader.readLine();
    My problem is that i've to press the return key for two times, before the JDK returns the line! Does anybody know a better solution with JDK 1.4.2?
    thanks for help
    mike

    it was a mistake of our own implementation! code ist correct! any circumstances are our eval!
    thanks mike

  • Simple problem with a list initialization.

    hello ! i have a class Contact and i would like to make a list of lists of Contact variables .. but when i try to run my code , it says "IndexOutOfBoundsException: Index: 0, Size: 0" . I know that every list of the list must be initialized .. but i don't know how .
    here is the declaration of the List
    static  List<List<Contact>> lolContact=new ArrayList<List<Contact>>();and i know that i should do something like :
    lolContact.get(0)=new ArrayList<Contact>();to initialize every list of the list but i don't know how . please help

    badescuga wrote:
    and i know that i should do something like :
    lolContact.get(0)=new ArrayList<Contact>();
    Couple of problems with that.
    1. You can never do methodCall() = something in Java. The result of a method call is not an L-value.
    2. You're trying to assign a ContactList to a Contact variable. Basically, you're trying to do
    Contact c = new ArrayList<Contact>();3. Even if you changed it to
    Contact c = lolContact.get(0);
    c = new Contact();it would not put anything into the list. That would just copy the first reference in the list and stick it into variable c, so that both c and the first list item point to the same object (remember, the list contains references, not objects--no object or data structure ever contains an object in Java), and then assigns a completely different reference to c, forgetting about the one to the object pointed to by the list. It would not affect the list in any way.
    4. You can't do get(0) until you've first put something into the list.

  • Probably simple problem with while loops

    I was programming something for a CS class and came across a problem I can't explain with while loops. The condition for the loop is true, but the loop doesn't continue; it terminates after executing once. The actual program was bigger than this, but I isolated my problem to a short loop:
    import java.util.Scanner;
    public class ok {
    public static void main(String[] args){
         Scanner scan = new Scanner(System.in);
         String antlol = "p";
         while(antlol == "p" || antlol == "P"){
              System.out.println("write a P so we can get this over with");
              antlol = scan.nextLine(); 
    //it terminates after this, even if I type "P", which should make the while condition true.
    }

    Thanks, that worked.
    I think my real problem with this program was my CS
    teacher, who never covered how to compare strings,Here's something important.
    This isn't just about comparing Strings. This applies to comparing ANY objects. When you use == that compares to see if two references refer to the same instance. equals compares objects for equality in the sense that equality means they have equal "content" as it were.

  • I have problems with HashMap

    hello guys
    i have a problems whith this assignment.
    im usunig BlueJ
    its about a library has members and lists of the books available( a catalogue for viewing by members) and of the copies of
    these (for stock control purposes).
    information of a book (title, author, and ISBN), the title is a unique identifier.
    a book may have several copies, each with a unique stock number (an integer). a book may have no copies (if, for
    example, it has been added to the catalogue, but copies havent yet arrived.
    the library most be able to:
    - add a book to the catalogue for example when its newly published.
    - add a copy of a book to its stock when the library receives this item.
    - obtain a list of copies of a book, given its title.
    - obtain a String representation of the list of copies of a book, given its title; this should just be the title
    and list of stock numbers, for examble :( title, copies: 2000, 2001, 2002).
    now i cant make the HashMap for the stock items,
    is there anything wrong i have made or any suggestions to help me to continue my work?
    the two classes i have made so far:
    public class books
        private String title;
        private String author;
        private String ISBN;
        private int quantity;
        private int stockNumber;
        public books(String title, String author, String ISBN)
            this.title = title;
            this.author = author;
            this.ISBN = ISBN;
            //stock number satrts from 2000
            stockNumber = 1999;
        public int addquntity (int amount)
                quantity = quantity + amount;
                return quantity;
        // chang the quantity when costumer borrows a book from the library
        public int getBorowed()
            if(quantity > 0){
              quantity --;
            else{
                System.out.print("sorry the book is not avalible, try again later");
                return quantity;
        // chang the quantity when costumer rturnes a book to the library
        public void deliverBookBack()
            quantity++;
        public String toString()
            return title + " by " + author + ". ISBN = " + ISBN ;
        // change the stock number after adding any book to the library
        public int autoStockNumber()
            stockNumber ++;
            return stockNumber;
        public int getStockNumber()
            return  stockNumber;
    }======================================================
    import java.util.ArrayList;
    import java.util.HashMap;
    public class library
        private ArrayList<books> book;
        private ArrayList<members> member;
      // i coudnt make the HashMap here.
        private HashMap<books , books> stock;   
        public library ()
            book = new ArrayList<books>();
            member = new ArrayList<members>();
            stock = new HashMap<books, books>();       
        // to add a book to the catalogue, for example when its newly published (the book information)
        public void newBook(books bk)
            book.add(bk);
        public void TheStateOfTheLibrary()
            //print the library name and address
            System.out.println("BlueJ Library: 10 College Lane, AL10 9BL");
            // print list of the books (title, author, ISBN)
            System.out.println("Catalogue :");
            for (books bk : book){
                System.out.println(bk);
            System.out.println("");
             * print stock list to show all stocks in the library
             *it should show:
             *stock number, books name, by : thuthor. ISBN
            System.out.println("Stock List:");
            System.out.println("");
            System.out.println("Membership List:");       
            for (members memb : member){
                System.out.println(memb);
        public void addMember(members memb)
            member.add(memb);
        // to add a copy of a book to it's stock, when the library receives this item.
        public void addBookToStock(books sn)
           // i coudnt make it
    }thank you

    actually im new in java and i dont really understand the HashMap.A HashMap is like an array except the index values of the array aren't integers. If you declare an array like this:
    int[] nums = new int[10];
    the index values of the array are the integers 0-9. To store something in the array, you do something like this:
    nums[0] = 3;
    0 is the index value and at that index position in the array is the integer 3.
    With a HashMap, you can use index values other than integers for your array. For instance, you can use Strings:
    index value           value stored at that index position in the array
    "John"                           "232-0416"
    "Sally"                          "451-0091"To add an index value to the map and store a value at that index position, you would do this:
    myMap.put("Jane", "456-7654");
    To get the telephone number at index position "John", you would do this:
    myMap.get("John");
    However, you have to do a little more work on the object returned by get(). When you add objects, like String objects, to one of java's collections, they are automatically converted to type Object first and then added to the collection. Then, when you retrieve objects from a collection, they are returned as type Object, so you need to cast them to their original type:
    String result = (String) myMap.get("John");
    That statement gets you whatever is stored at index position "John" in the array, which happens to be the String "232-0416". You don't have to make that cast in java 1.5 when you use generics, which is what you are doing.
    One last point: in HashMap lingo, the index values in the array are called "keys".
    i have an error " cannot find symbol- method put(int,books)You defined your HashMap like this:
    private HashMap<books , books> stock;
    That tells java that you are going to be using 'books' objects for the index values of the array, and that the values stored at those index positions will be 'books' objects. But here:
    public void addBookToStock(Books sn, Books b)
            int key = sn.getStockNumber();
            stock.put(key,  b);       // the error is in this line.
    }you are trying to use an int as the index value of the array. Since you told java you would be using "books" as index values, it produces an error.
    You should also rename your Books class to "Book". A Book object does not consist of several books--it represents only one book. If you had a collection containing a bunch of Book objects, then it would make sense to name the collection "Books".

  • Simple problem with triggers

    Hi all,
    Initially I have written a trigger for testing .But im not able to write it as per the requirement.Actually I have written the trigger for a table "test" when a row is inserted into it then my trigger will insert a row in another table.In the same way if an row is UPDATED then that same field of the same row is to be updated in another table.how can I do this by modifying this trigger code.Im in a confusion of doing this.
    Table: test.
    Name Null? Type
    ID NOT NULL NUMBER(38)
    UNAME VARCHAR2(15)
    PWD VARCHAR2(10)
    Table : test123.
    Name Null? Type
    ID NUMBER
    UNAME VARCHAR2(30)
    PWD VARCHAR2(30)
    the trigger is as follows:
    CREATE OR REPLACE TRIGGER inst_trigger
    AFTER INSERT OR UPDATE
    ON test
    FOR EACH ROW
    DECLARE
         id number;
         uname varchar2(20);
         pwd varchar2(20);
    BEGIN
         id := 1245;
         uname :='abc';
         pwd := 'xyz';
         IF INSERTING THEN
    INSERT INTO test123 VALUES (id,uname,pwd);
         END IF;
    END test_trigger;
    how can i modify this for the above mentioned use.
    Thanks in advance,
    Trinath Somanchi,
    Hyderabad.

    Hallo,
    naturally , you have not assign values directly in trigger. They come automatically
    in trigger with :new - variables.
    CREATE OR REPLACE TRIGGER scott.inst_trigger
    AFTER INSERT OR UPDATE
    ON scott.test
    FOR EACH ROW
    BEGIN
    IF INSERTING THEN
    INSERT INTO scott.test123 VALUES (:new.id,:new.uname,:new.pwd);
    ELSE
    UPDATE scott.test123
    set uname = :new.uname, pwd = :new.pwd
    where id = :new.id;
    END IF;
    END inst_trigger;Nicolas, yes, merge here is very effective, but i think, that OP can starts with simpler version von "upsert".
    Regards
    Dmytro

  • Simple problem with popup message before adding document on system form

    Hi all,
    We have an AddOn that validates price lines on system Sales Order form matrix, so that if prices fall below a certain value, a popup is show to ask to continue or not, when user presses ADD button.
    The problem is that if he chooses yes (to continue), the Sales Order is not added since the button ADD keeps being selected ....
    Here is my code:
            [B1Listener(BoEventTypes.et_CLICK, true)]
            public virtual bool OnBeforeClick(ItemEvent pVal)
                int iResult = B1Connections.theAppl.MessageBox("Price lines fall bellow minimum! Continue?", 1, "NO", "YES", "");
                if (iResult == 1) // NO
                    // Show error
                    B1Connections.theAppl.StatusBar.SetText("OK", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
                    return false;
                // YES: Continue to add Sales Order
                return true;
    The problem is somehow related with the popup message being shown: if user says YES to continue, the system form does not continue with the standard process of adding the Sales Order (when I move the cursor above the ADD button is shows it already pressed...).
    Do I have to do anything more to force the process to continue, when the user says YES?
    Regards,
    Manuel Dias

    Thtas known problem. The solution for this is declare global variable as boolean, when user selects Yes, then set this variable to true and emulate click to add button again where before the message box check if its varaible sets to true - in this case dont show message box, only set variable to false.
    The concept of code will be
    dim continue as boolean = false
    in item event
    if continue = false then
        x = messagebox...
      if x = 1 then
        continue = true
         items.item("1").click
    end if
    else
    continue = false
    end if

  • Simple Problem with Stacked Canvas, I hope

    Hello all,
    I am become a bit frustrated with what I thought would be a simple form development solution. I am trying to create a form with a stacked canvas that will display about 20 fields that can be scrolled through. This is the detail
    Total of 25 fields
    5 Fields on the content canvas
    20 Fields on the stacked canvas
    I created the first canvas that originally contained all 25 fields. Then I created the stacked canvas and moved the appropriate fields to the stacked canvas. Using the forms builder editor, I positioned my stacked canvas as such so that it would not overlap the last field on the content canvas or visa versa. This is a form being developed for Oracle EBus. Whenever I run the form in the apps, the stacked canvas is not visible. It only becomes visible when the 1st field on the canvas has focus. When the stacked canvas becomes visible, it shows all of the items of the stacked canvas and not just the ones that I included in the viewpoint. Once I tab through the last field of the stacked canvas, it goes back to the first field on the content canvas and the stacked canvas disappears. At this point I am not doing anything complicated, but for whatever reason this just is NOT working. Any advice anyone can provide, I would very much appreciate it. This is VERY frustrating.
    Thank you in advance.

    Step No. 1
    Set the STACKED CANVAS's property VIEWPORT WIDTH AND VIEWPORT HEIGHT
    This property determines what viewable width and height of the stacked canvas at runtime.
    Set SHOW HORIZONTAL SCROLL BAR or SHOW VERTICAL SCROLL BAR or BOTH as YES so that you can scroll down to view all the items in the CANVAS.
    Step NO.2
    In your WHEN-NEW-FORM-INSTANCE trigger, write the code to make the canvas visible
    SHOW_VIEW('stack_canvas_name');

  • Having a simple problem with MDK

    I am using eclipse+MDK to develop/debug the MAM and MAU applications. I have been using MAM with MDK no problem. About a month ago, I even used MAU with MDK no problem.
    But now when I try to run MAU with MDK, the following error occurs only via eclipse, running via MAM alone works fine.
    Error: 500
    Location: /CMAU/home/home_mgmt.do
    Internal Servlet Error:
    javax.servlet.ServletException: cannot find message associated with key : dispatcher.forwardException
         at org.apache.tomcat.facade.RequestDispatcherImpl.doForward(RequestDispatcherImpl.java:238)
         at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:162)
         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:423)
         at 0002fmam0005fstart_0002ejspmam_0005fstart_jsp_0._jspService(_0002fmam_0005fstart_0002ejspmam_0005fstart_jsp_0.java:62)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:479)

    Hi Ezatullah,
    Did you find a solution to ur problem.if yes plz tell  what changes u did to make it run I am also facing the same problem..
    bye
    Anand

  • A simple problem with natural join

    i have 2 tables what have columns with distinct's names are referenced.
    natural join not works 'cose only foreign key reference this 2 tables.
    Have something to make table join in using an specific foreign key??
    I'm using oracle9i
    Example:
    table a( a_cod number, a_name varchar2(20))
    table b( b_cod number, b_month_year date, b_salary number)
    ALTER TABLE b ADD ( CONSTRAINT b_a_FK FOREIGN KEY (b_cod)
    REFERENCES a (a_cod));
    select * from a natural join b
    where trunc(b_month_year) = trunc(sysdate)

    I'm not express me correctly.
    We have 2 tables like this:
    CREATE TABLE PPTBA001
      PPA001_GROUP             NUMBER(3)            NOT NULL,
      PPA001_PEOPLECODE        VARCHAR2(20 BYTE)    NOT NULL,
      PPA001_NAME              VARCHAR2(60 BYTE)    NOT NULL,
      PPA001_DATEOFBIRTHDAY    DATE                 NOT NULL);
    CREATE TABLE CLTBA001
      CLA001_GROUP            NUMBER(3)             NOT NULL,
      CLA001_CLIENTCODE       VARCHAR2(20 BYTE)     NOT NULL,
      CLA001_SITUATION        NUMBER(1)             DEFAULT 1);
    SELECT * FROM PPTBA001 NATURAL JOIN CLTBA001;
    ALTER TABLE CLTBA001 ADD (
      CONSTRAINT CLA001_PPAA001_FK1 FOREIGN KEY (CLA001_GROUP, CLA001_CLIENTCODE)
        REFERENCES PPTBA001 (OFA001_GROUP,OFA001_PEOPLECODE));
          the select returns without results. 'cose does not have columns like same name.
    Natural join use a columns with same name. I need something use an foreign key.
    Why?? Now i have a problem .. i need aggregate one more column in primary key
    and i need change all selects that have join with PPTBA001 and put manualy a new column.. if have a other possibility like natural join to using a foreign key to join the selects problems is so more easy to resolve.
    Message was edited by:
    jonas.lima

  • A few simple problems with dreamweaver 8

    Hello,
    Please watch these 20 second clips so you can see my problem.
    First video (quite fuzzy, sorry):
    http://tinypic.com/player.php?v=qsp10x&s=5
    I want it so it goes down 1 line instead of 2 lines at a
    time..
    Second video:
    http://tinypic.com/player.php?v=8wgt93&s=5
    I want to put something in that massive area next to the
    buttons table area, but it keeps going underneath..

    Hello,
    I don't think I've seen screenshot video showing a question
    before. Clever.
    1. Use CSS to set the margins for the <p> tags.
    p {margin: 0px;}
    or
    p {margin: 0.2em 0em}
    Adjust as needed.
    2. That's how HTML works. Elements follow the normal flow and
    block level
    elements, like a table, usually begin on a new "line."
    You could make the table with your navigation in it a 2
    column table.
    Insert the navigation in the first column.
    Insert a new table in the second column.
    Then, the new table will sit to the right of the navigation.
    You could also use divs and CSS to float them next to each
    other.
    Your best bet is to set DW aside for a little while and learn
    HTML and CSS.
    DW will be far easier to use if you understand how HTML
    works.
    Then you'll understand why things happen like they do, what
    is possible and
    how to do it.
    If you don't, DW will be a very frustrating adventure with a
    hard learning
    curve.
    A good place to start:
    http://www.w3schools.com/
    Take care,
    Tim
    "jimmyharr" <[email protected]> wrote in
    message
    news:gn77dk$82e$[email protected]..
    > Hello,
    >
    > Please watch these 20 second clips so you can see my
    problem.
    >
    > First video (quite fuzzy, sorry):
    >
    [url]http://tinypic.com/player.php?v=qsp10x&s=5[/url]
    > I want it so it goes down 1 line instead of 2 lines at a
    time..
    >
    > Second video:
    >
    [url]http://tinypic.com/player.php?v=8wgt93&s=5[/url]
    > I want to put something in that massive area next to the
    buttons table
    > area,
    > but it keeps going underneath..
    >

  • Must be simple problem with wiring...surely??

    Hi all,
    I've just moved into a new house and it has a VERY simple phone wiring.  Master socket in the kitchen, and internal wiring that goes to one further socket in the living room.
    I can not get my router working on either of the sockets.  The only one it works on is the test socket behind the faceplate at the socket.
    I have attached some photos in case anyone can spot the problem..?
    Any help greatfully recieved!

    @ imjolly
    Thanks for that. I didn't realise.......
    It does occur to me though that if one end of the cable has been wired in the "old style", then it seems unusual that the other end isn't wired the same, as presumably it would have been carried out by the same person ?
    If you found this post helpful, then please click the star on the left, after all, I'm only trying to help........

Maybe you are looking for