Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Parsing
Message
From
31/03/2021 17:18:27
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
31/03/2021 14:49:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01679373
Message ID:
01679403
Views:
56
>>>is this to add an Upsert into vfp SQL or a wish for arbitrary backends ?
>>>On first reading impression is you don't trust the gods of Commit and Rollback.
>>>Or is your aim a solution to check, prune, fix and send bulk row operations ?
>>
>>I'm unable to massively change this system. I was mentally reserving transactions for multi-table/multi-row changes. You're right. I had not thought to wrap each insert in one. Thanks for releasing a mental block!
>>
>You are welcome - glad my visualization of what could have prompted the post was not totally off target ;-)

Hi Thomas

I'm struggling with getting sql server to return error info that I can trap with aerror. I turned on DispWarnings for the connection. I can't seem to get any raiseerror command syntax right. The SQLEXEC executable command takes this form:
	DECLARE @ErrNum INT
	SET @ErrNum = 0
	BEGIN TRY
		BEGIN TRANSACTION
		select 1/0
		COMMIT TRANSACTION
	END TRY
	BEGIN CATCH
		ROLLBACK TRANSACTION
		SET @ErrNum =ERROR_NUMBER()
	END CATCH
	IF @ErrNum < > 0
		BEGIN
			RAISEERROR(@ErrNum,11,-1)
		END
If it returns a negative number it's only complaining about the raiseerror syntax. As I am using try/catch to decide to rollback, I think it is handling the error, so I need to raise the error for FoxPro to see it?
Previous
Reply
Map
View

Click here to load this message in the networking platform