cancel
Showing results for 
Search instead for 
Did you mean: 

how to compare array of String with column of a table

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

TTK
Employee
Employee
0 Kudos

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