Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | 1x 1x 2x 2x 2x 2x 2x 2x 1x 1x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 2x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 2x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // cl_sql_statement.clas.abap class cl_sql_statement { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CL_SQL_STATEMENT'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"MV_CONNECTION": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"CONSTRUCTOR": {"visibility": "U", "parameters": {"CON_REF": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_SQL_CONNECTION", RTTIName: "\\CLASS=CL_SQL_CONNECTION"});}, "is_optional": " "}}}, "EXECUTE_UPDATE": {"visibility": "U", "parameters": {"STATEMENT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "EXECUTE_QUERY": {"visibility": "U", "parameters": {"RESULT_SET": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_SQL_RESULT_SET", RTTIName: "\\CLASS=CL_SQL_RESULT_SET"});}, "is_optional": " "}, "STATEMENT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "EXECUTE_DDL": {"visibility": "U", "parameters": {"STATEMENT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}}; #mv_connection; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "execute_update": this.execute_update.bind(this), "execute_query": this.execute_query.bind(this), "execute_ddl": this.execute_ddl.bind(this), }; this.#mv_connection = new abap.types.String({qualifiedName: "STRING"}); this.FRIENDS_ACCESS_INSTANCE["mv_connection"] = this.#mv_connection; } async constructor_(INPUT) { let con_ref = new abap.types.ABAPObject({qualifiedName: "CL_SQL_CONNECTION", RTTIName: "\\CLASS=CL_SQL_CONNECTION"}); if (INPUT && INPUT.con_ref) {con_ref.set(INPUT.con_ref);} if (abap.compare.initial(con_ref)) { this.#mv_connection.set(abap.CharacterFactory.get(7, 'DEFAULT')); } else { this.#mv_connection.set((await con_ref.get().get_con_name())); } abap.statements.assert(abap.compare.initial(this.#mv_connection) === false); return this; } async execute_ddl(INPUT) { let statement = INPUT?.statement; if (statement?.getQualifiedName === undefined || statement.getQualifiedName() !== "STRING") { statement = undefined; } if (statement === undefined) { statement = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.statement); } abap.statements.assert(abap.compare.eq(abap.IntegerFactory.get(1), abap.CharacterFactory.get(13, 'not supported'))); } async execute_update(INPUT) { let statement = INPUT?.statement; if (statement?.getQualifiedName === undefined || statement.getQualifiedName() !== "STRING") { statement = undefined; } if (statement === undefined) { statement = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.statement); } let lv_sql_message = new abap.types.String({qualifiedName: "STRING"}); let connection = new abap.types.String({qualifiedName: "STRING"}); abap.statements.assert(abap.compare.initial(statement) === false); connection.set(this.#mv_connection); if (abap.context.databaseConnections[connection.get()] === undefined) { lv_sql_message.set(abap.CharacterFactory.get(19, 'not connected to db')); } if (abap.compare.initial(lv_sql_message) === false) { const unique1117 = await (new abap.Classes['CX_SQL_EXCEPTION']()).constructor_(); unique1117.EXTRA_CX = {"INTERNAL_FILENAME": "cl_sql_statement.clas.abap","INTERNAL_LINE": 59}; throw unique1117; } try { await abap.context.databaseConnections[connection.get()].execute(statement.get()); } catch(e) { lv_sql_message.set(e + ""); } if (abap.compare.initial(lv_sql_message) === false) { const unique1118 = await (new abap.Classes['CX_SQL_EXCEPTION']()).constructor_(); unique1118.EXTRA_CX = {"INTERNAL_FILENAME": "cl_sql_statement.clas.abap","INTERNAL_LINE": 68}; throw unique1118; } } async execute_query(INPUT) { let result_set = new abap.types.ABAPObject({qualifiedName: "CL_SQL_RESULT_SET", RTTIName: "\\CLASS=CL_SQL_RESULT_SET"}); let statement = INPUT?.statement; if (statement?.getQualifiedName === undefined || statement.getQualifiedName() !== "STRING") { statement = undefined; } if (statement === undefined) { statement = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.statement); } let lx_osql = new abap.types.ABAPObject({qualifiedName: "CX_SY_DYNAMIC_OSQL_SEMANTICS", RTTIName: "\\CLASS=CX_SY_DYNAMIC_OSQL_SEMANTICS"}); let lv_sql_message = new abap.types.String({qualifiedName: "STRING"}); let connection = new abap.types.String({qualifiedName: "STRING"}); connection.set(this.#mv_connection); abap.statements.assert(abap.compare.initial(statement) === false); abap.statements.assert(abap.compare.initial(this.#mv_connection) === false); if (abap.context.databaseConnections[connection.get()] === undefined) { lv_sql_message.set(abap.CharacterFactory.get(19, 'not connected to db')); } if (abap.compare.initial(lv_sql_message) === false) { const unique1119 = await (new abap.Classes['CX_SQL_EXCEPTION']()).constructor_({sql_message: lv_sql_message}); unique1119.EXTRA_CX = {"INTERNAL_FILENAME": "cl_sql_statement.clas.abap","INTERNAL_LINE": 88}; throw unique1119; } result_set.set(await (new abap.Classes['CL_SQL_RESULT_SET']()).constructor_()); try { const res = await abap.context.databaseConnections[connection.get()].select({select: statement.get()}); result_set.get().mv_magic = res.rows; } catch (e) { if ((abap.Classes['CX_SY_DYNAMIC_OSQL_SEMANTICS'] && e instanceof abap.Classes['CX_SY_DYNAMIC_OSQL_SEMANTICS'])) { lx_osql.set(e); const unique1120 = await (new abap.Classes['CX_SQL_EXCEPTION']()).constructor_({sql_message: lx_osql.get().sqlmsg}); unique1120.EXTRA_CX = {"INTERNAL_FILENAME": "cl_sql_statement.clas.abap","INTERNAL_LINE": 98}; throw unique1120; } else { throw e; } } return result_set; } } abap.Classes['CL_SQL_STATEMENT'] = cl_sql_statement; export {cl_sql_statement}; |