Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test for working
Message
 
À
26/01/2006 15:49:10
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01090344
Message ID:
01090680
Vues:
7
Thanks - this stuff will help - but it seems you're saying - if it the statement is good - then the only way we would know would be if an actual record were inserted into a table.

>>>What do you mean damage?
>>Thanks
>>
>>An insert or update implies stuff is to be written to a SQL table. The "wizard" has an interface wher the user can enter a SQL statement. If the SQL statement calls an SP or issues an INSERT from the client, there is data in the parameters that is written to the tables. I just want to assure that the statement is syntactically correct (fieldnames - statement structure) without actually writing to the table - and - without actually passing real data and inserting a record into the table.
>>
>>On the winzard for each statement is a "Test" button the user can click once the statement is in. If the SQL is an INSERT, I would like to assure the user that the statement is syntactically correct (when they press "Test") without actually writting anything to the table.
>
>If it's not syntactically correct (and semantically to an extent, i.e. has misspelled field names), sqlexec() won't do a thing and will return a -1 anyway.
>
>>With SELECT statements I can test without having to "gather" data - I can make select return a zero record cursor. I am looking for a "zero" action insert!
>
>I thought SqlPrepare() would actually compile and return some status, but it returns 1 for any gibberish you pass to it... but then, I got another bright idea: if your user clicks the TEST button, why don't you really send the command to the server, just wrapped into a begin transaction / rollback? No harm done that way, and you actually do get some status back.
Imagination is more important than knowledge
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform