Page 1 of 1

custom sql not populating grid

Posted: Wed Jan 23, 2013 1:40 pm
by Stuart
I have 6 fields in my grid (1 hidden, 5 output) I am using the custom SQL to create an SQL to substring characters from a column. The grid is not being populated. When I run showErrors(), I receive the below error message:

Run SQL Select Query ID: CPF9897 Message: Invalid Input

The SQL runs on the iSeries:
Select SUBSTRING(NTDESC,1,40) As Desc, NTREDF,NTRFCE,NTRFEM,NTSTAT,NTID From NOITRDPM

The fields in my grid are as follows:
NTID, DESC, NTREDF, NTRFCE, NTRFEM, NTSTAT
(hidden) (Output---------------------------------------)

Does ProfoundUI reference the fields by placement within the grid, or by field name?

Also, is it possible to have a field in the grid that is not a field in the database table?

Re: custom sql not populating grid

Posted: Mon Jan 28, 2013 10:34 pm
by Antonio
Hello Stuart,

ProfoundUI does not reference the fields by placement within the grid, nor by field name. When the Custom SQL property is used, the data is simply placed on the grid. In order to access the data when using Custom SQL, you will need to use javascript (e.g grab the row and column during the onclick event and then grabbing the data in that cell). It seems that you were trying to use the Custom SQL property to populate the 6 fields on your grid, which is not currently possible on Profound UI. I believe your best bet would be to simply use the SQL statement inside of your RPG code and populate the subfile from there as well.

The error message you are getting suggests that there is something wrong with your SQL statement. You should use the STRSQL command and type into the command line your SQL statement to see more information on the problem with your SQL statement.