Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

Search Error

Hi all
I have a code snippet below used to search for values in table

I am having problem with searching for values with 00 as string
why would the query be returning only the first records set and not the rest of 100's


The command is run withing the store procedure

set @sql_where        = ' and (Table.F0ArtNr like '''+@strSuchStr+''')'

The where statement goes    =    where        Table.F0ArtNr like @strSuchStr

and
 

if substring(@strSuchStr,1,1) = '?'
            begin
            set @sZahl = substring(@strSuchStr,2,len(@strSuchStr))
            end
        else
            begin
            set @sZahl = @strSuchStr
            end
   
        if isnumeric(substring(@sZahl,1,6)) = 1
            begin
            set @iSearchArtNr = 1
            end
        else
            begin
            set @iSearchArtNr = 0
            end
 
        set @strSuchStr = upper(ltrim(rtrim(@strSuchStr)))+'%'
 
 
        if substring(@strSuchStr,1,1) = '?'
            begin
            set @strSuchStr = '%'+substring(@strSuchStr,2,len(@strSuchStr))
            end

Open in new window

0
ZURINET
Asked:
ZURINET
  • 3
  • 2
1 Solution
 
momi_sabagCommented:
i didn't understand your problem
0
 
ZURINETAuthor Commented:
Hi

Would any of the set @strSuchStr = '%'+substring(@strSuchStr,2,len(@strSuchStr))
construct be removing 00 in a string

That is if I decide to search for 000999
would the substring be removing the 00 in the string?
0
 
momi_sabagCommented:
no
0
 
ZURINETAuthor Commented:
What I know is that one of this substring is removing all the 0 digits if the search string starts with 0
0
 
ZURINETAuthor Commented:
Will run a test in console and find out which on is doing this
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now