Replace-Function with Sybase?



Hi everybody

I have the following Problem(s):

As search-expression, I do have a Number with 11 digits (like 12345678909)
as varchar. It can start with some 0 (like 00001234567).
Now, the attribute I need to query for is a string with 30 Digits.

Problem Nr 1:

The "Numbers" (varchar(30)) on the DB are stored like this:

12.345.67
00-123-456-7
1-2-3-4-5-6-7/L
123.456.7 BLAHBLAH

Means: Its just in the DB somehow, surrounded by dots, -es, slashes, chars
or other crap.

So on, i need to compare a number like 00001234567 with a varchar(30) on the
DB, which is maybe formated like "12.345.BLABLA.67".

Problem Nr 2:

I tried to use the Replace function for something like:

SELECT REPLACE('12.345.BLABLA.67','[^0-9]','')
go;


Or, for expamle:

SELECT REPLACE('hello world','world','sunshine')
go;

Now, the use of replace with this syntax causes an error:

" Incorrect syntax near the keyword 'REPLACE'. "

But I think the syntax is correct, and if the function wouldn't be around,
it would sound like:

"Function 'REBLASE' not found. If this is a SQLJ function, use sp_help to
check whether the object exists (sp_help may produce a large amount of
output)."

Help.

Alexander



.



Relevant Pages

  • Re: pass arguments to function
    ... VB syntax is funny. ... argument list of a sub procedure. ... >I am passing values for search criteria, query and sort order for the query ... >Public Sub QuickSearch(strSearch As String, qry As String, ord As String) ...
    (microsoft.public.access.modulesdaovba)
  • Text field in a group by, how can I make it work?
    ... Table1 Group By Field1. ... I think the syntax is correct, ... that Field1 is of type Text (and not varchar). ... convert this field into something else directly in the query so the query ...
    (microsoft.public.sqlserver.fulltext)
  • Re: updating field with data from other fields
    ... "space" in the string. ... it should have been an "Update" query. ... > the syntax does look a little confusing with those in there ... >> Al Camp ...
    (microsoft.public.access.gettingstarted)
  • Re: validate sql syntax
    ... > do you use a single method for all types of query? ... and need to just verify that the syntax of the string ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: EXISTS reserved word in FROM clause
    ... we make a good pair because I know Access SQL ... from what you described the query syntax that I ... >The subquery should return the records: ...
    (microsoft.public.access.queries)