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,000 points
4,264 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,600 points

Related Questions In Database

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,840 points
5,505 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,341 views
0 votes
0 answers

Login to Microsoft SQL Server Error: 18456

When I try to connect to the SQL ...READ MORE

Aug 14, 2022 in Database by Kithuzzz
• 38,000 points
720 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,350 points
2,054 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
2,039 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,221 views
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,000 points
1,629 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