473,503 Members | 9,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert Into problems

2 New Member
Hello Experts,

I have a table app.ca. I have another table app.cb. app.cb has 6 required fields. app.ca contains 5 of those 6 fields. I want the other field to simply be 1. I can not think of how to get the records recorded into app.cb. Here is what I've come up with so far. Can you help me?

Expand|Select|Wrap|Line Numbers
  1.  INSERT 
  2. INTO 
  3.     APP.CB 
  4.     (
  5.         EIACODXA, 
  6.         LSACONXB, 
  7.         ALTLCNXB, 
  8.         LCNTYPXB, 
  9.         TASKCDCA, 
  10.         SUBNUMCB
  11.     ) 
  12.     VALUES 
  13.     (
  14.         (
  15.         SELECT 
  16.             APP.CA.EIACODXA 
  17.         FROM 
  18.             APP.CA
  19.         )
  20.         , 
  21.         ( 
  22.         SELECT 
  23.             APP.CA.LSACONXB 
  24.         FROM 
  25.             APP.CA
  26.         )
  27.         , 
  28.         ( 
  29.         SELECT 
  30.             APP.CA.ALTLCNXB 
  31.         FROM 
  32.             APP.CA
  33.         )
  34.         , 
  35.         ( 
  36.         SELECT 
  37.             APP.CA.LCNTYPXB 
  38.         FROM 
  39.             APP.CA
  40.         )
  41.         , 
  42.         ( 
  43.         SELECT 
  44.             APP.CA.TASKCDCA 
  45.         FROM 
  46.             APP.CA 
  47.         )
  48.         ,
  49.         ('1')
  50.     ) 
Dec 20 '07 #1
3 1140
debasisdas
8,127 Recognized Expert Expert
you may try this

insert to target_table select f1,f2,f3,'1' from source_table;
Dec 21 '07 #2
Robere
2 New Member
you may try this

insert to target_table select f1,f2,f3,'1' from source_table;
Sir, this worked. Thank you very much.
Dec 21 '07 #3
debasisdas
8,127 Recognized Expert Expert
Sir, this worked. Thank you very much.
you are most welcome .
i am glad that i could help you.
Dec 23 '07 #4

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

Similar topics

5
4878
by: me | last post by:
I'm also having problems getting the bulk insert to work. I don't know anything about it except what I've gleened from BOL but I'm not seeming to get anywhere...Hopefully there is some little (or...
14
4269
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...
8
6274
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with...
4
8191
by: G.Esmeijer | last post by:
Friends When I use a Querystring for insertdating data into a Tabel (going to SQLserver) the decimal pint changes to a comma. The result is that I get a system error (which I can understand) ...
2
12869
by: John Tyce | last post by:
When a button is clicked, a date is inserted or added into a combo box like this : ComboBox.Items.Add(string) or ComboBox.Items.Insert(0,string); Either way, the new string does not show up in the...
3
7974
by: nolanmadson | last post by:
I'm creating a front-end for some Teradata user maintenance tables in MS Access. I've started having problems in occasionally not being able to insert or update records in these tables. I've been...
1
2786
by: =?Utf-8?B?SGFycnkgS2Vjaw==?= | last post by:
I have a GridView that I dynamically add columns to in code. The way that my code is written, everything works properly if I use GridView.Columns.Add to simply add the columns to the end of the...
5
2723
by: Rob | last post by:
I'm trying to use the set<my_class>::insert( my_class const & ) method, but have run into some problems. It seems like I'm seeing it insert an object when a similar object is already in the set. ...
0
1587
BenRatcliffe
by: BenRatcliffe | last post by:
Hi there, I was wondering if anyone could help me. I have a comlpex database with a number of forms that have data entered on them and then saved into the correct table etc. In this instance I am...
2
162
by: Terry Reedy | last post by:
SUBHABRATA, I recommend you study this excellent response carefully. castironpi wrote: It starts with a concrete test case -- an 'executable problem statement'. To me, this is cleared and...
0
7095
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
7294
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
7015
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
5602
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,...
0
3183
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
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1523
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
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
403
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.