DB2 SQL error sqlcode -104 sqlstate 42601

0 votes

I've only recently started using DB2, not SQL. When I try a SELECT statement while taking a few minutes out of a timestamp, I get the following error:

SELECT * TCCAWZTXD.TCC_COIL_DEMODATA
WHERE CURRENT_INSERTTIME  BETWEEN(CURRENT_TIMESTAMP)-5 minutes AND CURRENT_TIMESTAMP

The error that I am experiencing is:

DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=TCCAWZTXD;SELECT*;, DRIVER=3.66.46

How can I fix this error?

Sep 11, 2022 in Database by Kithuzzz
• 38,020 points
3,804 views

1 answer to this question.

0 votes

You missed the from clause:

SELECT *  from TCCAWZTXD.TCC_COIL_DEMODATA WHERE CURRENT_INSERTTIME  BETWEEN(CURRENT_TIMESTAMP)-5 minutes AND CURRENT_TIMESTAMP

I hope this helps you.

answered Sep 12, 2022 by narikkadan
• 63,680 points

Related Questions In Database

0 votes
0 answers

DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703

I am getting this JDBC exception. I ...READ MORE

Sep 5, 2022 in Database by Kithuzzz
• 38,020 points
1,364 views
0 votes
1 answer
0 votes
1 answer

Error:Import SQL dump into PostgreSQL database

Hello, Here is the command you are looking ...READ MORE

answered May 4, 2020 in Database by Niroj
• 82,880 points
5,139 views
0 votes
1 answer

SQL error "ORA-01722: invalid number"

When an effort is made to convert ...READ MORE

answered Feb 15, 2022 in Database by Neha
• 9,020 points
3,115 views
0 votes
1 answer

Which query to use for better performance, join in SQL or using Dataset API?

DataFrames and SparkSQL performed almost about the ...READ MORE

answered Apr 19, 2018 in Apache Spark by kurt_cobain
• 9,390 points
1,786 views
0 votes
1 answer

How to connect Java program to the MySQL database?

You can connect your Java code with ...READ MORE

answered May 11, 2018 in Java by Parth
• 4,640 points
1,881 views
0 votes
1 answer
0 votes
1 answer

Automating Oracle script with nolio

Depending upon the details of your script ...READ MORE

answered Jul 17, 2018 in Other DevOps Questions by ajs3033
• 7,300 points
1,007 views
0 votes
1 answer

How to solve : SQL Error: ORA-00604: error occurred at recursive SQL level 1

I saw the problem in the line ...READ MORE

answered Sep 10, 2022 in Database by narikkadan
• 63,680 points
4,810 views
0 votes
1 answer

Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452) in sql 2008

Solution Go to Start > Programs > Microsoft SQL Server > Enterprise Manager. Right-click the SQL ...READ MORE

answered Sep 12, 2022 in Database by narikkadan
• 63,680 points
1,064 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP