我创建了一个触发器,它会自动将第一列值设置为后续的阶乘数.但是,另外,如果插入空值,我想将第二列的值设置为第一列的值增加5.这是我现在尝试的:
create or replace trigger test_tr
before insert on myT
for each row
begin
IF :new.mNumb is null
THEN
UPDATE myT
SET mNumb = :new.tab_id + 5;
END IF;
SELECT fac(test_seq.NEXTVAL)
INTO :new.tab_id
FROM dual;
end;
Run Code Online (Sandbox Code Playgroud)
但显然我错过了一些东西,因为没有任何反应,插入的null仍然是空的.
我有一个Java服务器应用程序,它包含一个Student对象列表(实现Serializable).客户端应用程序发送带有整数的消息 - 要获取的Student对象索引.然后将选定的Student发送给客户端,客户端修改其值并发回.然而,应用程序在某些时候会冻结,这可能是我在下面的代码中强调的行的问题.
服务器:
public class Server {
public static void main(String[] arg) {
ArrayList <Student> studentList = new ArrayList <Student> ();
studentList.add(new Student(170435, "justyna", "kaluzka", new ArrayList <Float>()));
studentList.add(new Student(170438, "michal", "szydlowski", new ArrayList <Float>()));
studentList.add(new Student(170436, "marek", "polewczyk", new ArrayList <Float>()));
studentList.add(new Student(170439, "jakub", "szydlowski", new ArrayList <Float>()));
studentList.add(new Student(170430, "anna", "majchrzak", new ArrayList <Float>()));
studentList.add(new Student(170425, "krzysztof", "krawczyk", new ArrayList <Float>()));
studentList.add(new Student(170445, "adam", "szydlowski", new ArrayList <Float>()));
studentList.add(new Student(170415, "karol", "chodkiewicz", new ArrayList <Float>()));
studentList.add(new Student(170465, …Run Code Online (Sandbox Code Playgroud) 我想获得select语句返回的列的最小值:
select lead(place) over (order by place) - place as gap
from viewers
Run Code Online (Sandbox Code Playgroud)
我想用where子句来做,但显然我不能在条件中引用我的'gap'列.