• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

Insert Statement

Hello,

Will a INSERT statement work for taking a record from one table to another?
0
Jass Saini
Asked:
Jass Saini
  • 4
  • 3
  • 2
  • +1
2 Solutions
 
Eric ShermanAccountant/DeveloperCommented:
Yes, can you be a little more specific in what you are trying to accomplish.

ET
0
 
Rey Obrero (Capricorn1)Commented:
yes

Insert into tablex(f1,f2)
select f1,f2 from tableY
0
 
SimonCommented:
Insert into tbl1 (txtCol)
select txtAnotherCol from tbl2
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Jass SainiAuthor Commented:
Would it be okay to insert from one table to another when the col are different or do they have to be the same.  Where in the property should the action happen?
0
 
Rey Obrero (Capricorn1)Commented:
the names of columns may not be the same, BUT the number of columns must be the Same and the Data types must be the same.
0
 
SimonCommented:
The order of the values clause and the select clause are what matters

insert into t1 (col3,col1)
select col2,col4 from t2

In this case col2 gets inserted in col3 of the table t1 and col4 gets inserted into col1 of t1.

Datatypes should be the same or coercible (e.g. numeric to string, but not alphanumeric string to numeric);.
0
 
Jass SainiAuthor Commented:
So should I use a COPY button to to copy that over...also...sorry forget this ..

Some of my fields that I need to copy are on the main form and others are the sub form.  Will that be okay?
0
 
Rey Obrero (Capricorn1)Commented:
omg,,, @JAss SAini
please stick to the original problem that you posted..
when you got a solution, close the thread AND OPEN a new question for another problem.
0
 
Jass SainiAuthor Commented:
OK Thank you Rey...it is still part of the same problem.
0
 
Jass SainiAuthor Commented:
Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now