I am not able to insert given in a table

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Wed, 30 Jan 2008 3:51 pm

Environmental information: * version of Oracle 10 g express edition: * operating system: XP Hello I'm having difficulty to insert data into a table, follow the table
Code: Select all
TABELA CLIENTES (
CODIGO NUMBER(10, 0) NOT NULL,
NOME VARCHAR2(50) NOT NULL,
DATA DATE NOT NULL,
STATUS NUMBER(1, 0) DEFAULT '1' NOT NULL,
CREDITO NUMBER(12, 2),
HISTORICO LONG,
TIPO VARCHAR2(30) DEFAULT 'J' NOT NULL,
the error that this me returning
Code: Select all
Error report:
SQL Error: ORA-01722: número inválido
01722. 00000 -  "invalid number"
and this and insert
Code: Select all
insert into CLIENTES (CODIGO,
             NOME,
             DATA,
             STATUS,
             HISTORICO,
             CREDITO,
             TIPO,
             CGC)
values
       (1,
       'EDUARDO',
       SYSDATE,
       1,
       1,
       'TESTE',
       'TESTE',
       'TESTE');
since it was already my thanks
eduardo.d2
Location: são paulo

Eduardo Andrade

Poston Wed, 30 Jan 2008 4:07 pm

Brother, the CGC is of type Number?
Trevisolli
Location: Araraquara - SP

Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Poston Wed, 30 Jan 2008 4:07 pm

Topic moved to the SQL .
Trevisolli
Location: Araraquara - SP

Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Poston Wed, 30 Jan 2008 4:43 pm

Code: Select all
CGC VARCHAR2(14) NOT NULL )
eduardo.d2
Location: são paulo

Eduardo Andrade

Poston Thu, 31 Jan 2008 8:33 am

Good morning, see the CREDIT field, he's number and you are trying to insert ' test ' on it. This is the error.


vlw
TBou
Location: Campo Grande - MS

Thiago Bourscheidt
thiago.info@apoiorural.com.br
Analista de Sistemas

Poston Thu, 31 Jan 2008 10:08 pm

Good night, now this giving another error
Code: Select all
Error at Command Line:1 Column:12
Error report:
SQL Error: ORA-00913: valores demais
00913. 00000 -  "too many values"
I did the modification in the table, increased the size of her more didn't help
Code: Select all
INSERT INTO CLIENTES(CODIGO,
                    NOME,
                    DATA,
                    STATUS,
                    CREDITO,
                    HISTORICO,
                    TIPO,
                    CGC)
            VALUES(01,
                   'EDUARDO',
                   SYSDATE,
                   1,
                   100,
                   'TESTE',
                   'TESTE',
                   'T',
                   'TESTE')
eduardo.d2
Location: são paulo

Eduardo Andrade

Poston Fri, 01 Feb 2008 8:34 am

You're going through a little bit of extra!!

You indicated 8 fields to receive values ... but you're passing 9 values within the \"VALUES\"!!!!

Code: Select all
INSERT INTO CLIENTES(CODIGO, -- campo 1
                    NOME, -- campo 2
                    DATA, -- campo 3
                    STATUS, -- campo 4
                    CREDITO, -- campo 5
                    HISTORICO, -- campo 6
                    TIPO, -- campo 7
                    CGC) -- campo 8
            VALUES(01, -- campo 1
                   'EDUARDO', -- campo 2
                   SYSDATE, -- campo 3
                   1, -- campo 4
                   100, -- campo 5
                   'TESTE', -- campo 6
                   'TESTE', -- campo 7
                   'T', -- campo 8
                   'TESTE'); -- campo 9
falou!!
Renan Orati
Location: São José do Rio Preto - SP

Poston Thu, 28 Feb 2008 12:02 pm

Dear colleague, as a test, I would take the field seven you're there on your insert. Change the contents of the last field so that really is a CGC. See so my choice: how are you:
Code: Select all
INSERT INTO CLIENTES(CODIGO, -- campo 1
                    NOME, -- campo 2
                    DATA, -- campo 3
                    STATUS, -- campo 4
                    CREDITO, -- campo 5
                    HISTORICO, -- campo 6
                    TIPO, -- campo 7
                    CGC) -- campo 8
            VALUES(01, -- campo 1
                   'EDUARDO', -- campo 2
                   SYSDATE, -- campo 3
                   1, -- campo 4
                   100, -- campo 5
                   'TESTE', -- campo 6
                   'TESTE', -- campo 7
                   'T', -- campo 8
                   'TESTE'); -- campo 9
As would be correcting the errors:
Code: Select all

INSERT INTO CLIENTES(CODIGO, -- campo 1
                    NOME, -- campo 2
                    DATA, -- campo 3
                    STATUS, -- campo 4
                    CREDITO, -- campo 5
                    HISTORICO, -- campo 6
                    TIPO, -- campo 7
                    CGC) -- campo 8
            VALUES(01, -- campo 1
                   'EDUARDO', -- campo 2
                   SYSDATE, -- campo 3
                   1, -- campo 4
                   100, -- campo 5
                   'TESTE', -- campo 6
                   'T', -- campo 7
                   '17187482000127'); -- campo 8


Hope that helps you!

Edson
edson.amorim
Location: Belo Horizonte - MG


  • See also
    Replies
    Views
    Last Post


      Return to SQL

      Who is online

      Users browsing this forum: No registered users and 3 guests