0

我想知道是否有办法从报告的列(从特定行)中获取值并将其用作 PL/SQL 语句的变量:

DECLARE 
    CURSOR cur_PersonnelAutoComplete IS
    SELECT TASKS.ID AS TASK_ID, PERSONNEL.ID AS PERS_ID, JOBTYPES.JOB_HOURS AS PERS_WK, 
    PERSONNEL.DAILY_WAGE AS PERS_DW, PERSONNEL.STAMP AS PERS_STAMP 
    FROM DAILYWORKS JOIN PERSONNEL ON DAILYWORKS.WORKER_ID=PERSONNEL.ID 
    JOIN JOBTYPES ON PERSONNEL.JOB_TYPE=JOBTYPES.ID
    JOIN TASKS ON DAILYWORKS.WORK_ID = TASKS.ID
    WHERE TASKS.ID =:ID --(ID is a column from my report that i want to use -from this row-)
    AND PERSONNEL.ID = WORKER_ID; --(WORKER_ID is also a column from my report that i want to use -from this row-)
    
    var_emp cur_PersonnelAutoComplete%ROWTYPE;

BEGIN
    OPEN cur_PersonnelAutoComplete;
    LOOP
        FETCH cur_PersonnelAutoComplete INTO var_emp;
        EXIT WHEN cur_PersonnelAutoComplete%NOTFOUND;
        UPDATE DAILYWORKS SET DAILY_WAGE = var_emp.PERS_DW, TEMP_EMP_TYPE = var_emp.PERS_WK,
        STAMP = var_emp.PERS_STAMP
        WHERE WORKER_ID = var_emp.PERS_ID AND WORK_ID =var_emp.TASK_ID;
    END LOOP;
    CLOSE cur_PersonnelAutoComplete;
END;```
If i run this nothing happens, but if i run the same code with page items, works perfectly!
4

1 回答 1

1

是的,这是可能的。您提供的关于您想用它做什么的信息非常少,所以这里有一些选项

  • 您可以将其作为指向另一个页面(或具有特定请求的同一页面)的链接,然后在页面进程中执行该代码。将列定义为“链接”类型,然后将目标页面上的页面项设置为链接构建器中的列值。
  • 您还可以使用特定列值作为其参数之一来触发动态操作。设置它有很多步骤,但您可以在“示例动态操作”应用程序中找到一个完整的示例。查看“复杂 - 删除和刷新”示例。正是这样做的。
于 2020-06-22T12:48:48.893 回答