ChatGPT and writing code

Cecil

19+ years progress programming and still learning.
I asked ChatGPT to write an ABL sample dynamic query code this was the result.
1673398227964.png
Code:
DEFINE VARIABLE searchParam AS CHARACTER NO-UNDO.
DEFINE VARIABLE query AS CHARACTER NO-UNDO.

/* Prompt the user for a search parameter */
INPUT searchParam PROMPT "Enter a search parameter: ".

/* Build the query string using the user-specified search parameter */
query = "SELECT * FROM myTable WHERE column1 = '" + searchParam + "'".

/* Execute the query */
FOR EACH myTable WHERE (query)
    /* Process the query results */
    DISPLAY myTable.column1 myTable.column2 myTable.column3.
END.
 
Back
Top