added new GET_COUNTRIES_AND_MESSAGES API in param
This commit is contained in:
parent
d3c943d574
commit
e9eb086f9e
@ -36,6 +36,11 @@ export class ParamTableController {
|
|||||||
return this.paramTableService.GETPARAMVALUES(body);
|
return this.paramTableService.GETPARAMVALUES(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get('GetCountriesAndMessages')
|
||||||
|
GET_COUNTRIES_AND_MESSAGES() {
|
||||||
|
return this.GET_COUNTRIES_AND_MESSAGES();
|
||||||
|
}
|
||||||
|
|
||||||
@Post('/CreateTableRecord')
|
@Post('/CreateTableRecord')
|
||||||
createTableRecord(@Body() body: CreateTableRecordDTO) {
|
createTableRecord(@Body() body: CreateTableRecordDTO) {
|
||||||
return this.paramTableService.CREATETABLERECORD(body);
|
return this.paramTableService.CREATETABLERECORD(body);
|
||||||
|
|||||||
@ -63,6 +63,38 @@ export class ParamTableService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async GET_COUNTRIES_AND_MESSAGES() {
|
||||||
|
let connection;
|
||||||
|
try {
|
||||||
|
connection = await this.oracleDBService.getConnection();
|
||||||
|
|
||||||
|
const result = await connection.execute(
|
||||||
|
`BEGIN
|
||||||
|
MANAGEPARAMTABLE_PKG.GetCountriesAndMessages(:P_CURSOR);
|
||||||
|
END;`,
|
||||||
|
{
|
||||||
|
P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
|
||||||
|
},
|
||||||
|
{ outFormat: oracledb.OUT_FORMAT_OBJECT }
|
||||||
|
);
|
||||||
|
|
||||||
|
await connection.commit();
|
||||||
|
|
||||||
|
const outBinds = result.outBinds;
|
||||||
|
if (!outBinds?.P_CURSOR) {
|
||||||
|
this.logger.error('One or more expected cursors are missing from stored procedure output.');
|
||||||
|
throw new InternalServerException("Incomplete data received from the database.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return await fetchCursor(outBinds.P_CURSOR, ParamTableService.name);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
handleError(error, ParamTableService.name)
|
||||||
|
} finally {
|
||||||
|
await closeOracleDbConnection(connection, ParamTableService.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async CREATETABLERECORD(body: CreateTableRecordDTO) {
|
async CREATETABLERECORD(body: CreateTableRecordDTO) {
|
||||||
|
|
||||||
let connection;
|
let connection;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user