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 4 3994
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
Got it, thanks
"dlbjr" <do******@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
On Wed, 15 Oct 2003 01:34:25 GMT, "atse" <du******@yahoo.com> wrote: 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
If the id is a string, you will need to build a string of comma
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.
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 www.dotnetbooks.com
"atse" <du******@yahoo.com> wrote in message
news:Bu*********************@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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jack Smith |
last post by:
Hello,
I am working on the following problem. I need a divide and conquer
algorithm to solve the following problem. Any help is appreciated.
I have a set of coordinates (x,y) and each...
|
by: Dan |
last post by:
Hi,
I want to get the height of an element and dividing by 2, but i don't know
how.
See the code:
<DIV ID="myDiv" STYLE="position:absolute; height:200">
....</div>
<script>
myObj =...
|
by: Nobody |
last post by:
I have some code that I am trying to optimize for speed...
trying to squeeze every last CPU cycle out... I remembered an old trick
where dividing & multiplying can be sped up by using bitshifts...
|
by: per.nordlow |
last post by:
Hey there!
I want to multiply/divide (shift) a float with variable containing a
power-of-two value: 2, 4, 8, 16, ....
Is there such a function in the C standard library or the glibc library...
|
by: Kevin |
last post by:
Dim X as int32
Dim Y as int64
X = Y / 1024
gives me the error:
"Operator is not valid for type 'UInt64' and type 'Integer'."
I'm new to VB.NET and this is one of the reasons why I've...
|
by: Spiros Bousbouras |
last post by:
Do you have an example of an implementation where
sizeof(short int) does not divide sizeof(int) or
sizeof(int) does not divide sizeof(long int) or
sizeof(long int) does not divide sizeof(long long...
|
by: Justin.Velazquez |
last post by:
Hello everyone,
I'm not really new to programming but my bitwise skills definately need
work.
I came across a problem I've been trying to figure out for fun. I'm
trying to write
a routine...
|
by: programmo |
last post by:
I need to divide in two string an article, to split in more pages:
I have this string:
<hello word>
<hello word2>
|
by: neehakale |
last post by:
pls tel me...
I have to store data to heap file from a simple file.my file contain numeric data and string data...i have to divide tha data into numric and string. i.e.
my file...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |