Reg &

Results 1 to 3 of 3

Thread: Reg &

  1. #1
    Join Date
    Dec 1969

    Default Reg &

    I have a problem inserting a record into a varchar type field. I need to insert a value called Cede&Corresp into a table. How do I do this thro Oracle SQL.<BR><BR>I tried the following<BR><BR>insert into document values(&#039doc&#039, &#039cede & Corresp&#039)<BR><BR>But the statement returns error. Any body can tell how to solve this.<BR>

  2. #2
    sm549 Guest

    Default RE: Reg &

    Are you trying to concatenate 2 ASP string variables called &#039cede&#039 and &#039Corresp&#039 and store the result into a single varchar field? Do you also want to store the literal &#039doc&#039? Here I&#039m guessing 1stFieldName gets &#039doc&#039 and 2ndFieldName gets the concatenation. You&#039ll have to use the actual fieldnames. Post again if this didn&#039t do it.<BR><BR>Dim sSQL<BR>sSQL = "insert into document(1stFieldName, 2ndFieldName) values(&#039doc&#039, &#039" & cede & Corresp & "&#039)"<BR><BR>

  3. #3
    Kevin Guest

    Default RE: Reg &

    Simple SELECT and INSERT statemenst are exactly the same in most databases. So your syntax is correct. However, you do not specify the columns to put the data into. Therefore, it simply begins at the first column and works it&#039s way to the last. If the document table doesn&#039t have exactly two columns, each of some text datatype, then this SQL statement will fail. You need to specify which columns you are inserting the data into.<BR><BR>INSERT INTO document (column2, column5) VALUES (&#039doc&#039, &#039cede & Corresp&#039)<BR><BR>You also mentioned "insert a value called Cede&Corresp". Is this the name of a variable? If so, you should really consider changing it.

Posting Permissions

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