Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
A Little Help Please |
Wed, Mar 26 2014 12:34 PM | Permanent Link |
Kralic | I'm trying to run a SQL statement that inserts into one table from another but everytime i go to prepare the SQL it is returning an error. (See attachment)
Below is a copy of the SQL I'm using, I have a feeling this is something really obvious but i just cant see it.... If anyone could advise that would be great. Could this be done to different data types in the columns in the 'stock' table compared to the 'JD_Imports' table and if so, what is the easiest way to rectify this without changing the data types in either table? SQL Code; INSERT INTO Stock ( PartSupID, WarehouseCode, StkCode, StkDescription, StkCostValue, StkCostCurrencyValue, StkCostDate, StkQuantInStock, StkReorderLevel, StkOnOrder, StkToOrder, StkSupplierID, StkCategory, StkType, StkLocation, StkSalePrice, StkSaleDate, StkCostCurrency, StkMin, StkMax, StkContractPrice, StkLastUsed, StkTotalUsed, StkTotalStocked, StkSerialised, StkAlert, StkETA, StkSuppTheoretical, StkSuppAvailable, StkSuppUpdated, StkMyStock, StkNominal, StkMultipleLoc, StkNoneStock, StkSupAccountID, StkSupStockCode, StkTaxCode, StkNominalPOR, StkWeight, StkAvgDeliveryDays, StkNominalCostSales, StkNominalProfit, StkNominalBalance, StkNominalWIP, StkDirectSale, StkBarCode, StkManufacturerCode, StkManufacturerMatched, StkManufacturerUnique, StkGenuinePart, StkBrand, StkWebDescription ) SELECT PartSupID, WarehouseCode, StkCode, StkDescription, StkCostValue, StkCostCurrencyValue, StkCostDate, StkQuantInStock, StkReorderLevel, StkOnOrder, StkToOrder, StkSupplierID, StkCategory, StkType, StkLocation, StkSalePrice, StkSaleDate, StkCostCurrency, StkMin, StkMax, StkContractPrice, StkLastUsed, StkTotalUsed, StkTotalStocked, StkSerialised, StkAlert, StkETA, StkSuppTheoretical, StkSuppAvailable, StkSuppUpdated, StkMyStock, StkNominal, StkMultipleLoc, StkNoneStock, StkSupAccountID, StkSupStockCode, StkTaxCode, StkNominalPOR, StkWeight, StkAvgDeliveryDays, StkNominalCostSales, StkNominalProfit, StkNominalBalance, StkNominalWIP, StkDirectSale, StkBarCode, StkManufacturerCode, StkManufacturerMatched, StkManufacturerUnique, StkGenuinePart, StkBrand, StkWebDescription FROM JD_Imports |
Wed, Mar 26 2014 1:15 PM | Permanent Link |
Raul Team Elevate | On 3/26/2014 12:34 PM, Kralic wrote:
> I'm trying to run a SQL statement that inserts into one table from another but everytime i go to prepare the SQL it is returning an error. (See attachment) > Below is a copy of the SQL I'm using, I have a feeling this is something really obvious but i just cant see it.... If anyone could advise that would be great. Could this be done to different data types in the columns in the 'stock' table compared to the 'JD_Imports' table and if so, what is the easiest way to rectify this without changing the data types in either table? > Telling us what the error is would help. SQL looks ok to me. However is you have data type differences then that would likely be a problem - see CAST function in the SQL reference if you need to do conversions: http://www.elevatesoft.com/manual?action=viewtopic&id=dbisam4&product=rsdelphiwin32&version=XE5&topic=Functions Raul |
Thu, Mar 27 2014 6:33 AM | Permanent Link |
Kralic | Raul wrote:
On 3/26/2014 12:34 PM, Kralic wrote: > I'm trying to run a SQL statement that inserts into one table from another but everytime i go to prepare the SQL it is returning an error. (See attachment) > Below is a copy of the SQL I'm using, I have a feeling this is something really obvious but i just cant see it.... If anyone could advise that would be great. Could this be done to different data types in the columns in the 'stock' table compared to the 'JD_Imports' table and if so, what is the easiest way to rectify this without changing the data types in either table? > Telling us what the error is would help. SQL looks ok to me. However is you have data type differences then that would likely be a problem - see CAST function in the SQL reference if you need to do conversions: http://www.elevatesoft.com/manual?action=viewtopic&id=dbisam4&product=rsdelphiwin32&version=XE5&topic=Functions Raul Upon investigating this a little more I've realised it is down to differences in the data types in the two tables. Thankfully, using the CAST function I was able to do this import. But thank you for your response. |
This web page was last updated on Monday, April 29, 2024 at 05:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |