Subject | Re: [IBO] Confusion about StoredProc vs use of Cursor or Query (was Help with OnCallBack) |
---|---|
Author | Chuck Belanger |
Post date | 2005-07-06T16:35:54Z |
Thanks, again, Geoff. Your latest email re CallBack settings will really help
me. I was almost ready to give up.
I spent a number of hours working on your and Helen's suggestions last night.
In regard to your test SP and OnCallback settings:
Looks like I need to play around with these. I could not get the OnCallBack to
fire ever, except as you said when I put a IB_Grid on the test form. Then almost
whenever I clicked on it it would fire; like scrolling.
For any others lurking: I noticed that IBOquery takes about twice as long as
IB_query to pull up records from the SELECT SP.
Simply adding to the FILTER property "ml_id <> 0" worked well and quickly to
limit the dataset (and setting FILTERED true).
(Not sure what you had in mind for OnFilterRecord.)
Tried a number of things to make a detail dataset from the SELECT SP, but was
not able to do this easily:
1. This did not work. Could it? SELECT ML_ID, MY_DECRYPT_UDF(ml_item, key) AS
ml_item FROM myTable WHERE ml_id in (SELECT mlid FROM MY_SP(KEY, PHRASE)) This
caused the program to appear locked.
Turns out that your revised SP which just returns the record IDs is very fast. I
have not worked with the BLOBs yet, but if I can get a detail record set from
the SELECT SP, I may not even need the Progress Bar--its that fast. (on the
other hand, see below, I'm wondering if the My_Decrypt_UDF is actually
decrypting each row properly in this SP. I'll check later today.)
2. Tried to make the SELECT SP query either the KeySource or the MasterSource
for a detail dataset. I could not get this to work. Maybe its just my lack of
knowing how to set this up? (I did set KeyRelation, KeyLinks)
3. Tried in an IBOQuery to make the SELECT SP the Datasource with Keylinks set.
Again, no go.
4. I could parse out the results of the SELECT SP into a new SELECT using WHERE
ml_id IN (id0001..id1499) OR IN (etc...) as suggested recently in the FB support
group; but this seems pretty convoluted and I guess one of the above methods
should work better.
(He said hopefully :) )
Any suggestions to getting a detail dataset?
New topic, but definitely related to all this decryption thing and discovered
last night:
When using f_substr (from FreeUDFLib and when looking at the Delphi code, its
just POS( ) function ) to see if a phrase or string is in a decrypted field
(after using MY_Decrypt_UDF) , this function only seems to work for 1 or 2
characters. If a full word, it does not show a hit (a return of > -1). It works
just fine on a fully unencrypted table.
Is there some kind of optimization occuring in FB that keeps this function from
working as expected? I'm thinking that I could output all the decrypted
ML_UPPER_ITEM to a file and peruse that and see. Any other suggestions? I know
it works fine on the client side to check this with an equivalent function.
Would it be best to create another UDF which does the decryption and seeing if
the passed string is in the decrypted field? i.e. keep all that two stepped
process in the DLL rather than call two functions like I've been doing.
This POS function or something like it is critical to this whole process of
searching for contained phrases.
(Whew! this entire encryption-decryption thing is really frought with a lot of
"gotcha's.")
Thank you,
Chuck
me. I was almost ready to give up.
I spent a number of hours working on your and Helen's suggestions last night.
In regard to your test SP and OnCallback settings:
Looks like I need to play around with these. I could not get the OnCallBack to
fire ever, except as you said when I put a IB_Grid on the test form. Then almost
whenever I clicked on it it would fire; like scrolling.
For any others lurking: I noticed that IBOquery takes about twice as long as
IB_query to pull up records from the SELECT SP.
Simply adding to the FILTER property "ml_id <> 0" worked well and quickly to
limit the dataset (and setting FILTERED true).
(Not sure what you had in mind for OnFilterRecord.)
Tried a number of things to make a detail dataset from the SELECT SP, but was
not able to do this easily:
1. This did not work. Could it? SELECT ML_ID, MY_DECRYPT_UDF(ml_item, key) AS
ml_item FROM myTable WHERE ml_id in (SELECT mlid FROM MY_SP(KEY, PHRASE)) This
caused the program to appear locked.
Turns out that your revised SP which just returns the record IDs is very fast. I
have not worked with the BLOBs yet, but if I can get a detail record set from
the SELECT SP, I may not even need the Progress Bar--its that fast. (on the
other hand, see below, I'm wondering if the My_Decrypt_UDF is actually
decrypting each row properly in this SP. I'll check later today.)
2. Tried to make the SELECT SP query either the KeySource or the MasterSource
for a detail dataset. I could not get this to work. Maybe its just my lack of
knowing how to set this up? (I did set KeyRelation, KeyLinks)
3. Tried in an IBOQuery to make the SELECT SP the Datasource with Keylinks set.
Again, no go.
4. I could parse out the results of the SELECT SP into a new SELECT using WHERE
ml_id IN (id0001..id1499) OR IN (etc...) as suggested recently in the FB support
group; but this seems pretty convoluted and I guess one of the above methods
should work better.
(He said hopefully :) )
Any suggestions to getting a detail dataset?
New topic, but definitely related to all this decryption thing and discovered
last night:
When using f_substr (from FreeUDFLib and when looking at the Delphi code, its
just POS( ) function ) to see if a phrase or string is in a decrypted field
(after using MY_Decrypt_UDF) , this function only seems to work for 1 or 2
characters. If a full word, it does not show a hit (a return of > -1). It works
just fine on a fully unencrypted table.
Is there some kind of optimization occuring in FB that keeps this function from
working as expected? I'm thinking that I could output all the decrypted
ML_UPPER_ITEM to a file and peruse that and see. Any other suggestions? I know
it works fine on the client side to check this with an equivalent function.
Would it be best to create another UDF which does the decryption and seeing if
the passed string is in the decrypted field? i.e. keep all that two stepped
process in the DLL rather than call two functions like I've been doing.
This POS function or something like it is critical to this whole process of
searching for contained phrases.
(Whew! this entire encryption-decryption thing is really frought with a lot of
"gotcha's.")
Thank you,
Chuck