Create Database Resource using Native SQL

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

alvinsanusi
Ebase User
Posts: 11
Joined: Thu Jan 05, 2017 11:13 am
Location: Jakarta
Contact:

Create Database Resource using Native SQL

#1

Postby alvinsanusi » Fri Jan 20, 2017 12:38 pm

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.
0 x
It is what all eyes see and all fingers point to

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Fri Jan 20, 2017 1:34 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)
0 x

alvinsanusi
Ebase User
Posts: 11
Joined: Thu Jan 05, 2017 11:13 am
Location: Jakarta
Contact:

#3

Postby alvinsanusi » Tue Jan 24, 2017 10:38 am

Thank you Jon,

Found the way already.
And thank you for additional information for version 5.2

Best Regards,

Alvin
0 x
It is what all eyes see and all fingers point to


Who is online

Users browsing this forum: No registered users and 62 guests