rajaselvam26
New Member
Hi All,
I am creating a UserCreation.p file, from that file I am trying to connect the Database. But I cant able to do that. At that time I am getting the Following Error.
Unknown or ambiguous table TBL_TENANT. (725)
** Could not understand line 18. (196)
Below is my Code :
DEFINE INPUT PARAMETER i_TenantName AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER i_UserName AS CHARACTER NO-UNDO.
DEFINE VARIABLE tenantID AS INTEGER NO-UNDO.
/* check database connections */
IF NOT CONNECTED ("sports2000") THEN DO:
MESSAGE "Database sports2000 is not connected!"
VIEW-AS ALERT-BOX ERROR.
RETURN .
END.
FIND TBL_TENANT
WHERE TENANT_NAME = i_TenantName.
IF AVAILABLE(TBL_TENANT) THEN
DO:
tenantID = TBL_TENANT.TENANT_ID.
DEFINE VARIABLE currentCust AS INTEGER.
currentCust = NEXT-VALUE(sports2000.NextCustNum).
CREATE sports2000.C_USER.
ASSIGN C_USER.U_ID = currentCust
C_USER.U_NAME = i_UserName
C_USER.U_STATUS = 1
C_USER.U_TENANT_ID = tenantID NO-ERROR.
RETURN "SUCCESS!".
END.
Please help me.
- Rajaselvam.M
I am creating a UserCreation.p file, from that file I am trying to connect the Database. But I cant able to do that. At that time I am getting the Following Error.
Unknown or ambiguous table TBL_TENANT. (725)
** Could not understand line 18. (196)
Below is my Code :
DEFINE INPUT PARAMETER i_TenantName AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER i_UserName AS CHARACTER NO-UNDO.
DEFINE VARIABLE tenantID AS INTEGER NO-UNDO.
/* check database connections */
IF NOT CONNECTED ("sports2000") THEN DO:
MESSAGE "Database sports2000 is not connected!"
VIEW-AS ALERT-BOX ERROR.
RETURN .
END.
FIND TBL_TENANT
WHERE TENANT_NAME = i_TenantName.
IF AVAILABLE(TBL_TENANT) THEN
DO:
tenantID = TBL_TENANT.TENANT_ID.
DEFINE VARIABLE currentCust AS INTEGER.
currentCust = NEXT-VALUE(sports2000.NextCustNum).
CREATE sports2000.C_USER.
ASSIGN C_USER.U_ID = currentCust
C_USER.U_NAME = i_UserName
C_USER.U_STATUS = 1
C_USER.U_TENANT_ID = tenantID NO-ERROR.
RETURN "SUCCESS!".
END.
Please help me.
- Rajaselvam.M