What special little thing does table.select need?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have opened a datset from an Oracle Database.

I am trying to 'Select' a non key column.

strFind = "INTERNAL_EMPL_ID = '" & provId & "'" - This yields :

"INTERNAL_EMPL_ID = '0000015615'"

drArray = ds.Tables(0).Select(strFind)

This should return a single row row array but it does not. No exception is thrown.

in the immediate window the phrase :

? isNothing(ds.tables(0).select("INTERNAL_EMPL_ID = '0000015615'"))

Yields False and I have seen the id in the table. I know it is out there. Why won't Select find it?

help.

mklapp
 
IsNothing yields False - which means there is a result coming back.

Now, Select always returns an array of rows - even if that array is of
length 0. So I think the statement you have there will always return False -
the array object will never be Nothing - it might be of length 0, but that's
not the same thing.
 
OK. You have a point. However, the value is present in the table in the column specified and yet Select is not returning any rows. This is undesirable. I could stop everthing and recode to use my own trusty binary search routine but I expect documented methods to work as documented (just an "old School" programmer, I guess).

Anyway, bottom line, How do I get Select to work as advertised. Have I left something out? Do I have something wrong i the excerpted code. The oracle column is nvarchar(10) and the sought after value is also 10 characters long.

Why is Select not returning rows?
 
Perhaps you have one too many or not enough 0's in the ID you are looking
for.

if the Length of the array being returned is 0 - then typically the issue is
a type or something like that. I've definitely done Selects on non-key
columns and gotten results.

mklapp said:
OK. You have a point. However, the value is present in the table in the
column specified and yet Select is not returning any rows. This is
undesirable. I could stop everthing and recode to use my own trusty binary
search routine but I expect documented methods to work as documented (just
an "old School" programmer, I guess).
Anyway, bottom line, How do I get Select to work as advertised. Have I
left something out? Do I have something wrong i the excerpted code. The
oracle column is nvarchar(10) and the sought after value is also 10
characters long.
 
As have I. I have used Select on several occasions and have never had this issue. Of course this was filled from an Oracle DB. Is that an Issue? I don't know.

I have counted the zeroes even though the value here is only entered once into the DB and propagated programmatically.

In the Immediate Window, I never got the 'False' result until I placed 0000015615 (or whatever) in double quotes. My inclination is to use double quotes, but haven't get them into strFind.

I find it hard to believe that since the source of the data was Oracle, there was some sort of inherent condition that complicates this. After all, this is a disconnected dataset.
 
I don't understand what 'False' you are talking about. Is the length of the
array being returned from Select 0?

The only thing I can say is make sure the value you are looking for is
actually there - and identical to what you are looking for.

mklapp said:
As have I. I have used Select on several occasions and have never had
this issue. Of course this was filled from an Oracle DB. Is that an Issue?
I don't know.
I have counted the zeroes even though the value here is only entered once
into the DB and propagated programmatically.
In the Immediate Window, I never got the 'False' result until I placed
0000015615 (or whatever) in double quotes. My inclination is to use double
quotes, but haven't get them into strFind.
I find it hard to believe that since the source of the data was Oracle,
there was some sort of inherent condition that complicates this. After all,
this is a disconnected dataset.
 
Back
Top