Hi,
I just created a dynamic temp table for testing purpose and tried to output the same in JSON FORMAT. However I'm getting the temp table as blank. Can anybody provide me some inputs on the same?
PROCEDURE
procedure dynamictemp :
DEFINE OUTPUT PARAMETER TABLE-HANDLE hTable .
CREATE TEMP-TABLE hTable.
hTable:ADD-NEW-FIELD("kk","logical").
hTable:TEMP-TABLE-PREPARE("ttkfacilities").
hTable:BUFFER-CREATE().
hTable:BUFFER-FIELD ("kk"):BUFFER-VALUE = TRUE.
end.
TEMP TABLE coming blank in JSON Format
},
"Table": {
"ttkfacilities": []
}
Thanks,
KRISHNA KUMAR
I tried adding the same. However it doesn't work. Still it's showing blank
Consider posting your full code.
Below is the same -
procedure dynamictemp :
DEFINE OUTPUT PARAMETER TABLE-HANDLE hTable .
CREATE TEMP-TABLE hTable.
hTable:ADD-NEW-FIELD("kk","logical").
hTable:TEMP-TABLE-PREPARE("ttkfacilities").
hTable:BUFFER-CREATE().
hTable:BUFFER-FIELD ("kk"):BUFFER-VALUE = TRUE.
hTable:BUFFER-RELEASE().#sthash.0PBCTlsQ.dpuf
end procedure.
That is not the completel code. Where is the WRITE-JSON call?
When you have code that does not work as expected it is very important that you paste the complete code if you want answers that solve the problem. The folks here are good but I don't think any of them are psychic. <smile>
By the way, does the following statement throw an error?
hTable:BUFFER-CREATE().
???
... or does the RUN statement which calls this internal procedure have a NO-ERROR on it? If so, remove it for debugging purposes.
Here is a variation of your code that works. I expect your real issue is that the RUN statement has a NO-ERROR phrase on it there by suppressing the 4052 error you are getting.
define variable hTable as handle.
define variable hBuffer as handle.
CREATE TEMP-TABLE hTable.
hTable:ADD-NEW-FIELD("kk","logical").
hTable:TEMP-TABLE-PREPARE("ttkfacilities").
hBuffer = hTable:default-buffer-handle.
hBuffer:BUFFER-CREATE().
hBuffer:BUFFER-FIELD ("kk"):BUFFER-VALUE = TRUE.
hBuffer:BUFFER-RELEASE().
def var x as longchar.
hTable:write-json("longchar",x).
message string(x) view-as alert-box.