Hi,
Am I correct to conclude that a dynamic temp-table can't have a case sensitive field unless you define it LIKE an existing case sensitive db field?
You can't seem to use ttHandle:ADD-NEW-FIELD() but need ttHandle:ADD-LIKE-FIELD(), which is problematic if you don't have a suitable field, or no db connection at all...
There is a CASE-SENSITIVE attribute on buffer field, but that is read only according to the documentation...
Votes can be added here: openedge.ideas.aha.io/.../OPENEDGE-I-689
|
Thanks Mike, I'll add a feature request for this one.
Votes can be added here: openedge.ideas.aha.io/.../OPENEDGE-I-689
We have quite a few use cases.
Blood Rhesus is a good example (en.wikipedia.org/.../Rh_blood_group_system), where Rh antigens C and c are not the same at all.
for a STATIC temp-table case sensitive works fine:
define temp-table tt
field cc as char case-sensitive
.
def var cname as char.
create tt. tt.cc = "Hi".
message
tt.cc = "hi" skip
tt.cc = "Hi"
view-as alert-box.
using a static temp-table case-sensitive field for the like of a dynamic field does not pass case-sensitive attribute over.
Thanks for correcting me on the static temp-table possibility to add CASE-SENSITIVE, which is what Peter's workaround is based on (nice one!)
I will adjust the original post for correctness sake.
[mention:9e4ee96fac634b8f91b580e1fb4f7e71:e9ed411860ed4f2ba0265705b8793d05] As I wrote, using the static tt for the dynamic tt does not inherit the case-sensitive - (on 11.7.4 or 12.0):
define temp-table tt
field cc as char case-sensitive
.
create tt. tt.cc = "Hi".
message tt.cc = "Hi".
message tt.cc = "hi".
def var ht as handle no-undo.
def var hb as handle no-undo.
create temp-table ht.
ht:add-like-field( "cc", "tt.cc" ).
ht:temp-table-prepare( "tt" ).
hb = ht:default-buffer-handle.
hb:buffer-create().
hb::cc = "Hi".
message hb::cc = "Hi".
message hb::cc = "hi".
And an updated snippet that shows what a case-sensitive compare should have resulted in:
define temp-table tt field cc as char case-sensitive . create tt. tt.cc = "Hi". message tt.cc = "Hi" compare( tt.cc, "=", "Hi", "case-sensitive" ). message tt.cc = "hi" compare( tt.cc, "=", "hi", "case-sensitive" ). def var ht as handle no-undo. def var hb as handle no-undo. create temp-table ht. ht:add-like-field( "cc", "tt.cc" ). ht:temp-table-prepare( "tt" ). hb = ht:default-buffer-handle. hb:buffer-create(). hb::cc = "Hi". message hb::cc = "Hi" compare( hb::cc, "=", "Hi", "case-sensitive" ). message hb::cc = "hi" compare( hb::cc, "=", "hi", "case-sensitive" ).
yes yes
no no
yes yes
yes no !!!
Stefan, have you logged this with technical support? Is there a bug or case number?
[mention:04e040a388574bee96c841b1935762a5:e9ed411860ed4f2ba0265705b8793d05] No, it has no impact for me, but I have given feedback on knowledgebase.progress.com/.../Can-t-add-the-DECIMALS-and-CASE-SENSITIVE-field-options-with-the-ADD-NEW-FIELD-method that case-sensitive does not work.
But it gets even better - case-sensitive is the new gift that keeps on giving. There is a difference between the handling of hb:cc and hb:buffer-field( "cc" ):buffer-value - as in real life, it never pays to take shortcuts [8-|]
define temp-table tt field cc as char case-sensitive . create tt. tt.cc = "Hi". message tt.cc = "Hi" compare( tt.cc, "=", "Hi", "case-sensitive" ). message tt.cc = "hi" compare( tt.cc, "=", "hi", "case-sensitive" ). def var ht as handle no-undo. def var hb as handle no-undo. create temp-table ht. ht:add-like-field( "cc", "tt.cc" ). ht:temp-table-prepare( "tt" ). hb = ht:default-buffer-handle. hb:buffer-create(). hb::cc = "Hi". message hb::cc = "Hi" compare( hb::cc, "=", "Hi", "case-sensitive" ). message hb::cc = "hi" compare( hb::cc, "=", "hi", "case-sensitive" ). message hb:buffer-field( "cc" ):buffer-value = "hi" compare( hb:buffer-field( "cc" ):buffer-value, "=", "hi", "case-sensitive" ).
OK, I'll create a case for this then.