Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 28th, 2004, 05:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I you want to copy a row from one table to another you can use the SQL syntax "INSERT INTO table2 SELECT * FROM table1 WHERE ..."

Also, you can run more than one SQL statement at a time by separating each with a ;

So, you can do the move(s) followed by the delete(s) in one go. Just make sure you use a transaction.
 
Old September 30th, 2004, 09:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

As Phil suggested, you could have done that easily with DELETE statement with WHERE Clause specifications.

About the Single and Double quotes: Both can be used. But Single quotes fit in better than double quotes around string values(non numeric, for which you don't have to use quotes around), becoz DOUBLE quotes in VBA/VBScript/VB lang is used to wrap the Contants/strings, so within that if you would like to use quotes around string values to contruct sql statement as in your case, you got to use single quotes as specified in my previous post, ot you could use double DOUBLE quotes "" to nullify/negate the special meaning of the preceeding one.

Hope that explains.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Data type mismatch sharon5469 ASP.NET 1.0 and 1.1 Basics 2 May 27th, 2007 10:01 AM
data type mismatch karma SQL Language 3 April 6th, 2006 07:58 AM
Getting Data Type mismatch for autonumber somissac General .NET 4 March 1st, 2006 12:02 AM
Data type mismatch problem dominic_huang Classic ASP Databases 3 November 15th, 2004 03:12 AM
Data Type mismatch error clueless_may Access VBA 1 May 5th, 2004 09:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.