Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass a FALSE to a SQL Server stored procedure
Message
From
09/03/1998 10:18:34
Steve Camsell
Windmill Associates
Bath, United Kingdom
 
 
To
09/03/1998 09:43:52
Claudio Abad
Compañía Financiera Argentina
Buenos Aires, Argentina
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00082731
Message ID:
00083388
Views:
35
Thanks Very Much Claudio,

I now have it working perfectly from both FoxPro and SQL Server!

Steve
>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
Steve Camsell
Development Consultant
Steve.Camsell@Windmill-DBM.Co.Uk
Previous
Reply
Map
View

Click here to load this message in the networking platform