in reply to Re^2: Appending text to a column in SQL
in thread Appending text to a column in SQL
Something like this:
But of course that's horribly ugly.my $sql = 'DECLARE @ptrval binary(16);' . ' SELECT @ptrval = TEXTPTR(item)' . ' FROM table ' . ' WHERE whatever criteria;' . ' UPDATETEXT table.item @ptrval NULL 0 ?'; $dbh->do($sql,{},"new text");
So, a stored procedure to encapsulate the behaviour:
And then in your code:CREATE PROCEDURE dbo.APPEND_THINGY @id int, @new_text varchar(8000) AS DECLARE @ptrval binary(16) SELECT @ptrval = TEXTPTR(item) FROM table WHERE id = @id UPDATETEXT table.item @ptrval NULL 0 @new_text; GO
my $sql = q{exec append_thingy @new_text = ?}; $dbh->do($sql,{},"new text");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Appending text to a column in SQL
by sgifford (Prior) on Nov 01, 2006 at 17:42 UTC | |
|
Re^4: Appending text to a column in SQL
by Anonymous Monk on May 27, 2008 at 17:14 UTC |