473,383 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Table locking

Per
I want to insert values into a table and the same time select a value
from the same table.

I insert a record of a parent type and use a function to create a
subscriberType for the record.

Next i insert a record of child type and want to select the
subscriberType from the parent record.

This do not work when i use

INSERT TABLE
SELECT ,Name
,"function to generate subscribertype"
,.............

I DO NOT WANT TO USE CURSOR!!
Jul 20 '05 #1
1 1989

"Per" <pe************************@cgey.com> wrote in message
news:e8**************************@posting.google.c om...
I want to insert values into a table and the same time select a value
from the same table.

I insert a record of a parent type and use a function to create a
subscriberType for the record.

Next i insert a record of child type and want to select the
subscriberType from the parent record.

This do not work when i use

INSERT TABLE
SELECT ,Name
,"function to generate subscribertype"
,.............

I DO NOT WANT TO USE CURSOR!!


It's not clear how you create the subscriberType. If it's based on the
properties of the parent record, then you may be able to generate the type
before doing any of the INSERTS:

declare @type int
set @type = dbo.GenerateType(ParentName)

insert into dbo.MyTable
select ParentName, @type

insert into dbo.MyTable
select ChildName, @type

But that's just a guess - without more information (table structure, how you
generate the type etc.), it's not possible to give a better answer.

Simon
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sai Pavan | last post by:
Hey guys, In our Oraganization we have Oracle8i as database. All the newly supported locking systems for the database are with 9i. we need table locking and row level locking from .NET to Oracle8i....
1
by: Mike L. Bell | last post by:
Query: update table1 t1 set end_time = ( select end_time from table2 t2 where t2.key1 = t1.key1 and t2.key2 = t1.key2 ) where exists
5
by: chintalas | last post by:
Here when many users are trying to update the same table the dead lock situation is arising. I like to know how i can put a lock at record level in my table, so that the dead lock situation will...
1
by: leon | last post by:
Hi all, I have an .mdb file (access database) which has been set to table level locking (i.e. not just records in question, but the whole table). The database is also in sharing mode (ie. not...
2
by: invinfo | last post by:
I don't recall exactly what options I selected in September when I installed the beta v5.0.4 on my development machine, But, as I started to develop and then backup data, I noticed that my tables...
2
by: adri4n | last post by:
as wat ive mentioned in the title.. im would like to know whether the a particular record/table is being locked in my program. some of the methods which i would like to develop are as below: ...
22
by: RayPower | last post by:
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4....
0
by: shakahshakah | last post by:
Just started investigating InnoDB after having used MyISAM tables in the 4.0.12 version, almost immediately ran into a locking issue with INSERTs, DELETEs, and transactions. Given the following...
7
dlite922
by: dlite922 | last post by:
I need to do some sort of Locking mechanism at interface level, instead of DB Level. I know how MySQL table locking works, but that won't work in my scenerio. Requirements: When someone is...
18
by: Charles Law | last post by:
I have a sproc that returns data from a table using a simple SELECT. There are quite a few rows returned, e.g. ~150,000. In my first application, I use a reader on the sproc and iterate through...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.