Skip to content

Commit

Permalink
CP
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp committed Mar 29, 2024
1 parent f7d3b39 commit fc74687
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/runtime/src/expand_in.ts
Expand Up @@ -15,6 +15,8 @@ export function expandIN(fieldName: string, table: Table) {
for (const row of table.array()) {
if (row.get().sign?.get() === "I" && row.get().option?.get() === "EQ") {
values.push(`"${fieldName}" = '` + row.get().low?.get().replace(/'/g, "''") + "'");
} else if (row.get().sign?.get() === "I" && row.get().option?.get() === "CP") {
values.push(`"${fieldName}" LIKE '` + row.get().low?.get().trimEnd().replace(/'/g, "''").replace(/\*/g, "%") + "'");
} else {
throw new Error(`IN, ${row.get().sign?.get()} ${row.get().option?.get()} not supported`);
}
Expand Down
2 changes: 1 addition & 1 deletion test/database.ts
Expand Up @@ -549,7 +549,7 @@ ASSERT sy-subrc = 0.`;
});
});

it.only("SELECT, IN CP", async () => {
it("SELECT, IN CP", async () => {
const code = `
TYPES ty_range TYPE RANGE OF t100-arbgb.
DATA lt_t100 TYPE STANDARD TABLE OF t100 WITH DEFAULT KEY.
Expand Down

0 comments on commit fc74687

Please sign in to comment.