Android Question RDC - Returning alias from MySQL sp is ignored

Discussion in 'Android Questions' started by achtrade, May 8, 2015.

  1. achtrade

    achtrade Active Member Licensed User

    Hello community

    I have a MySQL SP with this sentence:

    select t0.id, t0.Status as `UserStatus`, t1.Status as `PassStatus` from Users t0 inner join Pass t1 on t1.idUser = t0.id;

    In the MySQL Workbench I'm getting the correct info:
    --------------------------------|
    |id | UserStatus | PassStatus|
    |1 | A |A |
    --------------------------------|
    But in the JobDone sub
    Code:
    Dim result As DBResult = reqManager.HandleJob(Job)
    result is getting this:
    id=1, Status=A, null=A

    It's like the alias of the select 'UserStatus' and 'PassStatus' are ignored.

    How can I fix it without modify my tables?

    Thanks.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Try this:
    Add useOldAliasMetadataBehavior=true to the JdbcUrl string.
     
  3. achtrade

    achtrade Active Member Licensed User

    like this ?:

    Code:
    JdbcUrl=jdbc:mysql://localhost/use15?characterEncoding=utf8?useOldAliasMetadataBehavior=true
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Yes.
     
  5. achtrade

    achtrade Active Member Licensed User

    thanks
     
  6. achtrade

    achtrade Active Member Licensed User

    No, it didn't work. I had to change my sp to this:

    select ifnull('-1', '-1') as 'id';
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice