OclPS Translation to SQL brings error

CapableObjects Forums SupportForum OclPS Translation to SQL brings error

This topic contains 4 replies, has 2 voices, and was last updated by  Admin 3 days ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #5230 Score: 0

    efim
    Participant

    Hi,

    I wonder why is it so silently here for a long time?
    Anyway I have a problem:

    Giving a rather complex OclPS expression (s. Attachment) I get SQL error “Error handling query: Parameter reused “P0ID0″” The database is Firebird.

    Please see Attachment for details

    Attachments:
    You must be logged in to view attached files.
    #5233 Score: 0

    efim
    Participant

    I have figured out the error appears if I use self or ocl variable context.
    If I substitute any instance instead e.g. instead of self Geraet.allInstances->select(Id = someId) it works!

    #5239 Score: 0

    Admin
    Keymaster

    I take it the thing that was the problem was this construction:
    self.Something->select(stuff)->union( self.Something->select(otherstuff))

    And if that was so – I would guess that the error comes from the double use of self.Something. Correct do you think?

    And that when you got it working you did something like this instead:

    vTheSomething->select(stuff)->union( vTheSomething->select(otherstuff))

    Right?

    #5240 Score: 0

    efim
    Participant

    Hi Hans,
    self.Something->select(stuff)->union( self.Something->select(otherstuff))
    I think it is correct this construction doesn”t work

    But I think this construction
    vTheSomething->select(stuff)->union( vTheSomething->select(otherstuff))

    doesn”t work either.

    It was working for me if only I used selection on id to identify the context instance instead of self or oclvar like this:
    self SomeClass.allInstances->select(someUniqueIdAttr = someId)

    #5241 Score: 0

    Admin
    Keymaster

    Is this a correct description of the error do you think:

    When the sent in values to act on must be treated as a list – and you do this twice in one expression – generating sql that is dependent on number of items in the list – then you we get this error?

    (a1,a2,a3)->select()->union((a1,a2,a3)->select())

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Comments are closed.