Home > database >  How to found out the pl/SQL database table columns to add data? To solve! Be urgent!
How to found out the pl/SQL database table columns to add data? To solve! Be urgent!

Time:09-28

SELECT (SELECT t.t QMC FROM dw_tq t WHERE t.t QBS=b.t QBS) the first place, (SELECT y.m c FROM dw_yxbyq y WHERE y.t QBS=b.t QBS) of the
The FROM fw_kfgdxx a, fw_tsywfjxx b
WHERE a.k FGZDBS=b.k FGZDBS
AND a.k FGZDBH='123456789000000'

CodePudding user response:

The SELECT c.t QMC, d.m c
The FROM fw_kfgdxx a, fw_tsywfjxx b, dw_tq c, dw_yxbyq d
WHERE a.k FGZDBS=b.k FGZDBS
AND a.k FGZDBH='123456789000000'
And c.t QBS=b.t QBS
And which QBS=b.t QBS

CodePudding user response:

So you can probably as follows.. Directly with the update statement to update..
The update dw_tq
The set TQMC='you want to add content in the first place'
Where the exists (select 1
The from (select *
The from the from fw_kfgdxx a, fw_tsywfjxx b
WHERE a.k FGZDBS=b.k FGZDBS
C AND a.k FGZDBH='123456789000000')
WHERE c.t QBS=t.t QBS);
The update dw_yxbyq
Set the MC='what you want to add in the second place'
Where the exists (select 1
The from (select *
The from the from fw_kfgdxx a, fw_tsywfjxx b
WHERE a.k FGZDBS=b.k FGZDBS
C AND a.k FGZDBH='123456789000000')
WHERE c.t QBS=t.t QBS);

CodePudding user response:

refer to the second floor s1024783043 response:
so you can probably as follows.. Directly with the update statement to update..
The update dw_tq
The set TQMC='you want to add content in the first place'
Where the exists (select 1
The from (select *
The from the from fw_kfgdxx a, fw_tsywfjxx b
WHERE a.k FGZDBS=b.k FGZDBS
C AND a.k FGZDBH='123456789000000')
WHERE c.t QBS=t.t QBS);
The update dw_yxbyq
Set the MC='what you want to add in the second place'
Where the exists (select 1
The from (select *
The from the from fw_kfgdxx a, fw_tsywfjxx b
WHERE a.k FGZDBS=b.k FGZDBS
C AND a.k FGZDBH='123456789000000')
WHERE c.t QBS=t.t QBS);

This seems to be no, this table query of this column is null, if you want to add it, you see I send pictures, get rid of FOR UPDATE pictures I write, you see again, thank you!

CodePudding user response:

reference 1st floor Song Ge response:
SELECT c.t QMC, d.m c
The FROM fw_kfgdxx a, fw_tsywfjxx b, dw_tq c, dw_yxbyq d
WHERE a.k FGZDBS=b.k FGZDBS
AND a.k FGZDBH='123456789000000'
And c.t QBS=b.t QBS
And which QBS=b.t QBS

Thanks, but this is the query is null, the two is null, how I am going to add value to it, can you help me to solve?

CodePudding user response:

 
- write a process of judgment, choose insert or update;
The CREATE OR REPLACE procedure add_or_update (str1 VARCHAR2, str2 VARCHAR2, KFGZDBH VARCHAR2, as_log OUT VARCHAR2)
IS
Vv_str1 VARCHAR2 (20);
Vv_str2 VARCHAR2 (20);
The BEGIN
- get value
SELECT (SELECT t.t QMC FROM dw_tq t WHERE t.t QBS=b.t QBS), (c FROM the SELECT y.m dw_yxbyq y WHERE y.t QBS=b.t QBS)
INTO vv_str1, vv_str2
The FROM fw_kfgdxx a, fw_tsywfjxx b
WHERE a.k FGZDBS=b.k FGZDBS
AND a.k FGZDBH=KFGZDBH; - fw_kfgdxx: incoming 123456789000000
- determine
IF vv_str1 IS NULL OR trim (vv_str1)='THEN
INSERT INTO; - insert the corresponding value
The ELSE
The UPDATE; - update the value of the corresponding
END IF;
End p_check_end;
  • Related