Skip to content

Instantly share code, notes, and snippets.

@nvg
Last active July 5, 2019 17:48
Show Gist options
  • Select an option

  • Save nvg/1482c6167864c74009542f8ed8f4cb16 to your computer and use it in GitHub Desktop.

Select an option

Save nvg/1482c6167864c74009542f8ed8f4cb16 to your computer and use it in GitHub Desktop.
PS: Get record
method GetRec
/+ &p_key as String, +/
/+ Returns Record +/
Local Record &result = CreateRecord(Record.MY_REC);
Local string &sqlStr = "SELECT * FROM PS_MY_REC WHERE KEY = :1";
SQLExec(&sqlStr, &p_key, &result);
Return &result;
/* - OR - */
&result = CreateRecord(Record.MCM_VALIDATE_VW);
Local SQL &sql = CreateSQL("%Selectall(:1) WHERE :2", &result, &someParam);
While &SQL2.Fetch(&result)
End-While;
/*- OR -*/
Local Record &rec = CreateRecord(Record.MCM_OPT_STDNT);
Local SQL &sql = CreateSQL("%Selectall(:1 S) WHERE S.EMPLID = :1 AND S.STRM = :2");
&sql.Execute(&rec, &p_emplid, &p_strm);
If &sql.Fetch(&rec) Then
Return &rec;
End-If;
Return Null;
end-method;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment