Hi.. I have an appserver and I call it from a procedure on a client.... how do I select data from a table and PASS it back to the client
The procedure on the AppServer should create a temp-table with the required data (or a dataset if on OE10) and pass that back to the client.
So, the client proc:
Define Temp-Table ttMyTable......
Run xzy.p on hAppSrv (Output Table ttMyTable).
And on the AppServer, xyz.p says:
Define Temp-Table ttMyTable......
Define Output Parameter For Table ttMyTable.
For each.....
Create ttMyTable.
Buffer-copy....
End.
Thanks for the info... here is my code on server
DEF VAR cEmpNum AS CHAR.
cEmpNum = " 3567".
DEFINE TEMP-TABLE ttEmpHours LIKE tct.dcnew.
DEFINE OUTPUT PARAMETER TABLE FOR ttEmpHours.
For EACH tct.dcnew WHERE tct.dcnew.emp-num = cEmpNum
AND tct.dcnew.trans-date = 6/21/07 No-Lock:
CREATE ttEmpHours.
BUFFER-COPY tct.dcnew TO ttEmpHours NO-ERROR.
End.
RETURN.
and syntax check is ok... when I run the client side sever gives error... says can't understand line 3... and the broker server log has
06:32:29 27 Jun 2007 Application Server 4136
Application Server connected with connection id: 192.168.1.241::asbroker1::3
090::7c9b26a6524f83db:385c1:1134f15bb8e:-7934. (8358)
06:32:29 27 Jun 2007 Application Server 4136
Unknown database name tct. (855)
06:32:29 27 Jun 2007 Application Server 4136
Unknown or ambiguous table dcnew. (545)
06:32:29 27 Jun 2007 Application Server 4136
.\GetData.p Could not understand line 3. (196)
06:32:40 27 Jun 2007 Application Server 4136
Application Server disconnected. (8360)
name of data base and table/fields are correct database is running
what am I missing?
do I need to do a connect?
You need to set the AppServer to connect to the database you require, either at startup (preferred method, due to overheads) or when the client connects. The reason it compiles okay, is the AppBuilder is connected to the DB in question.
To do it at startup, set up the connection in the 'Server Startup Parameters' under the Agent/General section of the AppServer you are trying to connect to.
wow that works I did have the app server starting my test database... so thanks for being up so early and the help... I have another thread that has not been answered... do you know how to disconnect a user from a remote machine
Excellent!!
Early? It's lunch time for us over here in the UK
Sorry, no, I have no idea on that one.