AnsweredAssumed Answered

Getting ALL field names from a table

Question asked by AdamHorne on Feb 19, 2016
Latest reply on Jul 10, 2018 by user19752

I'm trying to generate a log with field names and values using SQL. I'm trying to figure out a way to get the fieldname : value.

 

For example:

 

Let ( [

 

~q = "SELECT * from sqlAccounts WHERE id = 'F6DA50DC-D860-462E-8231-F26B7CEFB34F'"

 

] ;

 

ExecuteSQL ( ~q ; ¶ ; ¶ )

)

 

Produces:

 

F6DA50DC-D860-462E-8231-F26B7CEFB34F

ACME Films

Active

8816 Some St.

 

And I want to produce something like this:

 

id | F6DA50DC-D860-462E-8231-F26B7CEFB34F

name | ACME Films

status | Active

street | 8816 Some St.

 

Is there a way to produce the field names from the table so I can then just loop through the sql results and add the fieldName and "|" to the text?

Outcomes