Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

append text fields 1

Status
Not open for further replies.

charanch

Programmer
Jan 3, 2004
55
US
Hello,

I'll bet this is an elementary question. I have a text file I am converting and posting to a SQL database. But the first 15 records in this text file are going into a NOTES field in the SQL db and I want to append all of these together before I post to the database. In other words, I don't want to create 15 records, just one. How do I append the records and then write the appended record to the database? I can look at it with a loop:

if detail("UNIT")='X' then
do while not detail.eof
NOTES=detail("NOTES") & " "
response.write NOTES
detail.movenext
loop
end if

But I'm lost after that. Thank you for your thoughts.

Charles Ranch
 
Well firstly, you might want to change the way you are appending your data.

if detail("UNIT")='X' then
do while not detail.eof
NOTES= NOTES & detail("NOTES") & " "
detail.movenext
loop
response.write NOTES
end if

Now you are all set to update your database field with the concatenated string with an Insert operation(I'm guessing its a new table)

It's always in the details.
 
Many thanks, rsshetty. That's exactly what I needed. Works perfectly. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top