cancel
Showing results for 
Search instead for 
Did you mean: 

tinyworld and xsodata on table

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos
494

I transformed the tinyworld example to Cloudfoundry and it works so far. Now I changed a small portion and do not get why this does not work:
I added a xsodata file that works simply on a table and this never works. Here is the content that works:

service {
"tinyworld3.tinydb::myview" as "euro" keys generate local "ID";
}

And here is the one that does not work:

service {
"tinyworld3.tinydb::world" as "world" keys generate local "ID" ;
}

I also can keep out the "keys generated local ID" part.
When calling this, I always get a

"No data found for tinyworld3.tinydb::world table."

Anybody has an idea why that is?

gregorw
Active Contributor
0 Kudos

Hi Benny,

do you use https://github.com/doc-phily/tinyWorld/blob/master/tinydb/src/tinyf.hdbcds for your entities or can you share your definition?

Best regards
Gregor

Accepted Solutions (0)

Answers (2)

Answers (2)

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Found the solution:

to call just a table I need schema name AND table as this:

service { 
  "tinyworld3.tinydb::myview" as "euro" keys generate local "ID"; 
  "tinyworld3.tinydb::tinyf.world" as "world" ;
}

So now the view works and the table too.

Thanks for trying to help!

With kind regards,

Benny

SergioG_TX
Active Contributor
0 Kudos

great to hear... and yes ... tables belong to a schema... while views are just objects in the package. good catch

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Gregor,

as I used WebIDE it looks a little bit different, but that should be only for the editor:

namespace tinyworld3.tinydb;

context tinyf {
    /*@@layout{"layoutInfo":{"x":-135,"y":-41}}*/
    entity world {
        key continent : String(100);
    };

    /*@@layout{"layoutInfo":{"x":-405,"y":-139.5}}*/
    entity country {
        name    : String(100);
        part_of : association[0..1] to world { continent };
    };
};


Regards,

Benny

SergioG_TX
Active Contributor
0 Kudos

are you able to query this table from your sql console? if so, then have you tried copying the name of that table as is from your sql console.. as you already know, make sure there is a key defined for the table.

does you table have data? if not, add a simple record just to test it out.

alternatively, create a separate xsodata file and try again with a simple example and the build up from there