473,499 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

insert into primary froeigon key relationship

10 New Member
Hi every one
i want to insert into tx_category table data coulmn cat_type while selecting existing types from tx_type table.these two table are linked primary foreigon key relationship

INSERT INTO TX_CATEGORY(CAT_ID, STATUS_VALUE,CAT_NAME,CAT_PRIMARY_TITLE,CAT_TYPE,C AT_PRIMARYTEXT,CAT_PRIMARYCONTEXT,SRC_ID,CAT_SECON DARY_TITLE,CAT_PRIMARY_INDEX,CAT_UPDATEDBY,CAT_UPD ATEDON,CAT_CREATEDBY,CAT_CREATEDON) VALUES((select NVL(MAX(CAT_ID),1) + 1 from TX_CATEGORY),'" + Is_StatVal + "','" + Is_CatName + "','" + Is_pTitle + "','"+Is_CatType +"','" + Is_pText + "','" + Is_pContext + "','" + Is_srcID + "','" + Is_sTitle + "','" + Is_pIndex + "','" + Is_UpdatedBy + "','" + Is_UpdatedOn + "','" + Is_CreatedBy + "','" + Is_CreatedOn + "')";
Aug 20 '08 #1
2 1468
r035198x
13,262 MVP
Did you get an error with that then?
Aug 20 '08 #2
debasisdas
8,127 Recognized Expert Expert
you need to insert to parent table first then only you can insert to child table to enforce rule of REFERENTIAL INTEGRITY.
Aug 20 '08 #3

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

Similar topics

14
4268
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
3
4480
by: Nicolae Fieraru | last post by:
Hi All, I have a problem and I can't figure out how to solve it. My database has three tables: tblCustomers, with CustomerId and CustomerName tblProducts, with ProductId and ProductCode...
1
6296
by: tabonni | last post by:
Hi all I created two tables - Employee and Folder using MS Access 2002. Inside Employee table, I got 3 fields: EmployeeID (Data Type:Autonumber) Username (Data Type: Text) Password (Data...
8
9210
by: Bri | last post by:
Greetings, I'm having a very strange problem in an AC97 MDB with ODBC Linked tables to SQL Server 7. The table has an Identity field and a Timestamp field. The problem is that when a new record...
3
4313
by: Hai Nguyen | last post by:
Hi all I was attempting to insert multiple row by using a loop into a database.A table has 2 primary keys and one regular field (PR) (PR) ID Project Ans 1 2 a 1 ...
8
31512
by: Paul Hunter | last post by:
I am new to databases and thus to Access. I have a situation where I am trying to figure out how to key some tables I am working with. Consider that I have a database of my own records which are...
4
5071
by: Robert Ludig | last post by:
I have a Table that contains Items of the Type "Step". The primary key is "StepID". Each step can have have a target step, wich represents a subsequent step. So I have a Foreign key relationship...
2
1963
by: cday119 | last post by:
Can someone help me out with this one. I am trying to insert a row of data into an access database. The primary key is set to auto increment. It will work once but the next time you try an insert...
2
7319
by: ksenthilbabu | last post by:
Hey All, I am using MSSQL -2005 with VB6. I have created a master table tblCompany and detail Table tblDetail having foreign key relationship. When i try to insert a value within a TRANSACTION I...
0
7006
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
7169
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,...
1
6892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5467
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
4917
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
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1425
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
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.