System.Data.Entity.DbFunctions.TruncateTime not found in LINQPad 5 - linq

I have done a LINQ query in LINQPad 5. In the where clause of this query I am using System.Data.Entity.DbFunctions.TruncateTime function on a DateTime data type in order to remove the time.
For some reason LINQPad is not recognizing System.Data.Entity.DbFunctions.TruncateTime despite of I have added the reference System.Data.Entity.dll in Additional references tab in LINQPad:
LINQPad show below error:
CS0234: The type of namespace name 'DbFunctions' does not exist in the
namespace 'System.Data.Entity.dll'(are you missing an assembly
reference?)
What am I doing wrong?

Related

Error ORA-00904 while having Faceted Search With multiple facets search Items

I am using APEX 21.1 and I am facing the below error while running a page having two regions (Faceted Search and Classic Report) :
Error in Page:
Ajax call returned server error ORA-00904: "APPS"."HR_API": invalid identifier for .
Error in Debug:
APEX - Column Gender, referenced by facet P24_G, is not available or unauthorized. - Contact your application administrator. ORA-06512: at "APEX_210100.WWV_FLOW_ERROR", line 1370 ORA-06512: at "APEX_210100.WWV_FLOW_ERROR", line 1405
The error is happening only when I am adding more than one facet item in the Faceted Search.
Can anyone let met know is if it is a bug or not?
Note that I am using a DB view from a different Schema in the Classic Report.
The solution for this error since I am using a DB view in a different schema in my classic report
Oracle Answer:
with views or objects in other schemas, it often helps to rewrite the
report query to use the MATERIALIZE hint, e.g. as follows:
with myquery as (
select /*+ MATERIALIZE */ {your query}
)
select * from myquery

Laravel Excel Error with SQ Server. Error converting data type nvarchar to bigint

I'm tryin to import and excel file to my SQL Server Database but when I try to create the form to upload the file I get this error:
Illuminate\Database\QueryException
SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Error converting data type nvarchar to bigint. (SQL: select top 1 * from [schedules] where [schedules].[id] = import)
Screenshoot of error
Even when I have the function in the controller it throws this error. Seems that is trying to get 1 record from database but cannot pass the nvarchar to match the ID column.
I have checked the documentation and nothing. Made it a few times, different methods with same error.
Seems that I figured it out. It was problem with the routing calling de show function
I had the same issue and trying to find the solution came upon this question. Thankfully I read the comments as Fernando's solution was also mine.
This was caused by a misordered Route in web.php
Route::Get('label/{label}' ...
...
Route::Get('label/create' ...
I swapped the order and all fixed
Route::Get('label/create' ...
...
Route::Get('label/{label}' ...

oracle ref() ora-00904 invalid column name

apparently there are many ora-00904 errors out there, but I can't find similar case with mine.
my case is related to ref() function in oracle: https://docs.oracle.com/cloud/latest/db112/SQLRF/functions145.htm#SQLRF00694
according to the example in the link above, you can query like below without problem:
select ref(x) from some_table x
but what I get is error ora-00904 invalid column name and it highlighted the x in ref(x)
I can't remove the ref() function from my query as it is added automatically by oracle forms.
Anyone have similar experience? is there some settings to set?
BTW, I am using an ancient oracle form 6i on top of oracle 8i
The ref() function is used in conjunction with user defined types; hence the table alias used by the function needs to refer to a table of a user defined type.

Type inacurracy

I'm trying to create Entity Data Model using Visual Studio 2012 and Oracle 10g.
I'm getting this error:
Error 1 Running transformation: The types of all properties in the
Dependent Role of a referential constraint must be the same as the
corresponding property types in the Principal Role. The type of
property 'QUARTAL_SEC_ID' on entity 'Model.QUARTAL' does not match the
type of property 'SEC_ID' on entity 'Model.SEC' in the referential
constraint 'FK_QUARTAL_SEC_ID'.
Indeed sec_id has number(32) and quartal_sec_id - number(10) in the database. I can't change it there.
I have changed both types in mapping details in VS12 to int32. But it doesn't help.
Is it possible to solve this problem in VS12? Can I force it to accept different values in foreign keys?
I can't map number(10) (ORA) to decimal(VS) cause will get additional err:
Error 2 Error 2019: Member Mapping specified is not valid. The type
'Edm.Decimal[Nullable=False,DefaultValue=,Precision=,Scale=]' of
member 'QUARTAL_SEC_ID' in type 'Model.QUARTAL' is not compatible with
'OracleEFProvider.number[Nullable=False,DefaultValue=,Precision=10,Scale=0]'
of member 'QUARTAL_SEC_ID' in type 'Model.Store.QUARTAL'.
I am currently using EF 5 with Oracle and for number types we have our entity properties set as decimals.
This article outlines the data types.

problem with SQL CE and orderby linq clause

I am using linq with SQL CE, but for a simple query like this:
var points=from i in this.DomainBoundaryPoints orderby i.Index select i;
I get this error:
Could not find an implementation of the query pattern for source type 'System.Data.Linq.EntitySet<DAL.DomainBoundaryPoint>'. 'OrderBy' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?
Does SQL CE support 'order by' TSQL clause? Where is the problem?
Of course SQL CE supports orderby...
Try to do what the error message tells you...
add a reference to System.Core if it's not there
add a using directive for System.Linq

Resources