Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Iniciando no SLQ Server 2000 ...
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Iniciando no SLQ Server 2000 ...
Miscellaneous
Thread ID:
00778142
Message ID:
00778142
Views:
51
Estou fazendo estudos com o Sql Server... e estou tendo alguns erros na hora de inserir dados


Fui no SQL Server e para fins de estudo criei uma tabela com alguns campos :

id_cliente Int ( Primary Key )
NOME Char 50
ENDERECO Char 20
BAIRRO Char 20
ddd Char 2
telefone Char 8
cidade Char 20
uf Char 2
data_cad DateTime 8
ts TimeStamp 8
credito Float 8

nHand = SQLCONNECT("conecao_teste","pauloc","senha")
lcString = "INSERT INTO cliente (id_cliente,CREDITO,NOME) VALUES (101,12000,[TESTE])"
lnResult = SQLEXEC(nHand,lcString)
&& lnResul retorna -1
&& executando AERROR(laErro)
&& laErro(1,3) retorna a seguinte string :
"[Microsoft][ODBC SQL Server Driver][SQL Server]The name 'Teste' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted."

Mas se eu retirio o campo "Nome" e executo a seguinte string funciona :

nHand = SQLCONNECT("conecao_teste","pauloc","senha")
lcString = "INSERT INTO cliente (id_cliente,CREDITO) VALUES (101,12000)"
lnResult = SQLEXEC(nHand,lcString)

O que eu estou fazendo de errado ?
Paulo Cesar Carneiro
desenvolvimento@controplan.com.br


"My God, what have we done?"
-- Capt. Robert Lewis, co-pilot of the Enola Gay, recalling the moment the atomic bomb exploded over Hiroshima

At 8:15 a.m. on August 6 1945
Next
Reply
Map
View

Click here to load this message in the networking platform