473,809 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error in sql REPLACE

Hi,

I have a minor issue with DB2 UDB on Win32. I have a field containing
text data (raw XML). I am trying to replace a string with another
string (via "update table set field0 = replace(field0, 'sometext',
'newtext') to fix some minor application issues. DB2 returns the
following error:

17:13:41 [UPDATE - 0 row(s), 0.000 secs] [Error Code: -443, SQL
State: 38552] Routine "SYSFUN.REPLACE " (specific name "REPLACE2C" ) has
returned an error SQLSTATE with diagnostic text "SYSFUN:10" .
.... 1 statement(s) executed, 0 row(s) affected, execution time 0.000
sec

Not sure if this is cause by a db2 buffer setting or otherwise. Looked
on the web to no avail. Any suggestions would be useful. The column
is long varchar with a length of 37200. I could write an external app
to do data cleaning for this customer but DB2 should be able to handle
this.

Thanks,

Keith

Nov 12 '05 #1
2 6928

<kk********@hot mail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Hi,

I have a minor issue with DB2 UDB on Win32. I have a field containing
text data (raw XML). I am trying to replace a string with another
string (via "update table set field0 = replace(field0, 'sometext',
'newtext') to fix some minor application issues. DB2 returns the
following error:

17:13:41 [UPDATE - 0 row(s), 0.000 secs] [Error Code: -443, SQL
State: 38552] Routine "SYSFUN.REPLACE " (specific name "REPLACE2C" ) has
returned an error SQLSTATE with diagnostic text "SYSFUN:10" .
... 1 statement(s) executed, 0 row(s) affected, execution time 0.000
sec

Not sure if this is cause by a db2 buffer setting or otherwise.
========
Try "db2 ? sql0443 "
It will tell you the reason - 10 Length or position in string function out
of range
Looked
on the web to no avail. Any suggestions would be useful. The column
is long varchar with a length of 37200. ==========
maximum length of long varchar should be 32700.

I could write an external app
to do data cleaning for this customer but DB2 should be able to handle
this.

Thanks,

Keith

Nov 12 '05 #2
Hi,

Got the same problem, some days ago.
So I created my own REPLACE-function, which works fine for me:

=============== =============== ========
CREATE FUNCTION fcREPLACE(
arg1 VARCHAR(5000),
arg2 VARCHAR(5000),
arg3 VARCHAR(5000)
)
-- Replaces arg2 with arg3 within arg1

RETURNS VARCHAR(5000)
LANGUAGE SQL
DETERMINISTIC
NO EXTERNAL ACTION
CONTAINS SQL

BEGIN ATOMIC

DECLARE i INT;
DECLARE res VARCHAR(5000) DEFAULT '';

IF arg1 IS NULL THEN
RETURN NULL;
END IF;

SET i = 1;
WHILE i <= LENGTH(arg1) DO
IF SUBSTR(arg1, i, LENGTH(arg2)) = arg2
THEN
SET res = res || arg3;
SET i = i + LENGTH(arg2);
ELSE
SET res = res || SUBSTR(arg1, i, 1);
SET i = i + 1;
END IF;
END WHILE;

RETURN res;
END

=============== =============== ========

Greets, Twan Kennis
SKB Vragenlijst Services
Amsterdam, The Netherlands


"Fan Ruo Xin" <fa*****@sbcglo bal.net> wrote in message
news:Fp******** *********@newss vr17.news.prodi gy.com...

<kk********@hot mail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Hi,

I have a minor issue with DB2 UDB on Win32. I have a field containing text data (raw XML). I am trying to replace a string with another
string (via "update table set field0 = replace(field0, 'sometext',
'newtext') to fix some minor application issues. DB2 returns the
following error:

17:13:41 [UPDATE - 0 row(s), 0.000 secs] [Error Code: -443, SQL
State: 38552] Routine "SYSFUN.REPLACE " (specific name "REPLACE2C" ) has returned an error SQLSTATE with diagnostic text "SYSFUN:10" .
... 1 statement(s) executed, 0 row(s) affected, execution time 0.000
sec

Not sure if this is cause by a db2 buffer setting or otherwise.
========
Try "db2 ? sql0443 "
It will tell you the reason - 10 Length or position in string

function out of range
Looked
on the web to no avail. Any suggestions would be useful. The column is long varchar with a length of 37200.

==========
maximum length of long varchar should be 32700.

I could write an external app
to do data cleaning for this customer but DB2 should be able to handle this.

Thanks,

Keith


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" & REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("GenKTitles.
6
3086
by: Séverine Donnay | last post by:
Hello, I try to use the replace function with a very long text and I have this error : error '80020009' Exception occurred. Do you have any idee to resolve this problem ? Thanks
6
4766
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
4
1395
by: PokerMan | last post by:
Hi guys I don't want to put email code in my app itself for security reasons as i don't want a password in my code client side. My app runs with a website in any case so i'd like to do this and this is my requirement: 1) On any error catch error message 2) Send error message to my webpage
1
11508
by: santosh.anumandla | last post by:
Hi all, I am getting the following error randomly, I cannot expalin the exact scenario Active Server Pages error 'ASP 0115' Unexpected error /wmweb/Save.Asp A trappable error (C0000005) occurred in an external object. The script cannot continue running.
1
1377
by: mimranp | last post by:
Hi all i m using visual developer 2008 i m using xhtml1.1 in that .i m reciving so much error when check in online input w3 standard(C# language code behind) <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Listing.aspx.cs" Inherits="Admin_Category_Listing" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>...
3
1594
by: jats | last post by:
I am a .NET programmer and i had recently got a web application designed in Classic ASP, to make some modifications. When i run the application and try to create a new user the following error pops up. "The email address you entered already exists." Now my problem is i am not able to find out the where the error is generating or why as the datdabase table is completely empty (no records) Below is the code... ++++++++++++++++++ <%
0
1343
by: asmx126453 | last post by:
Hey guys i have a question about those 2 funtions the error occures in 2 files my DataConnection.asmx.cs and Funtions.cs error 1 is this il also paste a part of the code were the error is DotNet.Functions' does not contain a definition for 'QuoteFix the filename were the code out is DataConnection.asmx.cs if (nieuw == true) {
14
1677
by: asmx126453 | last post by:
hey guys hope anyone knows what this error means i get the error when i push a button to add values in a SQL database the code were the error point to is this #region filling in txtfields from database private void Vullen_tekstvelden(string OfferteArray, bool nieuw) { txtNoteID.Text = OfferteArray; txtBTW.Text = "19"; txtOfferteNr.Text = OfferteArray; txtDatum.Text = Functions.DateToNL(OfferteArray);...
2
3050
by: aaron6098 | last post by:
I am trying to finish my final project for my programing class. i keep on getting Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) Syntax error (missing operator) in query expression 'OrderID ='. /students/11/scripts/OrdersLines.asp, line 12 I place the ' ;' and then i recieve Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E07) Data type mismatch in criteria expression....
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10643
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10391
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10121
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.