在Oracle APEX中,将按钮添加到一个数据库表列的方法如下:

huangapple go评论73阅读模式
英文:

Adding Buttons referenced to a database table column in oracle apex

问题

我正在使用Oracle APEX构建一个餐厅应用程序。我需要构建一个类似下面显示的图像的界面:
界面类似于这样
我需要将这些按钮与我的数据库中的项目表关联起来,当用户点击按钮时,项目应该出现在账单预览表中,并显示价格以便打印。

这是否可能实现?如果可以,如何操作?

英文:

I am building a Application for a Resturent using Oracle APEX. I need to build a Interface like the image shown below
the interface is something like this
I need to link those buttons to the items table in my database, when user click on the button the item should go to the bill preview table with the price so it can be printed.

Is this possible to do? If so how?

答案1

得分: 0

  • 创建一个按钮(例如,P1_BTN_SPRITE),在按下时提交页面。

  • 创建一个在按下P1_BTN_SPRITE按钮时触发的流程。

  • 流程随后应该执行以下操作:

    向账单表(bill)插入数据(bill_id,item_id,price)
    选择 :P1_BILL_ID,
    i.item_id,
    i.price
    从项目表(items i)中
    其中 i.item_id = 1234; --> 假设1234是表示“Sprite”的ID。

  • P1_BILL_ID的值从哪里来?这可能是在页面加载时生成的序列值(当创建账单时)。

  • 由于提交,页面将刷新,“账单预览”区域也应该刷新并显示新的账单内容。

英文:
  • create a button (for example, P1_BTN_SPRITE) which submits page when pressed

  • create process that fires when P1_BTN_SPRITE button is pressed

  • process would then

    insert into bill (bill_id, item_id, price)
    select :P1_BILL_ID,
      i.item_id,
      i.price
    from items i
    where i.item_id = 1234;   --> presuming that 1234 is ID that means "Sprite"
    
    • where does P1_BILL_ID value come from? That's what you probably know; might be a sequence-generated value upon page load (when bill is created)
  • because of submit, page would refresh and "Bill preview" regions should also refresh and show new bill contents

huangapple
  • 本文由 发表于 2023年3月4日 02:36:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/75630719.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定