Oracle APEX - 设置具有默认值的表格

发布于 2024-08-14 04:49:12 字数 492 浏览 1 评论 0原文

我对 APEX 还很陌生,在使用我的第一个表格表单时遇到了一些麻烦。我将其链接到的表相当简单。各列如下:

  • 代表内部的主键 大学专业代码
  • 代表“真实”的外键 大学专业代码
  • 大学专业描述
  • 插入/更新的用户 表中的行
  • 插入/更新行的日期

目前,我面临两个问题。

  1. 我希望用户能够为行指定自己的主键,但不能更改任何现有的主键。当我将列类型指定为“文本字段”时,用户可以编辑现有行的主键,并且在尝试添加新行时似乎也会破坏报告,因为我收到校验和错误。
  2. 我想要用户和日期 默认为当前的列 登录用户和当前日期, 但指定默认值 这些列中的任何一个似乎也 导致语法/SQL 错误。做 任何人都有如何的例子 使用默认值功能 对于一列? 已修复。当指定默认的 PL/SQL 类型时,我可以使用 SYSDATE 作为它自己的值。用户名可以通过APEX_UTIL中的函数获取

I pretty new to APEX and I'm having a bit of trouble working with my first Tabular form. The table I've linked it to is fairly simple. The columns are as follows:

  • Primary key representing an internal
    code for a college major
  • Foreign key representing the "real"
    code for the college major
  • Description for the college major
  • The user that inserted/updated the
    row in the table
  • The date the row was inserted/updated

At the moment, I'm facing two problems.

  1. I want the user to be able to specify their own primary key for the row but not to be able to change any existing primary keys. When I specify the column type as "Text Field" users are able to edit existing rows' primary keys and it also seems to break the report when trying to add a new row as I get a checksum error.
  2. I would like the user and date
    columns to default to the currently
    logged in user and the current date,
    but specifying default values for
    either of these columns also seems
    to cause syntax/SQL errors. Does
    anyone have any examples of how to
    use the default value functionality
    for a column?
    Fixed. I can just use SYSDATE as a value on it's own when specifying the PL/SQL type for default. Username can be obtained through functions in APEX_UTIL

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一腔孤↑勇 2024-08-21 04:49:12

也许您可以使用 2 个条件字段。如果字段值为空,则显示编辑框,如果字段值不为空,则显示仅显示字段。

Perhaps you could use 2 conditional fields. If the field value is null, display the edit box, if the field value is not null display the display-only field.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文