CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Custom Insert

Print topic Send  topic

Author Message
Anothersledhead


Posts: 44
Posted: 01/03/2005, 9:23 PM

Any sugestions on how to insert a series of records from one table to another. I have two tables quote_detail and invoice_detail and would like to populate the invoice table with data from my quote table.

Thanks for any help!
View profile  Send private message
bmaclean

Posts: 7
Posted: 01/09/2005, 11:34 PM

If you're asking for the SQL, I can help:

INSERT INTO
<target_table> (<target_column_1>, <target_column_2> . . . )
SELECT <source_column_1>, <source_column_2> . . .
FROM <source_table>
WHERE . . .;

The things in <chevrons> are placeholders for actual table and column names. Use the WHERE clause to limit your SELECT to the appropriate rows.

If you are asking a CCS specific question, someone else will have to help, though I hope to know enough CCS in the future to help:)

Thanks,

Mac
View profile  Send private message
bmaclean

Posts: 7
Posted: 01/09/2005, 11:37 PM

Forgot to mention: The source and target columns do not have to be the same name, but the data ypes have to be compatible. Also the target columns must have equal or longer length (in the case of varchars) or precision and scale (in the case of numbers) than the source columns.

Quote bmaclean:
If you're asking for the SQL, I can help:

INSERT INTO
<target_table> (<target_column_1>, <target_column_2> . . . )
SELECT <source_column_1>, <source_column_2> . . .
FROM <source_table>
WHERE . . .;

The things in <chevrons> are placeholders for actual table and column names. Use the WHERE clause to limit your SELECT to the appropriate rows.

If you are asking a CCS specific question, someone else will have to help, though I hope to know enough CCS in the future to help:)

Thanks,

Mac
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.