Entity framework - Issue when using include in Oracle - oracle

I have a problem in Entity Framework using Oracle. I get the error ORA-01792: maximum number of columns in a table or view is 1000.
The particular Linq which throws the error has 5 Include. when using SQL provider it uses only MSL fiels but with Oracle it uses all fields in SSDL which exceeds 1000 columns.
Is there a way to force to use the fiels only in MSL for Oracle ?

Related

How to use Oracle EF Core using Row version

I have migrated a database layer from NHibernate to Oracle EF Core 6.x
The Oracle database is the same.
One of the tables has an integer version column.
How can I get EF to increment the value? Have tried incrementing it on save but this gives me a concurrency exception.
Mapping of the column:
b.Property(x => x.Version).HasColumnName("VERSION").IsRowVersion();
I have also tried a timestamp but not sure what datatype to use in C# and Oracle.
Would also prefer to keep the integer version column. So I can avoid a datamigration.

Oracle capture actual sql statement with column length coming from application which hibernate based

We are trying to capture queries with sub-optimal unexpected column length from code hitting the database where columns defined are of limited length.
How to capture such full queries with column length in Oracle.
example:
Java application with hibernate had a string column defined in hbm without length, this is hitting DB table where that column is defined varchar2(50).
What we were complained is this application is throwing query with varchar2(2000) against the DB, how to capture this full query with column length coming from application ?
Env: Oracle 11g, 12c
Java 1.7 with Hibernate

Crystal Reports not returning data from some Oracle views using Oracle driver

I'm using Crystal Reports 2013 and have Oracle ODAC 32 and 64 bit versions installed. If I create a new report and use the "Oracle Server" data source, I can select from any tables to which I have access. However, I find I retrieve no data from some, not all, views.
The queries work fine in SQL Plus or SQL Developer. The queries retrieve data in Crystal Reports using outdated drivers like OLE DB and ODBC.
I can't find a commonality between the views that do or don't work. All the views I've tested with belong to the same schema. they all involve tables that belong to a third schema -- that is, I log in as USER1, query from a view belonging to USER2, which pulls data from tables belonging to USER2 and USER3. In order to create a view on a table and make that view available to others, Oracle requires SELECT WITH GRANT OPTION permission, which is in place. Again, the queries work fine in other SQL tools.
UPDATE: I've tried logging in as the owner of the views and was unable to query them. I've tried querying the underlying tables as the view owner (user2) and as the Crystal Reports owner (user1). Both users are able to query the underlying tables. The view itself seems to be the problem.
I'm studying the differences between the views that work and the views that don't work. I was optimistic when I found that the views that don't work were all using ORDER BY clauses that referenced column position (ex: ORDER BY 2, 1). I tried rewriting the ORDER BY to use column names. Didn't work. Tried removing the ORDER BY clauses. Didn't work. Back to the drawing board.
I found that the problem was that the Oracle view was using Oracle-specific, non-standard SQL. In addition to the ORDER BY 2, 1 mentioned above, there was an implicit date conversion in the WHERE clause e.g.
WHERE date_col = '01-JAN-2016'
When I added the TO_DATE function:
WHERE date_col = TO_DATE ('01-JAN-2016', 'dd-MON-yyyy')
Crystal Report was able to query the view.

How to use oracle sequence while insert/update in SAS DI 4.8

I'm joining a sybase table and a sas data set to insert/update data using a table loader in oracle. The table ID needs to be loaded using a sequence which resides in oracle. Can you please let me know how to use an oracle sequence to generate a ID column? I tried adding a dummy column to the same oracle table joined it to the result set and tried specifying seqname.nextval in a expression editor but getting an error:
ERROR: Unresolved reference to table/correlation name seqname.
If you need to use this kind of oracle-specific functionality with DI Studio you will need to use a custom code step and write the SQL yourself within a 'proc sql' passthrough statement.
If the code is to be re-used in several places you also have the option to write it as a DI transformation.

create entity with specific list of columns using Entity Framework 5

I've got SQL tables with 100 columns and I've created model for that table.
I am using repositories to query table and I want specific columns (e.g only 10 columns) in my select statement to improve performance.
When I run SQL Server Profiler I can see it select all columns and I ant to avoid that.
Is there any way when DataContext try to query table then it uses entity with specific columns only?
If you are returning entities, they have to be fully-populated with data. If you need to get only certain pieces of data, use a projection.

Resources