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,010 points
2,955 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,420 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,010 points
1,000 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
4,391 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,060 points
2,569 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,504 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,630 points
1,571 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
685 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,420 points
3,665 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,420 points
822 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