473,395 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

LOCATE function bug?

Hello.

v8.2.1
Try this (and any 3-d argument):
---
select locate('','string',5) from sysibm.sysdummy1;
---
Is it a feature or a bug?

Sincerely,
Mark B.

Jan 11 '07 #1
3 4045
4.****@mail.ru wrote:
Hello.

v8.2.1
Try this (and any 3-d argument):
---
select locate('','string',5) from sysibm.sysdummy1;
---
Is it a feature or a bug?
$ db2 "values locate('','string',5)"

1
-----------
5

1 record(s) selected.

This is exactly what I would expect: at position 5 is the first occurrence
where an empty string starts.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jan 11 '07 #2
And how about 3-d argument length(source_string) ?
For example,
posstr(substr('string', 10), '')
returns error, but
locate('','string',10)
returns 10...
$ db2 "values locate('','string',5)"

1
-----------
5

1 record(s) selected.

This is exactly what I would expect: at position 5 is the first occurrence
where an empty string starts.
Jan 12 '07 #3
4.****@mail.ru wrote:
And how about 3-d argument length(source_string) ?
For example,
posstr(substr('string', 10), '')
returns error, but
locate('','string',10)
returns 10...
That's inconsistent, indeed...

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jan 12 '07 #4

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

Similar topics

1
by: Andrew | last post by:
Dear Experts, I have a perl program that using Getopt:Std module, when I try to run the GetOpt program, the following error returned: Can’t locate Getopt.pm in @INC (@INC contains:...
0
by: packrat | last post by:
I am attempting to build a Bugzilla server on OS X. All of this is new to me, working with the Perl, MySQL, and Bugzilla, so I have been banging my head often. Software error: When I run the...
3
by: John Black | last post by:
Hi, In debugging a core dump, I run purify against my code, it says several "Free Memory Read" errors. All the errors are on one delete statement. Usually this means some pointer is deleted by...
2
by: hikums | last post by:
how can I use a function inside a function, for example I want to select col1, col2 from table1 where locate(dayofweek(current date),col3) =dayofweek(current date) col3 is a field that contains a...
7
by: mwt | last post by:
Is there a function in python that does what "locate" does in a bash shell? I know I could do it by using os.popen('locate'), but I'm curious if there's a Python "native" way to go about it....
0
by: SushiSean | last post by:
When executing the xmlhttp.send function to request shipper for available shipments (I send xml as string and receive result xml): XMLHTTP xmlhttp = new XMLHTTP(); xmlhttp.open("POST",...
1
by: Thomas K. Nielsen | last post by:
Hi I dynamically insert some stylesheets. I want them to be placed before some javascript is executed. I know I can add an id to the scripttag that I want the stylesheets to be insert above, but I...
4
by: zerogreen | last post by:
Hi I am looking for an equivalent to the LOCATE function from MySQL. I have a query(PHP) that looks like this: $query="SELECT * FROM table WHERE LOCATE('".$var."', field)> 0 ORDER BY...
0
by: CtrlAltDel2008 | last post by:
Hello everyone, i hope you can help me with this query. The code below all works fine, referring to the SUBSTRING part, at the moment it just displays all the text from the "http" part until the end...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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,...

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.