Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass a FALSE to a SQL Server stored procedure
Message
De
09/03/1998 09:43:52
Claudio Abad
Compañía Financiera Argentina
Buenos Aires, Argentine
 
 
À
09/03/1998 08:16:49
Steve Camsell
Windmill Associates
Bath, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00082731
Message ID:
00083365
Vues:
30
Hi Steve, I found your problem, the semicolon followed by a 4 number
it's your problem, from Isql a semicolon it's a ordinary character,
to ODBC a semicolon it's a Sql Separator,
for example: Select * from Clients ; Select * from Sales
, this instructions send in a single Sqlexec returns two cursor,
to recognize thats instructions, ODBC find on string a semicolon.
If you delete a semicolon, I supose that problem dissapears.

Bye
Tell me if I wrong or right, please
Excuse me English

Claudio



>>Send me Stored Procedure Code, may be I can help you, and error number returned to VFP
>
>Claudio,
>
>Thanks for taking the time to help me with this. Here is the text of my stored procedure in SQL Server.
>
>CREATE PROCEDURE sp_NewCustomer;4 (@bCorpIndiv bit) as
>INSERT INTO customer
>(bCorp_Indiv)
>VALUES
>(@bCorpIndiv)
>
>DECLARE @nNewId INT
>SELECT @nNewId = @@IDENTITY
>
>INSERT INTO psnldets
>(iCust_id)
>VALUES
>(@nNewId)
>
>SELECT iCust_id
>FROM customer
>WHERE iCust_id = @nNewId
>
>Running this sp from SQL Server works perfectly, returns the Cust_id of my new customer, and when I check out the data, both of the records that it shoudl create are there. It is only when I run it from Fox that I get a problem. It doesn't seem to matter what syntax I use in my SQLEXEC(), I still get the same errors. This is an example of one call:
>
>nResult = SQLEXEC(nHand, "sp_NewCustomer;4 0", "curNewCustId")
>
>Using AERROR(), I get the following back:
>
>1526 Connectivity error: CU
>[Microsoft][ODBC SQL Server Driver][SQL Server]Column 'vcAcct_Ref'
>of table 'Stress.dbo.Customer' cannot accept 11 bytes (10 max).
>
>1526 Connectivity error: CU
>[Microsoft][ODBC SQL Server Driver][SQL Server]Command has been
>aborted.
>
>1526 Connectivity error: CU
>[Microsoft][ODBC SQL Server Driver][SQL Server]Attempt to insert
>the value NULL into column 'iCust_id', table 'Stress.dbo.PsnlDets';
>column does not allow nulls. INSERT fails.
>
>1526 Connectivity error: CU
>[Microsoft][ODBC SQL Server Driver][SQL Server]Command has been
>aborted.
>
>I cannot understand why this works perfectly in SQL Server and does not work at all in VFP?
>
>Thanks again for your help
Excuse me English
I learn slowly
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform