Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SPT Syntax Issue
Message
 
 
À
06/07/2010 12:39:30
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01471541
Message ID:
01471545
Vues:
38
>I am trying to use the following SPT but I get a message the token 12 is not valid. This seems to be refering to the 12:00:00 AM in the date field. This is being passed to a db2 file.
>
>
>
>insertSImain = "Insert Into webprddt7.qasimast(recseq, insptype, docno, partno," +;
>			" shipsetid, dwgrev, vendorcode, faiindex, lotqty, sampletype, sampleqty, accptdqty," +;
>			" rejdqty, inspdate, inspector, inspsource, rejtindex)" +;
>			" Values(" + ALLTRIM(STR(x)) +;
>			",1,'" + ALLTRIM(testconnQuery.docno) +;
>			"','" + ALLTRIM(testconnQuery.partno) +;
>			"','" + ALLTRIM(testconnQuery.jobno) +;
>			"','" + ALLTRIM(testconnQuery.revision) +;
>			"','" + ALLTRIM(testconnQuery.vendorcode) +;
>			"'," + ALLTRIM(STR(testconnQuery.faiindex)) +;
>			"," + ALLTRIM(STR(testconnQuery.lotsize)) +;
>			"," + ALLTRIM(STR(testconnQuery.sampletype)) +;
>			"," + ALLTRIM(STR(testconnQuery.cmss)) +;
>			"," + ALLTRIM(STR(testconnQuery.cmaa)) +;
>			"," + ALLTRIM(STR(testconnQuery.cmar)) +;
>			"," + TTOC(testconnQuery.inspectdt) +;
>			",'" + ALLTRIM(testconnQuery.inspectsna) +;
>			"',1," + ALLTRIM(STR(y)) + ")"
>			
>			? insertSImain
>			
>			If SQLEXEC(testconn, insertSImain) <> -1 Then
>				=SQLCOMMIT(testconn)
>			ELSE
>				If Aerror(odbcerrormsg) > 0 Then
>					MessageBox(odbcerrormsg(2))
>				EndIf
>			EndIF
>
>
>
In SQL Server date and time fields need to be enclosed in single quote.

Why you're not using parameters? With parameters it'll be much simpler and you avoid the errors like this.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform