Re: multiply(10*12*14)



Darn, Shaw, I think you finally understood the question! How could I have
missed it?

--

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Shaw" <Shaw@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D8AFD18C-A51C-4C50-A957-7876383898FC@xxxxxxxxxxxxxxxx
>I think, you can use "EXEC" command to run a query string in SQL 2000.
> Something likes that:
>
> CREATE PROCEDURE MySoredProcedure
> AS
> DECLARE @lv_SQL VARCHAR(1000)
> SET @lv_SQL = 'SELECT' + '10*12*4'
> EXEC(@lv_SQL)
> GO
>
> Shaw
>
>
> "Kevin Spencer" wrote:
>
>> Thinking it over, as I often do, I have one correction, and one
>> additional
>> note.
>>
>> Correction: I should have said 10*12*4, rather than 10*2*4. Same rules,
>> but
>> sloppy on my part.
>>
>> Additional note: You MAY need to identify if a string is unparsable, and
>> handle the exception. MOST strings can NOT be parsed into mathematical
>> expressions. If, for example, you write a SQL query that is supposed to
>> perform a mathematical operation, and it can not be parsed, the database
>> will throw an exception. So, depending upon how you're getting your
>> string
>> expression, you may need to handle the eventuality that an unparsable
>> string
>> is entered.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> What You Seek Is What You Get.
>>
>> "vips" <ypul@xxxxxxxxxxx> wrote in message
>> news:%23PRZBOuVFHA.3076@xxxxxxxxxxxxxxxxxxxxxxx
>> >I have a string
>> > str="10*12*14"
>> > now I want the total of this value
>> > i.e. 10 multiply 12 multiply 14
>> > how do i get it ?
>> >
>> > is there any function in vb.net to do that ??
>> > if i put it as query to database I get the result, but I want to do it
>> > in
>> > the code.
>> >
>> > vips
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>>


.



Relevant Pages