The general commands that we use to select data through People Code are
1. SQL Exec - To select different values of a single row.
2. Select SQL - To select multiple values of multiple rows.
1. SQL Exec Syntax
SQLExec("select distinct EMPLID,ACAD_PROG from PS_ACAD_PROG where emplid = :1", "20163-19955", "20066", &getEmplidID,&getAcadProg);
2. Select SQL Syntax
Local SQL &GRD_SQL;
Local Rowset &GRD_RS;
Local Record &rec;
Local Rowset &rsGrid, &rsDataSource;
&GRD_RS.Flush();
&sSQLWhere = "acad_career = 'UGRD'";
&GRD_SQL = CreateSQL("select distinct emplid , phone from ps_hon_no_vw where " | &sSQLWhere | "");
While &GRD_SQL.Fetch(&emplid, &phone_nbr)
&GRD_RS(1).PHN_NO_WRK.EMPLID.Value = &emplid;
&GRD_RS(1).PHN_NO_WRK.PHONE.Value = &phone_nbr;
&GRD_RS.InsertRow(0);
End-While;
&GRD_RS.DeleteRow(1);
&GRD_SQL.Close();
End-If;
No comments:
Post a Comment