Can an inserst statement do this

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Can an inserst statement do this

    Ok I don't know if this is possible, I don't really know much about coldfusion.
    but where is what I want to happen.
    With out going into to much details and elimintating table fields that don't
    concern this here is the table.

    Order information:
    CompID (autonum)
    ServiceTag

    Employees
    EmployeeId(autonum)
    Name

    ComputerAssignments
    Assignmentnum (autonum)
    ComputerID
    EmployeeID

    Here is what I want...I want a form that when you put in thier Name and
    ServiceTag it will look up thier computerID and employeeID and then insert that
    into the computerassignment table.


    PeteMares Guest

  2. Similar Questions and Discussions

    1. If Statement???
      guys i was wondering if anybody here could help me. I have a page done up with all dynamic text and attributes on it that come from a management...
    2. Need Help With a SQL Statement
      I've created an application that collects performance reviews for the employees in our organization. The database contains a "people" table which...
    3. Use of FOR statement
      I am reading through a book on Objects and References and I don't understand this statement: $sum += $_ for split //; I thought a FOR...
    4. AW: if-else-statement
      --On Wednesday, September 03, 2003 11:56 PM +0200 "B. Fongo" <mygrps@fongo.de> wrote: Look at the docs for CGI.pm under pragmas, the -nosticky...
    5. Can i say OR in an if/then statement
      I am trying to say if (condition) is true OR (condition) is true THEN Can I use OR or do ihave to break it down into an elseif statement? I...
  3. #2

    Default Re: Can an inserst statement do this

    PeteMares wrote:
    >
    > Order information:
    > CompID (autonum)
    > ServiceTag
    >
    > Employees
    > EmployeeId(autonum)
    > Name
    >
    > ComputerAssignments
    > Assignmentnum (autonum)
    > ComputerID
    > EmployeeID
    >
    > Here is what I want...I want a form that when you put in thier Name and
    > ServiceTag it will look up thier computerID and employeeID and then insert that
    > into the computerassignment table.
    This should get you started:

    INSERT INTO computerassignments (computerID, employeeID)
    SELECT oi.compID, e.employeeID
    FROM "Order Information" oi, Employees e
    WHERE oi.ServiceTag = <cfqueryparam value="#form.servicetag#">
    AND e.Name = <cfqueryparam value="#form.name#">

    Jochem

    --
    Jochem van Dieten
    Team Macromedia Volunteer for ColdFusion, beer and fun.
    Jochem van Dieten - TMM Guest

  4. #3

    Default Re: Can an inserst statement do this

    Thank you
    PeteMares Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139