ODBC drive error for Oracle database
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
ODBC drive error for Oracle database
Hi,
I want see the flow how to fetch data from Oracle to TM1 and how to load data from TM1 to back to Oracle [ Oracle->TM1 and TM1->Oracle]
I have tried to load data into dept table in oracle from TM1. The procedure I have tried is,
1) Established ODBC driver.
2) In TI selected odbc source, datasource is orcl, given user name and password and written query is select * from dept. I got data with deptno,dname,loc.
3) Mapped this to dimension with the the same names and created cube with this dimensions as Oracle.
4) Entered data in the cube and saved as default view.
5) Again in TI selected source as TM1 cube view and followed the procedure and written in Metadata tab as shown in the below figure and got error as shown in it.
Please guide me with suggestion and ideas for my requirement.
Thanks and regards
TM1 9.5.2
excel 2007
I want see the flow how to fetch data from Oracle to TM1 and how to load data from TM1 to back to Oracle [ Oracle->TM1 and TM1->Oracle]
I have tried to load data into dept table in oracle from TM1. The procedure I have tried is,
1) Established ODBC driver.
2) In TI selected odbc source, datasource is orcl, given user name and password and written query is select * from dept. I got data with deptno,dname,loc.
3) Mapped this to dimension with the the same names and created cube with this dimensions as Oracle.
4) Entered data in the cube and saved as default view.
5) Again in TI selected source as TM1 cube view and followed the procedure and written in Metadata tab as shown in the below figure and got error as shown in it.
Please guide me with suggestion and ideas for my requirement.
Thanks and regards
TM1 9.5.2
excel 2007
- Attachments
-
- cube.JPG (37.56 KiB) Viewed 11518 times
-
- ODBC.JPG (133.73 KiB) Viewed 11518 times
- qml
- MVP
- Posts: 1098
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: ODBC drive error for Oracle database
Hint: what is the SQL command to insert a row into a table? You need to submit a valid SQL statement there, that's it. Also, make sure you use ODBCOpen() and ODBCClose() in your Prolog and Epilog, respectively.charan wrote:Please guide me with suggestion and ideas for my requirement.
Kamil Arendt
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
TM1 load ODBC
Hi I am trying to load TM1 data into Oracle database.
My requirement is to load TM1 data into Oracle database. I have tried with the functions ODBCOpen in prolog tab, ODBCOutput in Data tab and ODBCclose in epilog tab.
Please find the attachment for the flow what I have tried. My doubt here is what is the source I should take in loading data from TM1 to oracle, I have to select source as orcl or cube view. please guide me.
TM1 9.5.2
excel 2007
My requirement is to load TM1 data into Oracle database. I have tried with the functions ODBCOpen in prolog tab, ODBCOutput in Data tab and ODBCclose in epilog tab.
Please find the attachment for the flow what I have tried. My doubt here is what is the source I should take in loading data from TM1 to oracle, I have to select source as orcl or cube view. please guide me.
TM1 9.5.2
excel 2007
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
Re: TM1 load ODBC
sorry here is the attachment
- Attachments
-
- TM1_Load_ODBC.docx
- (367.41 KiB) Downloaded 555 times
-
- Site Admin
- Posts: 1458
- Joined: Wed May 28, 2008 9:09 am
Re: TM1 load ODBC
Okay....
Since you are _reading_ data from TM1 and _writing_ it to Oracle, your data _source_ needs to be a TM1 view.
And your insert query has quotes (') inside quotes - you need to 'escape' the quotes ie to get ' in the output, write ''' in the script. (This isn't especially a TI issue, many other scripting environments do this)
And finally, to validate your SQL command line, the best way is to replace ODBCOUTPUT(orcl, by ASCIIOUTPUT('test.txt',
and inspect/test the generated command against your relational engine - this should sort out any issues.
Since you are _reading_ data from TM1 and _writing_ it to Oracle, your data _source_ needs to be a TM1 view.
And your insert query has quotes (') inside quotes - you need to 'escape' the quotes ie to get ' in the output, write ''' in the script. (This isn't especially a TI issue, many other scripting environments do this)
And finally, to validate your SQL command line, the best way is to replace ODBCOUTPUT(orcl, by ASCIIOUTPUT('test.txt',
and inspect/test the generated command against your relational engine - this should sort out any issues.
- qml
- MVP
- Posts: 1098
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: TM1 load ODBC
Charan, why can't you continue asking questions on this subject in your original thread? There really is no reason to multiply threads like that. It's for your own benefit - you will not have to explain your circumstances all over again.
Edit: thanks to Admins for merging both threads.
Edit: thanks to Admins for merging both threads.
Kamil Arendt
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
Re: ODBC drive error for Oracle database
sure qml, hereafter i will do that,
Hi Now I tried the same thing but now Iam getting syntax error as shown in the document please refer it.
Hi Now I tried the same thing but now Iam getting syntax error as shown in the document please refer it.
- Attachments
-
- TM1_Load_ODBC.docx
- (367.41 KiB) Downloaded 453 times
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: ODBC drive error for Oracle database
That's because you have to use special handling for apostrophes when creating an SQL statement in a TI as the apostrophe is also a text delimiter for TM1. See this http://www.tm1forum.com/viewtopic.php?f=3&t=830.charan wrote:sure qml, hereafter i will do that,
Hi Now I tried the same thing but now Iam getting syntax error as shown in the document please refer it.
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
Re: ODBC drive error for Oracle database
Hi Tomok,
Thank you, but still I am facing an error.
My exact requirement is, I want load a row/column in the dept table of oracle database. Thats what I am trying please correct me if anything is wrong.
I tried with your suggestion but I am facing an error, please find the attachment for the comment of the error.
Thank you, but still I am facing an error.
My exact requirement is, I want load a row/column in the dept table of oracle database. Thats what I am trying please correct me if anything is wrong.
I tried with your suggestion but I am facing an error, please find the attachment for the comment of the error.
- Attachments
-
- apostrophes.JPG (199.99 KiB) Viewed 11425 times
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
Re: ODBC drive error for Oracle database
Hi Tomok,
Even if use four quotes like ''''|Manufacturing|'''' still I face the same error.
Even if use four quotes like ''''|Manufacturing|'''' still I face the same error.
-
- MVP
- Posts: 3241
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.1.5
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: ODBC drive error for Oracle database
Please use the function ASCIIOUTPUT or TEXTOUTPUT to investigate your exact sQL query.
Obviously you are having problems with ' and " characters.
Obviously you are having problems with ' and " characters.
Best regards,
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
Re: ODBC drive error for Oracle database
Hi Wim,
I did not get you exactly, what you are suggesting me, I tried with Textoutput function and getting all the odbc cube data in CSV file exactly, but I did not get how to put in ODBCOutput function. Help me in this.
Thank you
I did not get you exactly, what you are suggesting me, I tried with Textoutput function and getting all the odbc cube data in CSV file exactly, but I did not get how to put in ODBCOutput function. Help me in this.
Thank you
- Michel Zijlema
- Site Admin
- Posts: 713
- Joined: Wed May 14, 2008 5:22 am
- OLAP Product: TM1, PALO
- Version: both 2.5 and higher
- Excel Version: 2003-2007-2010
- Location: Netherlands
- Contact:
Re: ODBC drive error for Oracle database
What Wim meant is that you can write the generated query text to a text file so that you can see what the generated query statement looks like. But, as shown in the screenshot above, you can also see this in the generated error message - and as you can read from there the generated code is far from correct SQL...charan wrote:Hi Wim,
I did not get you exactly, what you are suggesting me, I tried with Textoutput function and getting all the odbc cube data in CSV file exactly, but I did not get how to put in ODBCOutput function. Help me in this.
Thank you
When you have trouble with the quote character you could use a variable for this and use this variable on the places where you would like to see the single quote in the generated SQL statement. This way your statement should look something like this:
Code: Select all
v_qt = Char(39);
ODBCOutput('orcl', 'Insert Into dept (DEPTNO, DNAME, LOC) values (50, ' | v_qt | 'Manufacturing' | v_qt | ', ' | v_qt | 'SiliconValley' | v_qt | ')');
Michel
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
Re: ODBC drive error for Oracle database
Hi Michel,
Thank you, but still error is the same.
Thank you, but still error is the same.
- Attachments
-
- ODBC.JPG (81.03 KiB) Viewed 11400 times
- Michel Zijlema
- Site Admin
- Posts: 713
- Joined: Wed May 14, 2008 5:22 am
- OLAP Product: TM1, PALO
- Version: both 2.5 and higher
- Excel Version: 2003-2007-2010
- Location: Netherlands
- Contact:
Re: ODBC drive error for Oracle database
The SQL looks better now - maybe you could add a space after the commas in (DEPTNO, DNAME, LOC).charan wrote:Hi Michel,
Thank you, but still error is the same.
Perhaps the dept table needs to have a schema identifier. And is the DEPTNO column indeed a numeric type column and the other 2 (var)char type?
Michel
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
Re: ODBC drive error for Oracle database
Hi Michel,
Thank you, I have used only '' value'' this is the syntax I used after Values in the statement and row updated in emp table but the issue is it has updated many times nearly 100 times. I have ran TI only 5 times.
Any suggestion for why the same row updated many times.
Thank you, I have used only '' value'' this is the syntax I used after Values in the statement and row updated in emp table but the issue is it has updated many times nearly 100 times. I have ran TI only 5 times.
Any suggestion for why the same row updated many times.
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: ODBC drive error for Oracle database
How many cube intersections are in the view you are using as a data source for this process. You are going to get a new row in the database for each intersection every time you run the process. The INSERT command does not look to see if you already have a row in the table for that intersection, it creates a new row every time.
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
Re: ODBC drive error for Oracle database
Hi Tomok,
Thank you, but what is the syntax to load cube view data(for example we have 20 rows of data in Cube view)into oracle at a time.
Intially what I was trying is updating only one row.
Thank you, but what is the syntax to load cube view data(for example we have 20 rows of data in Cube view)into oracle at a time.
Intially what I was trying is updating only one row.
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: ODBC drive error for Oracle database
It doesn't exist. Using a cube view as a data source in a TI process will create one record for each intersection in the cube. If your view is configured to suppress zeroes then there will be one record for each non-zero intersection. Putting the INSERT code in the data tab will mean a single INSERT command will be executed for each record. This is exactly what you should want.charan wrote:but what is the syntax to load cube view data(for example we have 20 rows of data in Cube view)into oracle at a time.
-
- Posts: 148
- Joined: Tue Nov 23, 2010 9:04 am
- OLAP Product: cognos tm1
- Version: 9.5
- Excel Version: 2007
Re: ODBC drive error for Oracle database
Hi Tomok,
please find the attachment what I am trying to do. Image is the table I created for loading cube view data. I want all cube view data into the table.
please suggest my syntax where I am getting error after Values statement.
Thanking you
please find the attachment what I am trying to do. Image is the table I created for loading cube view data. I want all cube view data into the table.
please suggest my syntax where I am getting error after Values statement.
Thanking you
- Attachments
-
- image001.JPG (303.26 KiB) Viewed 11351 times
-
- ODBC functions.docx
- (135.1 KiB) Downloaded 372 times