I am creating a Database Resource. In the SQL Editor, I select Native SQL
and in the Select tab, I type in:
SELECT A.CLNTPFX, A.CLNTCOY, A.CLNTNUM, A.SURNAME, A.GIVNAME, B.ADDRTYPE, B.CLTADDR01, B.CLTADDR02, B.CLTADDR03
FROM DBASE_CLIENT.CLNTMAST A INNER JOIN DBASE_CLIENT.CLNTADDR B
ON A.CLNTPFX = B.CLNTPFX AND A.CLNTCOY = B.CLNTCOY AND A.CLNTNUM = B.CLNTNUM AND B.ADDRTYPE = '*'
So far so good. But I don't know how to bring in the Resource fields. The Resource fields box is empty and I can not create table using the resource.
Can anyone tell me which steps I missed out? Thanks beforehand.
Create Database Resource using Native SQL
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 11
- Joined: Thu Jan 05, 2017 11:13 am
- Location: Jakarta
- Contact:
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
You need a resource field for each column returned, so in your case: CLNTPFX, CLNTCOY etc
These resource fields then get mapped to form fields.
There is an alternative approach from V5.2 where you don't need mappings, but you then have to process the results yourself in code:
services.database.executeSelectStatement(databaseConnectionName, sqlStatement, callbackFunction)
These resource fields then get mapped to form fields.
There is an alternative approach from V5.2 where you don't need mappings, but you then have to process the results yourself in code:
services.database.executeSelectStatement(databaseConnectionName, sqlStatement, callbackFunction)
0 x
-
- Ebase User
- Posts: 11
- Joined: Thu Jan 05, 2017 11:13 am
- Location: Jakarta
- Contact:
Who is online
Users browsing this forum: No registered users and 34 guests