473,511 Members | 16,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HOW TO Use transaction control statements inside a sored procedure

gauravgmbhr
107 New Member
hi
i am having problem using transactions inside a function
i have to insert records in two tables which have interdependent foreign keys.

so the insertion should be done inside a transaction
and i need to use a single stored procedure to do that.

SO can someone help me by telling me how to use transactions inside a function
or f possible kindly email to gaurav.gambhir.er@gmail.com
Feb 24 '07 #1
2 4183
michaelb
534 Recognized Expert Contributor
What code did you write so far?
If you just about to start you may want to review these pages first:

Functions

Transactions
Feb 26 '07 #2
gauravgmbhr
107 New Member
thanx for the help
but still the questions remain the same
How to begin the transaction inside a function

i need two insert statements inside the function.
the two insert statements cannot execute without a transaction
because they have inter Dependant foreign keys i.e table1 has a foreign key-->table2, and table2 has foreign key--->table1
Mar 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
7870
by: Sam | last post by:
Guys, I have a question regarding oracle. I have a stored procedure executing a number of statements including delete , select and lots of inserts in one big procedure and main transaction I...
1
1469
by: MAB71 | last post by:
I wrote a procedure in SQL 6.5 which is something like CREATE PROCEDURE abc AS BEGIN TRAN xyz insert statement ..
2
2352
by: Deepak Mehta | last post by:
i have to update two tables from ASP pages with same data but i want that both of them should be updated at one time. If either of them is not updated then my transaction should roll back.I want...
0
421
by: akej via SQLMonster.com | last post by:
Hi to all. Many times i saw that some people wrap the single insert, delete or update statements to transaction. My question is suppose i have procedure , and inside this procedure i perform...
8
2567
by: Alex | last post by:
Hi, I have a test system that is setup the same as a production system and would like to frequently copy the database over. pg_dump takes a few hours and even sometimes hangs. Are there any...
15
9960
by: Zeng | last post by:
Hi, The bigger my C# web-application gets, the more places I need to put in the tedious retrying block of code to make sure operations that can run into database deadlocks are re-run (retried)...
9
10907
by: ucasesoftware | last post by:
i need to use this : Private Shared Sub Demo1() Dim db As SqlConnection = New SqlConnection("connstringhere") Dim transaction As SqlTransaction db.Open transaction = db.BeginTransaction Try...
2
8097
by: kanda | last post by:
Hello. I am developing the application (VBA&ODBC, to be exact) which periodically calls the stored procedures in the IBM DB2. A few of the procedures require executing with isolation level RR (...
1
3508
by: cricketweb | last post by:
I have a stored procedure that calls another stored procedure with the first stored procedure opening a transaction: BEGIN SET XACT_ABORT ON BEGIN TRANSACTION does various updates/inserts
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7355
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5668
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5066
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.