Compare commits
1 Commits
36529727a0
...
e9eb086f9e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9eb086f9e |
@ -36,6 +36,11 @@ export class ParamTableController {
|
||||
return this.paramTableService.GETPARAMVALUES(body);
|
||||
}
|
||||
|
||||
@Get('GetCountriesAndMessages')
|
||||
GET_COUNTRIES_AND_MESSAGES() {
|
||||
return this.GET_COUNTRIES_AND_MESSAGES();
|
||||
}
|
||||
|
||||
@Post('/CreateTableRecord')
|
||||
createTableRecord(@Body() body: CreateTableRecordDTO) {
|
||||
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) {
|
||||
|
||||
let connection;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user