Elke wrote :
-----Mensagem original-----
De: Zabach, Elke [mailto:[EMAIL PROTECTED]]
Enviada em: sexta-feira, 21 de fevereiro de 2003 12:26
Para: 'Alejandro Michelin Salomon'; Sapdb General List
Assunto: RE: How to query a Column Default Serial
Alejandro Michelin Salomon wrote:
> I am working width Sapdb 7_3_0_29 for win32, my operating
> system is Windows
> 2000 Pro width Sp3.
>
> I create a table usuarios :
>
> CREATE TABLE "RELUXCAR"."USUARIOS"
> (
> "IDUSER" Fixed (10,0) DEFAULT SERIAL (1),
> "USUARIO" Varchar (30) ASCII,
> "PASSW" Varchar (20) ASCII,
> "NOME" Varchar (50) ASCII,
> "NIVEL" Fixed (4,0),
> "COLOR" Varchar (25) ASCII,
> "IMAGEM" Varchar (255) ASCII,
> "INICIALES" Varchar (4) ASCII,
> "EMAIL" Varchar (50) ASCII,
> "ANIVERSARIO" Date,
> PRIMARY KEY ("IDUSER", "")
> )
>>>You succeeded with this PRIMARY KEY-clause ???
>>>with an empty second column-name ??
>>>I do not believe this. What did you do instead?
I drop the table an recreate it with this primary key sintax :
PRIMARY KEY ("IDUSER").
> I insert a record in the table without problems.
>
> I try to execute this query :
>
> Select IdUser, Usuario, Passw, Nome, Nivel From usuarios
> where Usuario = 'amichelin'
> and PassW = 'peter'
>
> Buts, query returns no value for IdUser field ( Serial column ).
>>>What do you mean with ' query returns no value for IdUser field'?
>>>Is an error given ? Which one?
>>>Is the NULL-value returned or 0 or what happened?
I not sure, if is null, i am working with odbc and php.
Buts the Sap Sql Studio when i execute the query "select * from usuarios "
return the value for
the IdUser column ( Value is 1 ), php odbc_exec not return de value thas sql
studio return.
>>>What did you insert into IdUser, NULL, 0, or didn't you
>>>specifiy IdUser in the insert statament ?
I not insert value, this is a serial column.
My insert is :
INSERT INTO usuarios ( USUARIO, PASSW, NOME, NIVEL, COLOR, IMAGEM, EMAIL )
VALUES (
'amichelin','peter','Alejandro',2,'Navy','amichelin.gif','[EMAIL PROTECTED]
.uy').
Why is wrong ?
Alejandro Michelin Salomon
PROBrax e-Tech
>>>Elke
>>>SAP Labs Berlin
>
> How i get this value ?
>
> Can you help me please.
>
> Thanks
>
> Alejandro Michelin Salomon
> PROBrax e-Tech
>
>
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general