Forum Discussion
Informix connection problems SQLCODE = -213.
- 5 years ago
Hi Arial36 ,
According to the above situation, it may be related to your data source. This error occurs when doing an INSERT where the columns list is not specified and the values being inserted, either through the VALUES clause or through a SELECT subquery, are either more than or less than the columns in the table.
You can try to values specified in the VALUES clause or in the SELECT subquery match the number of columns in the INSERT clause. For details, please refer to the following solutions: SQL Server Helper (sql-server-helper.com)
-- Sample #1: Using INSERT INTO ... VALUES CREATE TABLE [dbo].[Customers] ( [ID] INT, [Name] VARCHAR(100)) INSERT INTO [dbo].[Customers] VALUES (1, 'John', 'Doe') -- Sample #2: Using INSERT INTO ... SELECT FROM CREATE TABLE [dbo].[Client] ( [ID] INT, [Name] VARCHAR(100)) INSERT INTO [dbo].[Client] SELECT [ID], [Name], [Address] FROM [dbo].[NewClient]-- Sample #1: Using INSERT INTO ... VALUES CREATE TABLE [dbo].[Customers] ( [ID] INT, [Name] VARCHAR(100)) INSERT INTO [dbo].[Customers] ( [ID], [Name] ) VALUES (1, 'John Doe') -- Sample #2: Using INSERT INTO ... SELECT FROM CREATE TABLE [dbo].[Client] ( [ID] INT, [Name] VARCHAR(100)) INSERT INTO [dbo].[Client] ( [ID], [Name] ) SELECT [ID], [Name] FROM [dbo].[NewClient]
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Arial36 ,
According to the above situation, it may be related to your data source. This error occurs when doing an INSERT where the columns list is not specified and the values being inserted, either through the VALUES clause or through a SELECT subquery, are either more than or less than the columns in the table.
You can try to values specified in the VALUES clause or in the SELECT subquery match the number of columns in the INSERT clause. For details, please refer to the following solutions: SQL Server Helper (sql-server-helper.com)
-- Sample #1: Using INSERT INTO ... VALUES
CREATE TABLE [dbo].[Customers] ( [ID] INT, [Name] VARCHAR(100))
INSERT INTO [dbo].[Customers]
VALUES (1, 'John', 'Doe')
-- Sample #2: Using INSERT INTO ... SELECT FROM
CREATE TABLE [dbo].[Client] ( [ID] INT, [Name] VARCHAR(100))
INSERT INTO [dbo].[Client]
SELECT [ID], [Name], [Address]
FROM [dbo].[NewClient]-- Sample #1: Using INSERT INTO ... VALUES
CREATE TABLE [dbo].[Customers] ( [ID] INT, [Name] VARCHAR(100))
INSERT INTO [dbo].[Customers] ( [ID], [Name] )
VALUES (1, 'John Doe')
-- Sample #2: Using INSERT INTO ... SELECT FROM
CREATE TABLE [dbo].[Client] ( [ID] INT, [Name] VARCHAR(100))
INSERT INTO [dbo].[Client] ( [ID], [Name] )
SELECT [ID], [Name]
FROM [dbo].[NewClient]
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.