cancel
Showing results for 
Search instead for 
Did you mean: 

Reason behind this query ,SELECT * FROM <table> WHERE 1 < 0

Former Member
0 Kudos

HEllo,

I would like to know the reason behind using this query ,

SELECT * FROM <table> WHERE 1 < 0

before executing the actual SQL query.

Is there any special reason or the JDBC receiver side is configured like that.

Is there any option to overcome this process like, can we remove this option or stop using this.

Why the JDBC adapter basically sending this query on the DB?

Thanks,

Soorya,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi!

Is it on the receiver side? Or is it a JDBC sender..

This query is used for selecting no rows. Let me explain it:

If there was a no query, error would be thrown. So you must use some. But still you don't want to start any processing. So you use this type of query.

Peter

add: this maybe also a test, if the table exists in the DB... If yes, nothing happens, if not, exception is thrown..

Edited by: Peter Jarunek on Mar 27, 2008 1:20 PM

Former Member
0 Kudos

Hi Peter,

This query is executed at receiver side just before executing the original query given in the XML format.

So basically this is meant to get the meta data of the table.

So can you please have a look on this query and tell me the side effects by using such a query at DB side especially in DB2 of IBMs

Thanks,

Soorya

Answers (3)

Answers (3)

Former Member
0 Kudos

hi

as per my knowledge we use this qurey when we are using JDBC adapter on sender side

note:reward points if solution found helpfull.....

regards

chandrakanth.k

Former Member
0 Kudos

HEllo kanth,

This is not used in sender side. Its used in receiver side only. before executing the actuall query written in the XML format which helps in storing the data in DB.

THanks,

Soorya.

Former Member
0 Kudos

Surya,

if this is used on the receiver side and there is no other information (like exception handling, if the table does not exist), you can delete this query and nothing happens..

Olian

Former Member
0 Kudos

Hi Surya,

I don't know DB2, but I believe this query can be deleted there.. It really does nothing.

Peter

aashish_sinha
Active Contributor
0 Kudos

Hi,

if you run this query, you wont be able to see any records of the table.

SELECT * FROM <table> WHERE 1 < 0

if you run this query you will see all records

SELECT * FROM <table> WHERE 0 < 1

same with SELECT * FROM <table> WHERE 1=1

So you can check this out that whats happening in your code before executing actual query. just try to co-relate.

regards

Aashish Sinha

PS : reward points if helpful

Former Member
0 Kudos

hi,

the SQL query that u r asking is used on the sender side.

Reason: this is used as indicator to specifies the processing status of each data record in the adapter (data record processed/data record not processed) to the database table.