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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update problems

Status
Not open for further replies.

twcman

Programmer
Jun 28, 2001
284
US
I am having a problem updating a record field in the db. I have a field with a comma delimited list of id numbers. Is there a way to identify a record and remove a single id from the list in one statment. Similiar to this:

<cfquery name=&quot;recupdate&quot; datasource=&quot;#datasource#&quot;>
Update reports Set archived = '#archlistnew#',
hideview = ListDeleteAt(hideview,ListFindNoCase(hideview,userid,&quot;,&quot;),&quot;,&quot;)
Where reportnumber= #findrecs.reportnumber#
</cfquery>

The text in red is where my problem lies. I get an error stating there is an undefined function. Not sure if sql supports that function or not, but that is what I need to accomplish.

Chris Scott
The Whole Computer Medical Systems
 
Which type of db are you using? That will help, because there may be some functions for the given db that may help you out. If the variables you are passing are also in the db then maybe you can try a subquery for instance:

Update reports Set(archived) = (Select hideview From tableName Where userid = #userid#);

Works in Oracle, and should work in SQL Server, but I can't say for sure. Otherwise you can loop through the userids to find the appropriate userid and then plug that into your query. I hope that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top