cancel
Showing results for 
Search instead for 
Did you mean: 

MAXDB: Simple Select problem

Former Member
0 Kudos

Hello,

I am currently experiencing a problem with a trivial SELECT statement.

I have a table "blog" which contains several rows.

Column uid is the pk.

A "select * from blog where<b> uid </b>= 1700" returns "no result".

I definitely have a row with that uid.

A "select * from blog where<b> blog.uid</b>=1700" returns that row.

So, it seems like I have to prefix the column with the table name.

What's wrong with the first statement ?

If something is wrong with the statement, why is there no error message ?

The problem is that I use a tool to query the database that generates the select statement WITHOUT the table prefix.

Log:

++++ Execute +++++++++++++++++++++++++++++++

Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed

select * from blog where uid=1700

<b>Statement successfully executed. No Result <===================================</b>

Execution Time: 23:33:42.765 - 23:33:42.765 (00.000 sec)

++++ Execute +++++++++++++++++++++++++++++++

Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed

select * from blog where blog.uid=1700

<b>Statement successfully executed. <===================================</b>

Execution Time: 23:33:26.296 - 23:33:26.296 (00.000 sec)

I am using MAXDB 7.6.00.34 on Linux.

Thanks

Andre

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Andre,

UID (UserID) is a reserved keyword in MaxDB. You can select the UID with

“select UID from dual”. So in the first statement you check if the UID (not your blob.uid) is 1700.

If you have a column named UID you have to prefix it with the table name. Like you do in the second statement.

Regards

Wolfgang

Former Member
0 Kudos

Hello Wolfgang,

thank you so much for your answer.

It works

Regards

André

Answers (0)