| |

VerySource

 Forgot password?
 Register
Search
View: 1117|Reply: 5

A simple question!

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-3-24 11:00:02
| Show all posts |Read mode
Declare
hh dlyx.y_khda.hh% Type;
s Number: = 0;
Begin
For m In (Select * From tmhb070101 t)
Loop
Select Count (*)
Into s
From dlyx.y_khda@yjdlyx k Where
substr (k.yhh, 1, length (k.yhh) -3) = m.yhh And k.dw Like '0303%';
dbms_output.put_line (s);
If s = 1 Then
   Select k.hh
   Into hh
   From dlyx.y_khda@yjdlyx k Where
   substr (k.yhh, 1, length (k.yhh) -3) = m.yhh;
   dbms_output.put_line (hh);
   Update tmhb070101 tm
   Set tm.hh = hh
   Where tm.yhh = m.yhh;
End If;
End Loop;
Commit;
--Select * From tmhb070101;
End;
After I executed this procedure, why the field hh in the table tmhb070101 is still not updated.
Reply

Use magic Report

0

Threads

114

Posts

69.00

Credits

Newbie

Rank: 1

Credits
69.00

 China

Post time: 2020-7-7 18:00:01
| Show all posts
If the statement is correct, it is that the IF statement has always returned false and the following statement has not been executed.
Reply

Use magic Report

1

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-7-18 22:00:01
| Show all posts
You put Select Count(*) From dlyx.y_khda@yjdlyx k Where
substr(k.yhh,1,length(k.yhh)-3)=m.yhh And k.dw Like '0303%' execute it, you seem to be accessing a table in another database, what is m? ?
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-7-21 16:15:01
| Show all posts
Why didn't a kind person say it?
Reply

Use magic Report

0

Threads

6

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-7-22 13:15:03
| Show all posts
The landlord check whether s = 1 has a chance to be established.
Check step by step to find the reason.

@yjdlyx Is this dblink? Is accessing a remote database?
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-7-25 14:45:01
| Show all posts
The landlord check whether s = 1 has a chance to be established.
Check step by step to find the reason.
--Checked, there is a chance of establishment,
@yjdlyx Is this dblink? Is accessing a remote database?
--Yes
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list