Judy Deo
asked on
updating a field with an additional item
okay i have a micrsoft access database that contains a memo field which has a bunch of 9 digit numbers separated by spaces.
i.e
123456789 987456321 123789456 ....
i want to be able to update this field by adding a new 9 digit number to the end of it (i.e a space followed by the 9 digit number)
how do i do this?
i.e
123456789 987456321 123789456 ....
i want to be able to update this field by adding a new 9 digit number to the end of it (i.e a space followed by the 9 digit number)
how do i do this?
ASKER
no that way is fine.
so you build a query:
<cfquery name="getCurrentData">
select columname
from tablename
where primary_key_column = foo
</cfquery>
<cfset getCurrentData.columname = getCurrentData.columname & " " & yourNewNumberVariable>
<cfquery name="updateData">
update tablename
set columname = '#getCurrentData.columname #'
where primary_key_column = foo
</cfquery>
if you give me the Db specifics and varnames I can give you the precise code.
HTH,
CJ
<cfquery name="getCurrentData">
select columname
from tablename
where primary_key_column = foo
</cfquery>
<cfset getCurrentData.columname = getCurrentData.columname & " " & yourNewNumberVariable>
<cfquery name="updateData">
update tablename
set columname = '#getCurrentData.columname
where primary_key_column = foo
</cfquery>
if you give me the Db specifics and varnames I can give you the precise code.
HTH,
CJ
Hi,
Use a delimeter in ur Query as '~' so u can clearly distinguish the elements of the list.
the reason why i am saying this is having a delimeter is helpful [as in it increases the readability & also reduces the chances of errors]
when u want to append - use
cfset x = "ur originallist"
newlist = listappend(x,'new number','~')
but when u insert [newlist] in ur table - just use a replace fucntion on newlist & replace ur '~' with a " " & that should solve ur issue.
K'Rgds
Anand
Use a delimeter in ur Query as '~' so u can clearly distinguish the elements of the list.
the reason why i am saying this is having a delimeter is helpful [as in it increases the readability & also reduces the chances of errors]
when u want to append - use
cfset x = "ur originallist"
newlist = listappend(x,'new number','~')
but when u insert [newlist] in ur table - just use a replace fucntion on newlist & replace ur '~' with a " " & that should solve ur issue.
K'Rgds
Anand
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CJ