Page 1 of 1

Exportcube from Tm1 to Oracle Table

Posted: Fri Dec 09, 2016 10:55 pm
by NewtoTm1
Hi All, I am totally new to Tm1 so I am here to get your help. I am using the below code to export the cube from Tm1 to Oracle. Everything is working fine but I am getting an error 'Quoted string not properly terminated' I found out the reason as well on why I am getting that error and that's because the variable Topic ( which you can find below ) has some data in this format- Children's play . I guess the error is happening with the quote in the word children's. Can anyone suggest on how I should go about with this to load the data into Oracle.


ODBCOutput( 'MYDB',Expand( 'Insert into Tablename (Staff_ID,GUID,VYear, VAcademic_Organisation, Course, Staff, STG_Course_Component, VMeetingDate, VStartTime, STG_Event_Id, STG_Class_Section, ITEM,class_Size,Facility,Room_Capacity,Meeting_Date,Start_Time,Finish_Time,Topic,Instructors,Duration_Mins,Duration_Hours,Shared_Meeting,Video_Link_Exclude,Multiple_taught_count,
Linked_lab_exclude,Counts,Contact_Hours,Status,Number_of_instructors,InstructorNames)

VALUES(''%StaffID%'',''%GUID%'',''%VYear%'' ,''%VAcademicOrganisation%'', ''%Course%'', ''%vStaff%'', ''%STG_Course_Component%'', ''%MeetingDate%'',

''%StartTime%'', ''%STG_Event_Id%'', ''%STG_Class_Section%'', ''%ITEM%'',''%classSize%'',''%FacilityID%'',''%RoomCapacity%'',''%VMeetingDate%'',''%VStartTime%'',''%FinishTime%'',''%Topic%'',''%Instructors%'', ''%Durationmins%'',''%Durationhours%'',''%SharedMeetingCount%'',''%VideoLinkExclude%'',''%Multipletaughtcount%''

,''%Linkedlabexclude%'',''%count%'',''%Contacthours%'',''%Status%'',''%NumberofInstructors%'',''%Instructornames%'')'));

Re: Exportcube from Tm1 to Oracle Table

Posted: Fri Dec 09, 2016 11:35 pm
by David Usherwood
This is not a specifically TM1 issue - you are generating an INSERT command using commas, but one of your fields contains commas. Google how to solve that.
For debugging complex SQL in TM1 I find replacing
ODBCOUTPUT('MYDB',
by
ASCIIOUTPUT('test.csv'
and inspecting the output file to be useful.

Re: Exportcube from Tm1 to Oracle Table

Posted: Mon Dec 12, 2016 10:11 am
by NewtoTm1
Thanks much David for your response. I Made it work :).

Re: Exportcube from Tm1 to Oracle Table

Posted: Mon Dec 12, 2016 10:21 am
by David Usherwood
Glad to hear it :)
As a general rule, can you post what you did to fix it? It will help others.