Forum Post: RE: ADD-NEW-FIELD on a dynamic temp-table

  • Thread starter Thread starter Tom Kincaid
  • Start date Start date
Status
Not open for further replies.
T

Tom Kincaid

Guest
I think you meant to post this to one of the OpenEdge forums correct? From: Marc [mailto:bounce-piveux@community.progress.com] Sent: Tuesday, June 09, 2015 6:25 AM To: TU.Rollbase@community.progress.com Subject: [Technical Users - Rollbase] ADD-NEW-FIELD on a dynamic temp-table ADD-NEW-FIELD on a dynamic temp-table Thread created by Marc Hi all, I'm trying to create a simple temp-table at run-time ; here is the code I use : CREATE TEMP-TABLE hTable. hTable:ADD-NEW-FIELD ( "idGroup", "character"). hTable:ADD-NEW-FIELD ( "nomGroupe", "character"). hTable:TEMP-TABLE-PREPARE("Soldes"). Now as I try to add some data in this temp-table with : hBufTTSoldesGroup = hTable:DEFAULT-BUFFER-HANDLE. DO TRANSACTION: BufferGroup:BUFFER-CREATE(). hBufferGroup:BUFFER-FIELD ("idGroup"):BUFFER-VALUE = "AAA". END. I get an error message speaking about index at 0... well I finally understand that the name "idGroup" doesn't exists in the temp-table. If I change it by the index 1, than I seems to work. So I found a small piece of code, to get the field name of my temp-table, and I get all fields named "Soldes" ! (this should be the temp-table name) DEFINE VARIABLE ii AS INTEGER. DEFINE VARIABLE hFieldBufferHandle AS HANDLE NO-UNDO. DEFINE VARIABLE hRecordBufferHandle AS HANDLE NO-UNDO. ASSIGN hRecordBufferHandle = hTable:DEFAULT-BUFFER-HANDLE. DO TRANSACTION: DO ii = 1 TO hRecordBufferHandle:NUM-FIELDS: hFieldBufferHandle = hRecordBufferHandle:BUFFER-FIELD(ii). MESSAGE "hRecordBufferHandle:NAME " ii " = " hRecordBufferHandle:NAME VIEW-AS ALERT-BOX. END. END. I'm using openedge 11.2 ... anyone have an idea why I can't use my "idGroup" ? Next, I need to create a probindingsource using this temp-table, and, probably because I have many fields with the same name, creating the binding source crash the application. Thanks Stop receiving emails on this subject. Flag this post as spam/abuse.

Continue reading...
 
Status
Not open for further replies.
Back
Top