cancel
Showing results for 
Search instead for 
Did you mean: 

MDO select Query throwing error: The token [ was not expected

Former Member
0 Kudos

Hi,

I try to select all data from an MDO using a select MDO Query with MII15 SP2 Patch 8 but get the error java.sql.SQLException: Error while processing the template .../MYPROJECT/TESTQUERY- 1:22 - SQL syntax error: the token [ was not expected here

The query only points to my MDO and has no seletion parameters cause I want to get all entries from that very MDO.

I rebuild query and MDO - same result. Error occurs even if I try to apply above query after using a delete for all values - so MDO should be emtpy.

At the moment, I do not have the faintest idea what's going on...

Is there a way one can use to display MDO content without select query?

Anybody got an idea?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

please share me , how to write MDO query for Update and Delete and share screen shorts

Former Member
0 Kudos

Well, after is was working with * I was wondering what is the issue. So i again I rebuild MDO and Query the same way and now it is working. To be honest, I have no idea what was wrong.

However, Swaroop, Manisha, thank you very much for your efforsts! I really appreciate your effrots to help people within that community

swaroop_anasane
Active Contributor
0 Kudos

That's great!

Thanks,

Swaroop

swaroop_anasane
Active Contributor
0 Kudos

Just a thought, were you using typed parameters. This could be a problem when you provide quotes in this case.

-Swaroop

Former Member
0 Kudos

Thanks for the hint Swarrop, I will keep that it in mind. Could it also be related to some cache issue? Like u are changing the name/folder? Of course u then have to adapt Queries and Transactions. Can nevertheless some old setting remain in cache?

siriyadav0902
Explorer
0 Kudos

Hello All,

Work around for "SQL syntax error: the token [ was not expected here" in MDO select query.

please fellow below steps:

  1. In select query try to select attributes one by one and execute the MDO SELECT query. While testing like this, you will get the error "SQL syntax error: the token [ was not expected here" for some attributes.
  2. Then, In MDO definition try to change the Attribute name which is causing error.Save the MDO definition with (Ctrl+s). Note: In this attribute name change process data will not flushed off.
  3. Now test the MDO select query with the attribute, which caused error. Sometimes you need to change attributes twice, if first changed attribute name is not worked out. Then you will be able to perform MDO SELECT query successfully.

In my case, I have created MDO definition with Attribute like this "Operation_Quantity". But It was throwing error.

Trail 1: Then I changed it to "Operation_Qty" , Bad luck. didnt work.

Trail 2: Changed to "Oper_Quantity". . it worked.

Thanks

Srisailam

manishagb
Explorer
0 Kudos

Good...!

Now you can mark the query as "Answered".

regards,

Manisha

Former Member
0 Kudos

Manisha, what do you refer to?

The screenshot shows my starting point...even the test function throws above error

manishagb
Explorer
0 Kudos

Marco,

Now what is the error statement that you are getting?

manishagb
Explorer
0 Kudos

Hi Marco,

i guess you are trying to use "[*]" in the space for Selected attributes.

Remove it and drag the names of desired columns from the Available attributes list. With this execution of the respective MDOquery should display the desired results.

This should work.

Also, you can directly see the MDO data by test execution of the relevant MDO Object, if it is open in workbench (right click on MDO-Object name and Test). 

regards,

Manisha

Former Member
0 Kudos

Hi Manisha,

greetings and thank you for your answer! I used those buttons to select my attributes. So it is [WERKS]

[ORDER]

[ACT_PT]

...and not the *-sign.

I also do not use any filter, sort or group expression that could cause an error...

swaroop_anasane
Active Contributor
0 Kudos

Hi Marco,

Can you share a screenshot?

-Swaroop

Former Member
0 Kudos

Please find below my screenshot from the select statement. Besides those settings, i only gave the MDO in the register Data Source and the Mode "Select". Apart from that, I did not change any settings within the query

swaroop_anasane
Active Contributor
0 Kudos

Looks like some conditions on source!

What is the source of your MDO?

Regards,

Swaroop

Former Member
0 Kudos

My MDO has no defined source, that is no transaction/query is given as data source.

I defined the MDO columns myself. I wanted to populate MDO using an INSERT MDO Query. Populating seems to work fine, at least debugger says Inserts are successful. (Same holds for delete statements)

I also tried to define a transaction as data source and used a life cycle task to popualte MDO - that one works fine - no trouble at all.

But when I want to start from scratch and define an empty MDO, SELECT does not work at all.

swaroop_anasane
Active Contributor
0 Kudos

Hi Marco,

There's definitely some miss. Please share a screen shot of your mdo and insert query.

Thanks,

Swaroop