Prajan
New Member
I have a problem regarding the using of table name in the query.
For eg I have a program client.p where i have a table name. I have to pass this table name to the serverprog.p program which runs asynchronously from the client.p.
DEFINE VARIABLE async-request AS HANDLE.
DEFINE VARIABLE s-hdl AS HANDLE.
DEFINE VARIABLE customer-name as CHARACTER INITIAL "krishna".
DEF VAR table-name AS CHARACTER NO-UNDO INITIAL "try".
DEF VAR ret AS LOGICAL NO-UNDO.
CREATE SERVER s-hdl.
ret = s-hdl:CONNECT("-AppService pfa-app -H 10.0.1.1 -S 5162").
RUN s/serverprog.p ON s-hdl
ASYNCHRONOUS SET async-request EVENT-PROCEDURE "GetCustNum" (INPUT customer-name, INPUT table-name) "try".
WAIT-FOR PROCEDURE-COMPLETE OF async-request.
PROCEDURE GetCustNum:
DELETE OBJECT SELF.
END.
This is a client.p program. Here I have to pass table-name to the serverprog.p program.
DEFINE INPUT PARAMETER customer-name AS CHARACTER.
DEFINE INPUT PARAMETER table-name AS CHARACTER .
MESSAGE "Server prog" table-name.
DEF TEMP-TABLE tt-try LIKE (......).
FIND FIRST try WHERE try.NAME = customer-name.
CREATE tt-try.
ASSIGN tt-try.NAME = try.NAME
tt-try.roll = try.roll
tt-try.addr = try.addr.
Now this is a serverprog.p program.
In table-name i got the table-name from the client program. Now i have to use this table name in
DEF TEMP-TABLE tt-try LIKE (......).
FIND FIRST (......) WHERE (.....).NAME = customer-name.
Hope to hear solutions from all the progress users. Also Happy Vijaya Dashami to all dear friends.
For eg I have a program client.p where i have a table name. I have to pass this table name to the serverprog.p program which runs asynchronously from the client.p.
DEFINE VARIABLE async-request AS HANDLE.
DEFINE VARIABLE s-hdl AS HANDLE.
DEFINE VARIABLE customer-name as CHARACTER INITIAL "krishna".
DEF VAR table-name AS CHARACTER NO-UNDO INITIAL "try".
DEF VAR ret AS LOGICAL NO-UNDO.
CREATE SERVER s-hdl.
ret = s-hdl:CONNECT("-AppService pfa-app -H 10.0.1.1 -S 5162").
RUN s/serverprog.p ON s-hdl
ASYNCHRONOUS SET async-request EVENT-PROCEDURE "GetCustNum" (INPUT customer-name, INPUT table-name) "try".
WAIT-FOR PROCEDURE-COMPLETE OF async-request.
PROCEDURE GetCustNum:
DELETE OBJECT SELF.
END.
This is a client.p program. Here I have to pass table-name to the serverprog.p program.
DEFINE INPUT PARAMETER customer-name AS CHARACTER.
DEFINE INPUT PARAMETER table-name AS CHARACTER .
MESSAGE "Server prog" table-name.
DEF TEMP-TABLE tt-try LIKE (......).
FIND FIRST try WHERE try.NAME = customer-name.
CREATE tt-try.
ASSIGN tt-try.NAME = try.NAME
tt-try.roll = try.roll
tt-try.addr = try.addr.
Now this is a serverprog.p program.
In table-name i got the table-name from the client program. Now i have to use this table name in
DEF TEMP-TABLE tt-try LIKE (......).
FIND FIRST (......) WHERE (.....).NAME = customer-name.
Hope to hear solutions from all the progress users. Also Happy Vijaya Dashami to all dear friends.