Skip to Content
author's profile photo Former Member
Former Member

stored procedures

Hi to all:

my question this time is, if I can use a stored procedures using the SQL syntaxis to execute a Query with formated search in SBO 6.5.

Thanks all for your help

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2004 at 08:23 AM

    Hi Natalie,

    yes you can use stored procedures and functions from formatted search.

    An example that I've used myself: In Denmark we have another format for numbers than in the US. In the US they write 1,000.00 where in Denmark we write 1.000,00. That means that I was not able to convert the numbers I take from fields in SBO to floats so I can do calculations on them.

    To work around that problem I created my own version of cast as follows:

    create function mycast (@NumString nvarchar(50))

    returns float

    as

    begin

    return ( select cast (replace (replace (@NumString,'.',''),',','.') as float) )

    end

    This is created in the database once and for all. After that I can use it everywhere including in a formatted search. as seen below

    select dbo.mycast('123.456,78') + dbo.mycast('1.234,56')

    select dbo.mycast($[$34.0.0]) + dbo.mycast($[£38.0.0])

    Hope this helps

    Rgds

    Jesper Carstensen

    Add comment
    10|10000 characters needed characters exceeded