SQL Workbench Error When Connecting to Redshift

I am trying to create a table in aws redshift using sqlwork scanner. I can connect redshift, but by executing the below script, I get an interrupt error message. Please let me know if anyone has any solution.

CREATE TABLE actual_report ( type1 varchar(40), Jj_calendar_Order_Month varchar(40), Jj_Calendar_Order_Year varchar(40), Product_major_Code_description varchar(40), Product_minor_Code varchar(40), Product_part_number varchar(40), Product_Minor_Description varchar(40), Order_Quantity decimal(20), Order_Item_Unit_Price decimal(10,2), country varchar(40)) 

An error occurred while executing the SQL command: CREATE TABLE actual_report (type1 varchar (40), Jj_calendar_Order_Month varchar (40), Jj_Calendar_Order_Year varchar (40), Product_major_Code_descripti ...

Amazon Invalid operation: the current transaction is aborted, commands are ignored until the end of the transaction block; Lead time: 0.22 s 1 failed.

+10
source share
4 answers

I understood. The below script worked for me. I just deleted (_).

 CREATE TABLE actual_report ( type1 varchar(40), JjcalendarOrderMonth varchar(40), JjCalendarOrderYear varchar(40), ProductmajorCodedescription varchar(40), ProductminorCode varchar(40), Productpartnumber varchar(40), ProductMinorDescription varchar(40), OrderQuantity decimal(20), OrderItemUnitPrice decimal(10,2), country varchar(40)) 
0
source

I use SQL Workbench, and autocommit is disabled by default. I ran the SQL command below to enable autocommit , otherwise the transaction will not be transferred to the database. Just for reference.

 SET autocommit ON 
+27
source

Set Autocommit to TRUE in the SQL Workbench connection window. See attached image:

Set Autocommit to TRUE in SQL Workbench connection window

+12
source

Unless you run one explicitly, each of your Redshift requests will be enclosed in a transaction: http://docs.aws.amazon.com/redshift/latest/dg/r_BEGIN.html

To fix this problem when it occurs again, enter ROLLBACK; on line and run it. This should return your connection to working condition.

+6
source

Source: https://habr.com/ru/post/1215953/


All Articles