vendredi 22 mai 2020

insert culomn data to table if it is the checkbox in front of it is checked

I'm building a customer form. I have 3 tables related to the customers form which is

  1. customers.
  2. curr.
  3. customer_curr.
CREATE TABLE CUSTOMERS
(
  C_NO      NUMBER                              NOT NULL, --primary key
  C_A_NAME  VARCHAR2(255 CHAR)                  NOT NULL,
  C_E_NAME  VARCHAR2(255 CHAR),
  C_PHONE   NUMBER,
  C_EMAIL   VARCHAR2(255 CHAR)
);
------
CREATE TABLE CURR
(
  CURR_NO      NUMBER                           NOT NULL,
  CURR_A_NAME  VARCHAR2(255 CHAR),
  CURR_E_NAME  VARCHAR2(255 CHAR),
  CURR_SYMBOL  VARCHAR2(255 CHAR)               NOT NULL, --primary key
  CURR_F       NUMBER                           DEFAULT 2,
  CURR_RATE    NUMBER                           NOT NULL
);
------
CREATE TABLE CUSTOMER_CURR
(
  C_NO         NUMBER,
  CURR_SYMBOL  VARCHAR2(3 CHAR)  --both columns are primary key
)

now in that form when I press the add button then all data in curr table executed. and this is work as well and I added checkbox in curr block, I want the user check the checkbox when he add or edit the customer. the data should be save in customers table and customer_curr.

see the picture to understand what I mean... because I can't make a good question for this problem.

see this picture

the data that will be save in tables from that picture like this..

customers table

c_no: 3, c_a_name: NAME, c_e_name: null, phone: 55555, email_no: null

customer_curr table

c_no: 3, curr_symbol: USD -- which I check the checkbox that in front of it.

so now when you understand what I need... How to insert rows to customer_curr that I checked the checkbox only?




Aucun commentaire:

Enregistrer un commentaire