2014-09-22 3 views
0

Ниже приведен мой код, который должен добавить столбец описания в Spotfire. Он хорошо работает в Microsoft SQL. Как я должен написать его в Spotfire?Ошибка при вставке Описание Столбец

SELECT 
    v1."DateTime" AS "DISCRETELIVEDATETIME", 
    v1."TagName" AS "DISCRETELIVETAGNAME", 
    v1."Value" AS "DISCRETELIVEVALUE", 
    v2.Description AS "DESCRIPTION" 
FROM 
    "Runtime"."dbo"."v_DiscreteLive" v1 
INNER JOIN [Runtime].[dbo].Tag v2 ON v1.TagName = v2.TagName 

Вышеуказанный код, который я сделал, который дает мне ошибку ниже.

Error message: Failed to execute data source query. 

ImportException at Spotfire.Dxp.Data: 
Failed to execute data source query. (HRESULT: 80131500) 

Stack Trace: 
    at Spotfire.Dxp.Data.DataSourceConnection.ExecuteQuery2() 
    at Spotfire.Dxp.Data.DataFlow.Execute() 
    at Spotfire.Dxp.Data.DataFlow.DataFlowConnection.ExecuteQueryCore2() 
    at Spotfire.Dxp.Data.DataSourceConnection.ExecuteQuery2() 
    at Spotfire.Dxp.Data.Producers.SourceColumnProducer.<>c__DisplayClass11.<GetColumnsAndProperties>b__e() 
    at Spotfire.Dxp.Framework.ApplicationModel.Progress.ExecuteSubtask(String title, ProgressOperation operation) 
    at Spotfire.Dxp.Data.Producers.SourceColumnProducer.GetColumnsAndProperties(DataSourceConnection connection) 
    at Spotfire.Dxp.Data.Persistence.DataItem.PerformUpdate(SourceColumnProducer producer, DataSourceConnection connection) 
    at Spotfire.Dxp.Data.Persistence.DataItem.Update(SourceColumnProducer producer, DataSourceConnection connection) 
    at Spotfire.Dxp.Data.Persistence.DataPool.<LoadData>d__1.MoveNext() 
    at Spotfire.Dxp.Data.Producers.SourceColumnProducer.<Refresh>d__0.MoveNext() 
    at Spotfire.Dxp.Data.DataTable.<>c__DisplayClass66.<>c__DisplayClass69.<BeginRefresh>b__62() 
    at Spotfire.Dxp.Framework.DocumentModel.Node.Spotfire.Dxp.Framework.DocumentModel.INode.InternalTransaction(Executor executor) 
    at Spotfire.Dxp.Data.DataTable.<>c__DisplayClass66.<BeginRefresh>b__60() 
    at Spotfire.Dxp.Framework.Commands.CommandHistory.Transaction(Executor executor, Boolean visible, Boolean sticky, Guid stickyGuid) 
    at Spotfire.Dxp.Framework.Commands.CommandHistory.StickyTransaction(Guid guid, Executor executor) 
    at Spotfire.Dxp.Framework.DocumentModel.DocumentNode.StickyTransaction(Guid guid, Executor executor) 
    at Spotfire.Dxp.Framework.DocumentModel.DocumentNode.Spotfire.Dxp.Framework.DocumentModel.ITransactions.ExecuteStickyTransaction(Guid guid, Executor executor) 
    at Spotfire.Dxp.Data.DataTable.BeginRefresh(Boolean showDataLoadReport) 
    at Spotfire.Dxp.Data.DataTable.Refresh(Boolean showDataLoadReport) 
    at Spotfire.Dxp.Data.DataTableCollection.RefreshProducers(IEnumerable`1 tablesToRefresh, Boolean showDataLoadReport) 
    at Spotfire.Dxp.Data.DataTableCollection.Refresh(IEnumerable`1 tablesToRefresh) 
    at Spotfire.Dxp.Forms.Data.DataFormsUserActions.<>c__DisplayClassc.<RefreshData>b__a() 
    at Spotfire.Dxp.Forms.Application.FormsProgressService.ProgressThread.DoOperationLoop() 


InformationModelException at Spotfire.Dxp.Data: 
Failed to execute query: Incorrect syntax near 'v2'. (HRESULT: 80131500) 

Stack Trace: 
    at Spotfire.Dxp.Data.InformationModel.InternalInformationModelManager.DataStream.GetNextBlock() 
    at Spotfire.Dxp.Data.InformationModel.InternalInformationModelManager.DataStream.Read(Byte[] buffer, Int32 offset, Int32 count) 
    at Spotfire.Dxp.Internal.Utilities.SeekableStream.Read(Byte[] buffer, Int32 offset, Int32 count) 
    at System.IO.BinaryReader.FillBuffer(Int32 numBytes) 
    at System.IO.BinaryReader.ReadUInt16() 
    at Spotfire.Dxp.Data.Formats.Sbdf.SbdfSectionHeader.ReadSectionType(BinaryReader reader, SbdfSectionTypeId expectedType) 
    at Spotfire.Dxp.Data.Import.SbdfDataRowReader.DelayedInit() 
    at Spotfire.Dxp.Data.Import.InformationLinkDataSourceConnection.ExecuteQueryCore2() 
    at Spotfire.Dxp.Data.DataSourceConnection.ExecuteQuery2() 


InformationModelServiceException at Spotfire.Dxp.Services: 
Failed to execute query: Incorrect syntax near 'v2'. (HRESULT: 80131509) 

Stack Trace: 
    at Spotfire.Dxp.Services.WebServiceBase`1.InvokeService[T](ServiceMethod`1 serviceMethod, ExceptionFactoryMethod exceptionFactoryMethod) 
    at Spotfire.Dxp.Data.InformationModel.InternalInformationModelManager.DataStream.GetNextBlock() 
+1

Почему вы переходите от помещения объекта в «кавычки» к помещению их в [скобки]? Я не знаю Spotfire, но я подозреваю, что это ваша проблема - SQL Server допускает, но Spotfire, вероятно, этого не делает. Dunno, если вам нужно использовать 'v2. 'Описание" 'в выбранной части тоже – Rhumborl

+0

Я хотел бы узнать больше о том, как вы выполняете этот запрос в Spotfire. Используете ли вы конструктор информации или работаете в базе данных? Если бы вы могли опубликовать скриншот, возможно, я мог бы помочь. – AmbivalentGeek

+0

какую версию Spotfire вы используете? – giZm0

ответ

0

Я думаю, проблема в том, что вы меняете запрос sql. Я думаю, что вы можете только добавить предложение where. Если вы хотите добавить столбец, вы должны смоделировать его в дизайнере информации.