This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, I'm trying to execute a LINQ piece of code using Lightspeed and an Oracle 10g database and I get the following error : "ORA-00972: identifier is too long". It seems a long identifier is generated and i don't know how to adapt my code to prevent this ... The same code is working with my SQLServer local database. My LINQ request looks like this :
Array dataBydayArray = dataByday.ToArray();
and I get the following stack trace : [OracleException: ORA-06550: Ligne 5, colonne 6 : PL/SQL: ORA-00972: l'identificateur est trop long ORA-06550: Ligne 4, colonne 1 : PL/SQL: SQL Statement ignored] Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) +953 Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src) +20 Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior) +3974 Oracle.DataAccess.Client.OracleCommand.System.Data.IDbCommand.ExecuteReader() +108 ..() +13 ..(IUnitOfWork , IDbCommand , ) +412 ..(IUnitOfWork , IDbCommand ) +71 Mindscape.LightSpeed.Data.DataProviderAdapter.(IUnitOfWork , , ProviderOptions ) +82 ..(Query ) +610 Mindscape.LightSpeed.UnitOfWork.Project(Query query) +63 Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.ExecuteImmediate(IUnitOfWork unitOfWork, Type returnType) +840 Mindscape.LightSpeed.Linq.LinqQueryProvider.Execute(Expression expression) +167 Mindscape.LightSpeed.Linq.LinqQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +5 Mindscape.LightSpeed.Linq.LinqQuery`1.GetEnumerator() +18 System.Linq.Buffer`1..ctor(IEnumerable`1 source) +205 System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78 in XXX._Default.Page_Load(Object sender, EventArgs e) in XXX/Default.aspx.cs:120 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +91 System.Web.UI.Control.LoadRecursive() +74 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207 Has someone already experienced this ? Thanks. |
|
|
Sorry an error occured and I created 2 post about this subject .. |
|
|
Oracle has some very, er, teletype-friendly restrictions on how long identifiers can be -- 30 characters I think. It may be that the use of a subexpression is causing us to generate column aliases beyond what Oracle allows. If so you may be able to get around it by avoiding the subexpression (which doesn't seem to be gaining you anything here): var date = transaction.Date_; Failing that, we may need to look at implementing terser aliasing on Oracle. Could you post the generated SQL? You can capture this using: allData.Context.Logger = new TraceLogger(); which will dump the SQL to the Visual Studio Output window. |
|
|
Thanks for your answer. I checked the traces and actually the error comes from the call to a database function in a request. An alias is generated : "TABLENAME.Columnname_FUNCTIONNAME" and of course the alias length is superior at 30 characters. Is there a way to force a short aliases generation ? I could change "TABLENAME" in "T", "Columnname" in "C" but it'll force me to refactor the database schema :( Thanks. |
|
|
It's not currently possible to force a short alias -- we'll have to put an Oracle-specific kludge into the SQL generator. We'll try to get this done asap and will let you know. |
|
|
Thanks ! |
|
|
Hmm, we're having trouble reproducing this problem. Is it possible for you to put together a small but complete console project that exhibits the issue? Don't include the whole model, just a simplified standalone entity, and a query that gives the problem. Thanks! |
|