Gossamer Forum
Home : Products : Gossamer Links : Discussions :

GT::SQL UPDATE Question

Quote Reply
GT::SQL UPDATE Question
I am looking for the syntax for manipulating a table's column with a function in an update statement:

Code:


$affected = $lt->update({ Title => 'myfunc(Title)'});


sets all rows to: "myfunc(Title)"

Code:


$affected = $lt->update({ Title => myfunc('Title')});




sets all rows to: "Title"

Code:
$affected = $lt->update({ Title => \'myfunc(Title)'});




Does not do anything... it does not seem to run myfunc, leaving the Title values to be unchanged.


myfunc should be manipulating Title and return a similar string back.

I am assuming the last code example is the one which really should work, as the \ should force the sql parser to not quote the function.


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

Ian: Jul 9, 2002, 8:48 PM
Quote Reply
Re: [Ian] GT::SQL UPDATE Question In reply to
Ok,

It looks like I am trying to put a function into an update statement when I can't.

This would mean
  • Performing a SELECT for each record in turn
  • Executing the function on each record one at a time
  • Then replacing TITLE with an UPDATE for each record


Ugly, for such a simple thing.Unsure


http://www.iuni.com/...tware/web/index.html
Links Plugins