There is already a table More need to enter another command as

Scripts Diversos para o Oracle SQL*Plus. (Relacionado a ferramenta Oracle SQL*Plus, para questões de SQL, usar o forum SQL)
Post Reply
rfidelis
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 39
Joined: Thu, 28 Apr 2011 11:21 am
Location: Maringá

Salve Salve Sympathy,
I am with a simple proble but I do not remember how to do
I made the following table

Select all

 Name                            Null?    Type 
 ------------------------------- -------- ---- 
 COD_EMPRESA                     NOT NULL NUMBER(3) 
 COD_FILIAL                      NOT NULL NUMBER(3) 
 NUM_ORDEM_FABRICACAO            NOT NULL NUMBER(6) 
 SEQ_ITEM                        NOT NULL NUMBER(3) 
 SEQ_PROCESSO                    NOT NULL NUMBER(2) 
 COD_PROCESSO                    NOT NULL NUMBER(2) 
 DAT_PRODUCAO                    NOT NULL DATE 
 COD_EMPRESA_SETOR               NOT NULL NUMBER(3) 
 COD_FILIAL_SETOR                NOT NULL NUMBER(3) 
 COD_DEPARTAMENTO                NOT NULL NUMBER(3) 
 COD_SETOR                       NOT NULL NUMBER(3) 
 QTD_PRODUZIDA                   NOT NULL NUMBER(14,4) 
 QTD_REFUGO                      NOT NULL NUMBER(14,4) 
 NOM_USUARIO_INCLUSAO            NOT NULL VARCHAR2(30) 
 DAT_USUARIO_INCLUSAO            NOT NULL DATE 
 OBS_REFUGO                               VARCHAR2(80) 
 NOM_USUARIO_ALTERACAO                    VARCHAR2(30) 
 DAT_USUARIO_ALTERACAO                    DATE
I need to insert something like

Select all

Desc_list                                    NOT NULL VARCHAR (20)

if someone conseveres me,
Thank you very much, if not,
Thanks for trying .
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Select all

 
ALTER TABLE nomeTabela ADD nomeCampo tipoCampo; 
rfidelis
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 39
Joined: Thu, 28 Apr 2011 11:21 am
Location: Maringá

This danao the following error:

Select all

ORA-00942: table or view does not exist
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

You may be logged in with a user different from the table ..

Which instruction are you using?
Which user logged in?
Which schema does the table belong to?
rfidelis
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 39
Joined: Thu, 28 Apr 2011 11:21 am
Location: Maringá

I am logged in on my coder
plus the pricipal base is .usicmap
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

My Coder '' Main Base '?????? I did not understand anything

Select all

ORA-00942: table or view does not exist
What did you type that generated error ???
rfidelis
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 39
Joined: Thu, 28 Apr 2011 11:21 am
Location: Maringá

I typed the command

Select all

alter table ind_item_ordem_fab_processo add lis_destino varchar2(20) not null;
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Select all

 
CREATE SYNONYM ind_item_ordem_fab_processo FOR usuario_que_você_ta_logado; 
there your alter table will work ..

...

You can discover The owner of the table and place before the table name:
owner.tabela

Select all

 
alter table USER_DONO_TAABELA.ind_item_ordem_fab_processo add lis_destino varchar2(20) not null; 
rfidelis
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 39
Joined: Thu, 28 Apr 2011 11:21 am
Location: Maringá

Putz Victor I ended up copying the same thing you put the first command now you have taken the old table
hahahhhaaha
rfidelis
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 39
Joined: Thu, 28 Apr 2011 11:21 am
Location: Maringá

The following error appears:

Select all

ORA-04043: object RAFAEL.USUARIO_QUE_você_TA_LOGADO does not exist
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

face ..

these stops you have to replace ..

usual_que_você_ta_logada I really do not expect it to exist .. =)

]

Where Rafael is your user that you will rotate your alter table ..

Select all

 
alter table ind_item_ordem_fab_processo add lis_destino varchar2(20) not null;  
rfidelis
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 39
Joined: Thu, 28 Apr 2011 11:21 am
Location: Maringá

entaw I was going to change more he rolled direct did not give
now I try to rotate with my user and the error:

Select all

CREATE SYNONYM ind_item_ordem_fab_processo FOR RAFAEL 
               * 
ERROR at line 1: 
ORA-00955: name is already used by an existing object


]] How can you cancel the passed operation or will I have to make a new table?

Thank you for helping Hem Victor.
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

and now the alter table does not work ???





I think you have to try to first make your alter table ..
can not drop your synonym

Select all

 
DROP SYNONYM ind_item_ordem_fab_processo ; 
rfidelis
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 39
Joined: Thu, 28 Apr 2011 11:21 am
Location: Maringá

it gave certo with relation to the drop
more to alter table is not working now is with a mistake saying that already this table already exists

Select all

ORA-00942: table or view does not exist
rfidelis
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 39
Joined: Thu, 28 Apr 2011 11:21 am
Location: Maringá

now appeared
Thank you Victor
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests