on 10-27-2007 12:20 PM
Hi,
i have a array of string(say array is of length 1000). I want to
compare those string in array with one table column
- whether that table column has a string
if yes
do nothing.
if no
then insert that string into table.
- whether table has obsolete row i.e, the one present in table and
not in array
then delete that row.
How do i go about this, because i see, it is not feasible to loop
through array and search table to find new string OR loop through each
row from table to find some obsolete row
How can i accomplish this task more feasibly(without running query for
each string, for comparission)? Is there any way to find this kind of
problem. I would have been easy if i had to compare two tables(with
UNION and INTERSECT), but it is not the case.
thanks,
kath.
I'm not sure, whether I understand your problem correctly. Only two comments:
- if both arrays are sorted, all can be done running exactly once simultaneously through both arrays.
- if the column is marked as UNIQUE, all column strings will be different. I.e. you cannot insert the same string a second time.
Regards Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.