Page 1 of 1

Error while uploading to Sql server

Posted: Wed Dec 01, 2010 9:40 pm
by vinnusea
Trying to Load Cube View to a Sql Server table

All varibles are defined as "String" and as "Other"
Except vrate is defined as Numeric

odbcoutput( sDSNODBC , Expand('Insert Into [Test].[dbo].ExchangeRate (Version,Type,Month,From,To,Rate) '|'
Values
(''%vversion%'',''%vtype%'',''%vmonth%'',''%vfrom%'',''%vto%'',%vrate%)'));


Getting Error

"Actuals","01-2010","EUR","EUR","FX Type 1","1.",Data Source line (1) Error: Data procedure line (10): Error executing SQL query: "Insert Into [Test].[dbo].ExchangeRate (Version,Type,Month,From,To,v) Values('Actuals','FX Type 1','EUR','01-2010','EUR',1.)"

or sometimes getting error if i use a sql query and approach it
Error executing SQL query: "..."
Can any 1 say me what mistake am doing?

Re: Error while uploading to Sql server

Posted: Thu Dec 02, 2010 12:12 am
by Martin Ryan
What happens if you go directly into your database and paste in
Insert Into [Test].[dbo].ExchangeRate (Version,Type,Month,From,To,v) Values('Actuals','FX Type 1','EUR','01-2010','EUR',1.)
to the SQL editor? Do you get an error? If so there is something wrong with your SQL. If not, then there's something wrong with your ODBCOpen statement in TI (have you got an ODBCOpen statement in TI?).

If there is no SQL error and the ODBCOpen is ok, then please post your TI code.

Martin

Re: Error while uploading to Sql server_Defining Varible

Posted: Thu Dec 02, 2010 1:22 am
by vinnusea
Thanks Martin for the reply..
I dont know what is the error but i kept on re writing the COde and now its running good ..

But Can you tell me how to pass a varible value into a parameter so that i can insert that parameter into a column in Sql table

Issue:

Taking a Cube View as Source and it is having varibles V1,V2,V3,V4,V5 DEFINED and now i have Col1,Col2,Col3,Col4,Col5,Col6 in Target Table

I need to pass V3 | V4 |V5 |'Rate' (Concatinated) into Col 6

In Prolog i used

scol6input = V3|V4|V5|-|'Rate' ;

In Data Tab:

In Sql Statement :

I used scol6input Then its not trowing any error but the Col6 in Target table is having just "- Rate"
My 3 variables are not showing in the target????

How do i get it

Thanks for your time