Ask a Question related to ASP, Design and Development.
-
atse #1
divide a string
Hi,
I have a string:
mystring="1234,5678,985,21544,55524,11264, ... ,"
How can I divide this string into
1234
5678
985
....
11264
....
And then delete records corresponding to these separated strings?
delete from mytable where id = '1234'
....
delete from mytable where id = '11264'
....
Thanks for any help.
Atse
atse Guest
-
Convert String to Int then divide
Here is my code: <cfdirectory directory = "f:\testbed\documents\" name = "myDirectory" sort = "name ASC, size DESC"> <!--- Output the contents... -
Divide 24h into parts
Hello, I'm creating a small web application for my company, but I can't find a good and reliable algorithm to create a function which divides... -
Divide by Zero in RDE
On Fri, Oct 10, 2003 at 01:15:13AM +0900, Johan Nilsson wrote: You mentioned a patch for another version. I have once upgraded RDE to a newer... -
divide
Hello, I'm new in php and i've got allready a problem. I wanna divide 2 numbers and the result to be an integer separated by comma. For example:... -
Gap when using Divide
Hello, I was trying Freehand MX and noticed that when using the Divide command, appears a small gap between the newly created shapes... Is there a... -
dlbjr #2
Re: divide a string
mystring = "1234,5678,985,21544,55524,11264, ... ,"
arrData = Split(mystring ,",")
For intCount = 0 To UBound(arrData )
Delete arrData (intCount )
Next
'This is not the most efficient way.
-dlbjr
Discerning resolutions for the alms
dlbjr Guest
-
atse #3
Re: divide a string
Got it, thanks
"dlbjr" <dontknow@do.u> wrote in message
news:BO1jb.136$Qy4.11340@typhoon01...> mystring = "1234,5678,985,21544,55524,11264, ... ,"
> arrData = Split(mystring ,",")
> For intCount = 0 To UBound(arrData )
> Delete arrData (intCount )
> Next
>
> 'This is not the most efficient way.
>
>
> -dlbjr
>
> Discerning resolutions for the alms
>
>
atse Guest
-
Dan Brussee #4
Re: divide a string
On Wed, 15 Oct 2003 01:34:25 GMT, "atse" <dunggaze@yahoo.com> wrote:
If the id is a string, you will need to build a string of comma>Hi,
>I have a string:
>mystring="1234,5678,985,21544,55524,11264, ... ,"
>
>How can I divide this string into
>1234
>5678
>985
>...
>11264
>...
>
>And then delete records corresponding to these separated strings?
>
>delete from mytable where id = '1234'
>...
>delete from mytable where id = '11264'
>...
>
>Thanks for any help.
>
>Atse
>
delimited single quoted values.
Once you get the string, use the Split command to get an array of
values.
A(0) will = "1234"
A(1) will = "5678"
etc.
From here, cycle through the array appending to a string
t = t & "'" & a(x) & &"',"
Now use an SQL state ment like
"delete from mytable where id in (" & t & ")"
However, if your id values are numeric, you are basically there. Use
the same method generate the sql statement, substituting the original
string for t.
Dan Brussee Guest
-
Manohar Kamath [MVP] #5
Re: divide a string
How about using the string in the SQL statement
DELETE FROM myTable WHERE ID IN(12,23,34,45)
Simpler than deleting one record at a time.
--
Manohar Kamath
Editor, .netBooks
[url]www.dotnetbooks.com[/url]
"atse" <dunggaze@yahoo.com> wrote in message
news:Bu1jb.338155$Lnr1.40547@news01.bloor.is.net.c able.rogers.com...> Hi,
> I have a string:
> mystring="1234,5678,985,21544,55524,11264, ... ,"
>
> How can I divide this string into
> 1234
> 5678
> 985
> ...
> 11264
> ...
>
> And then delete records corresponding to these separated strings?
>
> delete from mytable where id = '1234'
> ...
> delete from mytable where id = '11264'
> ...
>
> Thanks for any help.
>
> Atse
>
>
Manohar Kamath [MVP] Guest



Reply With Quote

