on ‎2023 Dec 15 4:27 PM
Request clarification before answering.
Hello,
Sorry for not getting back to you sooner. I tried to create the HIS_TUKIN table with the schema. But it always fails with the following error.
"sql syntax error: incorrect syntax near: line 5 col 21 (at pos 136)"
If I remove all CS_ types, I can create the table and scaffold code for it.
Which server version are you using? Do you know of any configuration settings which can enable the use of CS_ types?
Kind regards,
Minghai Chang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Haii it's me again. I tried scaffold with --schema option, and i think it's work because i found new error.

When i searched there's only one with column 'ID_HIS_TUKIN'

# Here's detail data
SCHEMA_NAME : TDES
TABLE_NAME : HIS_TUKIN
TABLE_OID : 1,270,955
COLUMN_NAME : ID_HIS_TUKIN
POSITION : 1
DATA_TYPE_ID : 12
DATA_TYPE_NAME : VARCHAR
OFFSET : 72
LENGTH : 32
SCALE : [NULL]
IS_NULLABLE : FALSE
DEFAULT_VALUE : SYSUUID
COLLATION :
COMMENTS : [NULL]
MAX_VALUE : [NULL]
MIN_VALUE : [NULL]
CS_DATA_TYPE_ID : 83
CS_DATA_TYPE_NAME : STRING
DDIC_DATA_TYPE_ID : 32
DDIC_DATA_TYPE_NAME : INVALID
COMPRESSION_TYPE : DEFAULT
INDEX_TYPE : FULL
COLUMN_ID : 1,294,853
PRELOAD : FALSE
GENERATED_ALWAYS_AS : [NULL]
HAS_SCHEMA_FLEXIBILITY : FALSE
FUZZY_SEARCH_INDEX : FALSE
FUZZY_SEARCH_MODE : [NULL]
MEMORY_THRESHOLD : [NULL]
LOAD_UNIT : DEFAULT
GENERATION_TYPE : [NULL]
IS_CACHABLE : FALSE
IS_CACHE_KEY : FALSE
ROW_ORDER_POSITION : [NULL]
IS_HIDDEN : FALSE
IS_MASKED : FALSE
MASK_EXPRESSION : [NULL]
CLIENTSIDE_ENCRYPTION_STATUS : [NULL]
CLIENTSIDE_ENCRYPTION_COLUMN_KEY_ID : [NULL]
CLIENTSIDE_ENCRYPTION_MODE : [NULL]
PERSISTENT_MEMORY : [NULL]
NUMA_NODE_INDEXES : [NULL]
# Here;s DDL from the table HIS_TUKIN

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not problem with only CLI. i'm just want tell when using ado.net we can scaffold by schema so several table can be generated at once, and don't have problem anything.
What my problem is 'Can i scaffold using --schema options'. Because when i use --schema options, it's say 'Hana doesn't support schema'

Unfortunately I can't post the entire schema, because it's written in my contract not to post anything.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Unfortunately, the EF Core scaffolding only has command line options. It doesn't has GUI tool. Is it possible to use the combination of schemas and tables to scaffold your model? I mean you could add the referenced tables using table options. Could you post the schema of REF_SSBP table so we can test it?
Kind regards.
Minghai Chang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But if i use 3rd example, that means i must set --table for each table? isn't that inefficient? i mean in this project we have tables more than 100.

Table that mention in error are in the same schema, i think why error occurs because class model for table not generated, that's why i need scaffold using 'schema'.
# table REF_SSBP of course have Primary Key

---------------------------
Disclaimer
this is the old system that need rejuvenate, previously we use ADO.NET at .NET Framework for scaffold model. but since .NET Core / .NET has launched we must change everything that related to .NET Framework to .NET Core / .NET.
At ADO.NET we can select the schema we want to scaffold. Since it's using Gui we just checked the checkbox of schema name and click button okey at visual studio.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Yes, you can just specify several tables to scaffold the model (e.g. the 3rd example).
The first error looks like some tables are owned by different schemas. The second error looks like REF_SSBP table doesn't have primary key.
Kind regards,
Minghai Chang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
but if i use 3rd example, that means i must set --table for each table? isn't that inefficient? i mean in this project we have tables more than 100.

table that mention in error are in the same schema, i think why error occurs because class model for table not generated, that's why i need scaffold using 'schema'.
table REF_SSBP of course have Primary Key

------------
Disclaimer
this is the old system that need rejuvenate, previously we use ADO.NET at .NET Framework for scaffold model. but since .NET Core / .NET has launched we must change everything that related to .NET Framework to .NET Core / .NET.
At ADO.NET we can select the schema we want to scaffold. Since it's using Gui we just checked the checkbox of schema name and click button okey at visual studio.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
We have fixed some issues related to EF Core Scaffolding. Can you please try the latest HANA Client?
Kind regards,
Minghai Chang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i'm using .NET 7.
For SAP Client -> Sap.Data.Hana.Core.v2.1 and Sap.EntityFrameworkCore.Hana.v7.0.
1. dotnet ef dbcontext scaffold "Server=<my-server:30015>;uid=<uid>;pwd=<pwd>r;Current Schema=DEMO" Sap.EntityFrameworkCore.Hana.v7.0

2. dotnet ef dbcontext scaffold "Server=<my-server:30015>;uid=<uid>;pwd=<pwd>" Sap.EntityFrameworkCore.Hana.v7.0 --schema DEMO --schema SYSTEM

3. dotnet ef dbcontext scaffold "Server=<my-server:30015>;uid=<uid>;pwd=<pwd>" Sap.EntityFrameworkCore.Hana.v7.0 --table Blogs --table Posts

for the first and second methods it keeps getting stuck, for the third method it works but not as expected.
The DbContext generated but Model for table not generated.
It's there way to scaffold for the schemas? because if using --table option, i must scaffold one per one each table and it's using to much time
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.