我一直在从事课堂作业,由于某种原因,我无法解决的唯一问题是带有课程的程序...有人可以为我提供指导吗? 因此,我需要获取电子邮件的域并进行更新。示例:将boogers@us.now转换为boogers@gmail.com
规则需要一个游标::
class AperioSlidesAfterDate(object):
def go(self, session):
return session.query(Slide).join(Image) ...
# ^^^
答案 0 :(得分:0)
如果未找到实际查询,请尝试使用该通用块:
Declare
V_Old Varchar2(30);
V_New Varchar2(30);
name_wo_domain Varchar2(30);
cursor DomainCursor is select Email_Address from Broker;
v_domain Varchar2(30) :='gmail.com';
BEGIN
FOR i in DomainCursor
LOOP
select REGEXP_SUBSTR(i.Email_Address,'[^@]+',1,1)
into name_wo_domain
from dual;
DBMS_OUTPUT.PUT_LINE(i.Email_Address || ' , ' );
UPDATE Broker
SET Email_Address = name_wo_domain||'@'||v_domain
WHERE Email_Address = i.Email_Address;
END LOOP;
COMMIT;
END ;