0

Im trying to 'translate' a month table, with pl_sql 6.0 program.

I would like to run all these instructions below at once, in a very simple code, like 'select the instructions and hit F8', all at once.

Problem is:

without ";" between each instruction, i get: ORA-00933 command not properly ended with ";" between each instruction, im getting: ORA-00911 invalid character im new on oracle database, so...what i am not seeing? Thanks in advance.

update TIME_TABLE t set t.m_description='JANEIRO' where t.m_description like '%JANUARY%'
update TIME_TABLE t set t.m_description='FEVEREIRO' where t.m_description like '%FEBRUARY%'
update TIME_TABLE t set t.m_description='MARÇO' where  t.m_description like '%MARCH%'
update TIME_TABLE t set t.m_description='ABRIL' where t.m_description like '%APRIL%'
... and so on

2 Answers 2

1

Update using CASE statement.

update TIME_TABLE t 
set t.m_description = (
    case when t.m_description like '%JANUARY%' then 'JANEIRO' 
        when t.m_description like '%FEBRUARY%' then 'FEVEREIRO'
        when t.m_description like '%MARCH%' then 'MARÇO'
        when t.m_description like '%APRIL%' then 'ABRIL'
    else t.m_description
    end
)
Sign up to request clarification or add additional context in comments.

Comments

0

Just put these instruction within BEGIN ... END, like this:

BEGIN
   update TIME_TABLE t set t.m_description='JANEIRO' where t.m_description like '%JANUARY%'
   update TIME_TABLE t set t.m_description='FEVEREIRO' where t.m_description like '%FEBRUARY%'
   update TIME_TABLE t set t.m_description='MARÇO' where  t.m_description like '%MARCH%'
   update TIME_TABLE t set t.m_description='ABRIL' where t.m_description like '%APRIL%'
   ... and so on
END;
/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.