Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Lookup Call(Using LookupCall with master filter on ListBox )
Lookup Call [message #1814347] Tue, 10 September 2019 03:22 Go to next message
Mark Novem Grisola is currently offline Mark Novem GrisolaFriend
Messages: 27
Registered: November 2017
Junior Member
Hello Sir,

I am using Lookup Call to populate records on ListBox but error on server side occurs as shown below:

2019-09-10 01:39:51,494 ERROR [qtp925973605-16] org.eclipse.scout.rt.platform.exception.ExceptionHandler.handlePlatformException(ExceptionHandler.java:124) - -Ex: org.eclipse.scout.rt.platform.exception.PlatformException: ERROR: operator does not exist: integer = character varying
Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
Position: 87 [translator=org.eclipse.scout.rt.platform.exception.PlatformExceptionTranslator, user=xxx, statement=SQL with binds:
SELECT ID,
TITLE
FROM SAM
WHERE 1 = 1
AND (:master IS NULL
OR
ID = :master)
IN :master => ? [VARCHAR null]
IN :master => ? [VARCHAR null], service.name=xx.yy.zz.sample.shared.prime.ISampleLookupService, service.operation=getDataByAll]


I have another form where it has an smart field and i used this lookupCall to provide the list of item and it works well. In this form i provided the master field. Could it be because i did not provided the master field on the first mentioned form (listbox)? If yes, then every lookupCall having a master attribute on its SQl query must have a master field provided? Or did i missed something on LookupCall approach?

Hope someone can help me on this matter.. Thank you..

Sincerely,
mark
Re: Lookup Call [message #1814348 is a reply to message #1814347] Tue, 10 September 2019 05:25 Go to previous messageGo to next message
Matthias OtterbachFriend
Messages: 55
Registered: August 2015
Location: Munich
Member
Basically I think PostgreSQL complains that there is a type mismatch, I suppose the ID column is an integer and :master seems to be bound as varchar (I do not know w/o researching if this varchar decision is already made by Scout). You might be able to fix this error if you apply an explicit cast to the :master bind, e.g. [...] OR ID = cast(:master AS integer). As long as the cast is possible this query might work better as long as :master can be cast to an integer. The other way around (casting ID to varchar) may be even more safe: [...] OR cast(ID AS varchar) = :master.
Re: Lookup Call [message #1814351 is a reply to message #1814348] Tue, 10 September 2019 06:05 Go to previous message
Mark Novem Grisola is currently offline Mark Novem GrisolaFriend
Messages: 27
Registered: November 2017
Junior Member
Thanks for a quick reply. I think there's a missed representation of key(:master) value with the SQL error logs because when a try to execute the SQL statement provided on the error logs and replace the :master key with is value say a "null" on the PostgreSQL, it works fine and provided a results.

Error logs sql statement:
SELECT ID, TITLE
FROM SAM
WHERE 1 = 1 AND (:master IS NULL OR ID = :master)


Replacing master key with its value: null based on the error log message:
SELECT ID, TITLE
FROM SAM
WHERE 1 = 1 AND (null IS NULL OR ID = null)
--> this sql statement works fine on PosgreSQL.

Replacing master key with a value: null:varchar. Identifying possible actual value of master key:
SELECT ID, TITLE
FROM SAM
WHERE 1 = 1 AND (null::varchar IS NULL OR ID = null::varchar)
--> ERROR: operator does not exist: integer = character varying LINE 7: COMCATID = null::varchar ) ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts.

So, may be if a master field is not provided the master key will have a default value of: null::varchar or null::char, the two value will provide the same error messages.

The error just disappeared when i added one field(smart field) on the form (type Long) and make it a master field of the listbox for lookup call and set it as mandatory.

Again, thanks you very much for a quick reply i was really waiting for someone to fetch some idea on the possible cause of the error..

sincerely,

mark




Previous Topic:Form closing icon (X) presentation also for inactive forms
Next Topic:SSL for Jetty
Goto Forum:
  


Current Time: Fri Apr 26 19:21:23 GMT 2024

Powered by FUDForum. Page generated in 0.03149 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top