Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / OLAP и DWH [игнор отключен] [закрыт для гостей] / SQL2005 Cube/Demension processing problem / 8 сообщений из 8, страница 1 из 1
04.11.2005, 01:02
    #33361331
kornal
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
SQL2005 Cube/Demension processing problem
AS во время процессинга куба или измерения посылает SQL в котором идентификаторы заключены в [].
Код: plaintext
1.
2.
3.
4.
5.
SELECT DISTINCT

      [abs_research_OrigBALDim].[Level1] AS [abs_research_OrigBALDimLevel10_0]

                  FROM [abs_research].[OrigBALDim] AS [abs_research_OrigBALDim]
Некоторые БД считают такой синтакс ошибочным. В то же самое время IS посылает нормальные запросы. Как бороться с таким поведением??
...
Рейтинг: 0 / 0
04.11.2005, 01:14
    #33361337
Mosha
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
SQL2005 Cube/Demension processing problem
Вам надо обеспечить чтобы использовался правильный cartridge для Вашей базы данных. Кстати какая у Вас база данных ?
Для сравнения, вот как выглядят соответсвующий XML для SQL Server и Oracle:

cartridges\sql90.xsl:
Код: plaintext
1.
  <xsl:param name="in_IdentStartQuotingCharacter">[</xsl:param> 
  <xsl:param name="in_IdentEndQuotingCharacter">]</xsl:param> 

cartridges\orcl7.xsl:
Код: plaintext
1.
  <xsl:param name="in_IdentStartQuotingCharacter">"</xsl:param> 
  <xsl:param name="in_IdentEndQuotingCharacter">"</xsl:param> 

Моша
----------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights
...
Рейтинг: 0 / 0
04.11.2005, 01:28
    #33361339
kornal
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
SQL2005 Cube/Demension processing problem
Sybase IQ :) А картриджи эти в 3 директориях сидят - менять все?
...
Рейтинг: 0 / 0
04.11.2005, 01:58
    #33361343
kornal
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
SQL2005 Cube/Demension processing problem
Вот что я сделал:
Из всех 3 дир. убрал все картриджи и оставил только 1 в котором прописано:

<!-- Area of STANDARD parametrizations: these are externally passed -->
<xsl:param name="in_CanUseParams">yes</xsl:param>
<xsl:param name="in_IdentStartQuotingCharacter"></xsl:param>
<xsl:param name="in_IdentEndQuotingCharacter"></xsl:param>
<xsl:param name="in_StringStartQuotingCharacter">'</xsl:param>
<xsl:param name="in_StringEndQuotingCharacter">'</xsl:param>

<!-- Area of CORE parametrizations: These are externally checked -->
<mssqlcrt:provider type="prefix"></mssqlcrt:provider>



Всё равно [] посылаются :(
...
Рейтинг: 0 / 0
14.11.2005, 00:49
    #33375654
Mosha
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
SQL2005 Cube/Demension processing problem
Восстановите пожалуйста все директории как было и скопируйте следующий экспериментальный картридж для Sybase (можно назвать его sybase.xsl):

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" version="1.0" xmlns:mssqlcrt="urn:sql-microsoft-com:sqlcrt" xmlns:mssqldbg="urn:sql-microsoft-com:sqldbg">
	<xsl:output method="xml" indent="yes"/>

	<!-- Area of STANDARD parametrizations: these are externally passed   -->
	<xsl:param name="in_CanUseParams">yes</xsl:param>
	<xsl:param name="in_IdentStartQuotingCharacter"></xsl:param>
	<xsl:param name="in_IdentEndQuotingCharacter"></xsl:param>
	<xsl:param name="in_StringStartQuotingCharacter">N'</xsl:param>
	<xsl:param name="in_StringEndQuotingCharacter">'</xsl:param>
	
	<!-- Area of CORE parametrizations: These are externally checked      -->
	<mssqlcrt:provider type="prefix">Adaptive Server Anywhere</mssqlcrt:provider>

	<mssqlcrt:capabilities>
		<mssqlcrt:supports-datepart-year/>
		<mssqlcrt:supports-datepart-quarter/>
		<mssqlcrt:supports-datepart-month/>
		<mssqlcrt:supports-datepart-dayofyear/>
		<mssqlcrt:supports-datepart-day/>
		<mssqlcrt:supports-datepart-week/>
		<mssqlcrt:supports-datepart-dayofweek/>
		<mssqlcrt:supports-datepart-hour/>
		<mssqlcrt:supports-datepart-minute/>
		<mssqlcrt:supports-datepart-second/>
		<mssqlcrt:supports-datepart-millisecond/>
		<mssqlcrt:supports-multiple-distinct-count/>
		<mssqlcrt:supports-update/>
		<mssqlcrt:supports-insert/>
		<mssqlcrt:supports-subselect/>
		<mssqlcrt:supports-table-alias/>
		<mssqlcrt:supports-column-alias/>
		<mssqlcrt:supports-cast/>
		<mssqlcrt:supports-remote-query/>
		<mssqlcrt:supports-top-clause/>
		<mssqlcrt:supports-union/>
		<mssqlcrt:supports-union-all/>
		<mssqlcrt:supports-fast-writeback>TABLOCK,FIRE_TRIGGERS</mssqlcrt:supports-fast-writeback>
		<mssqlcrt:limit-table-identifier-length> 32 </mssqlcrt:limit-table-identifier-length>
		<mssqlcrt:limit-column-identifier-length> 32 </mssqlcrt:limit-column-identifier-length>

		<!-- Map from MSDAInitialize connection string to SQLOLEDB connection string -->
		<mssqlcrt:remote-connection-string-mappings>
			<mssqlcrt:remote-connection-string-mapping>
				<mssqlcrt:datasource-property>Provider</mssqlcrt:datasource-property>
				<mssqlcrt:remote-property></mssqlcrt:remote-property>
			</mssqlcrt:remote-connection-string-mapping>
			<mssqlcrt:remote-connection-string-mapping>
				<mssqlcrt:datasource-property>Data Source</mssqlcrt:datasource-property>
				<mssqlcrt:remote-property>Server</mssqlcrt:remote-property>
			</mssqlcrt:remote-connection-string-mapping>
			<mssqlcrt:remote-connection-string-mapping>
				<mssqlcrt:datasource-property>Initial Catalog</mssqlcrt:datasource-property>
				<mssqlcrt:remote-property>Database</mssqlcrt:remote-property>
			</mssqlcrt:remote-connection-string-mapping>
			<mssqlcrt:remote-connection-string-mapping>
				<mssqlcrt:datasource-property>User ID</mssqlcrt:datasource-property>
				<mssqlcrt:remote-property>UID</mssqlcrt:remote-property>
			</mssqlcrt:remote-connection-string-mapping>
			<mssqlcrt:remote-connection-string-mapping>
				<mssqlcrt:datasource-property>Password</mssqlcrt:datasource-property>
				<mssqlcrt:remote-property>PWD</mssqlcrt:remote-property>
			</mssqlcrt:remote-connection-string-mapping>
			<mssqlcrt:remote-connection-string-mapping>
				<mssqlcrt:datasource-property>Integrated Security=SSPI</mssqlcrt:datasource-property>
				<mssqlcrt:remote-property>Trusted_Connection=yes</mssqlcrt:remote-property>
			</mssqlcrt:remote-connection-string-mapping>
		</mssqlcrt:remote-connection-string-mappings>
	</mssqlcrt:capabilities>

	<mssqlcrt:schema-classes>
		<mssqlcrt:schema-class>
		    <mssqlcrt:managed-provider>System.Data.OleDb</mssqlcrt:managed-provider>
		    <mssqlcrt:type>Microsoft.DataWarehouse.Design.OleDbSchema, Microsoft.DataWarehouse</mssqlcrt:type>
		    <mssqlcrt:query-designer>
			    <mssqlcrt:type>Microsoft.DataWarehouse.Controls.OleDbQueryDesigner, Microsoft.DataWarehouse</mssqlcrt:type>
		    </mssqlcrt:query-designer>
		</mssqlcrt:schema-class>
		<mssqlcrt:schema-class>
		    <mssqlcrt:managed-provider>System.Data.Odbc</mssqlcrt:managed-provider>
		    <mssqlcrt:type>Microsoft.DataWarehouse.Design.OdbcSchema, Microsoft.DataWarehouse</mssqlcrt:type>
		</mssqlcrt:schema-class>
	</mssqlcrt:schema-classes>
	<!-- Area of internal parametrizations                                -->
	<!-- overrideOfUseParams:
	         yes      = use always parametric queries
	         no       = never use parametric queries
			 nosubsel = use as yes, but not on subselects
			 auto     = use the value of in_CanUseParams to determine     -->
	<xsl:variable name="overrideOfUseParams">auto</xsl:variable>
	<!-- shouldProduceDebug:
	         yes      = produce debug information
	         no       = do not produce debug information                  -->
	<xsl:variable name="shouldProduceDebug">yes</xsl:variable>

	<!-- Area of global variables initializations                         -->
	<xsl:variable name="UseParams">
		<xsl:choose>
			<xsl:when test="normalize-space($overrideOfUseParams) = 'yes' or (normalize-space($overrideOfUseParams) = 'auto' and normalize-space($in_CanUseParams)='yes')">yes</xsl:when>
			<xsl:when test="normalize-space($overrideOfUseParams) = 'nosubsel'">nosubsel</xsl:when>
			<xsl:otherwise>no</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<xsl:variable name="ProduceDebug" select="$shouldProduceDebug"/>
	<xsl:variable name="IdentifierStartQuotingCharacter" select="normalize-space($in_IdentStartQuotingCharacter)"/>
	<xsl:variable name="IdentifierEndQuotingCharacter" select="normalize-space($in_IdentEndQuotingCharacter)"/>
	<xsl:variable name="StringStartQuotingCharacter" select="normalize-space($in_StringStartQuotingCharacter)"/>
	<xsl:variable name="StringEndQuotingCharacter" select="normalize-space($in_StringEndQuotingCharacter)"/>

	<!-- Generated statement packaging                                    -->
	<xsl:template match="/">
		<xsl:element name="Statement">

			<!-- Generate query                                           -->
			<xsl:element name="Text">
				<xsl:apply-templates select="./Statement%af_src_comm_0*[1]"/>
			</xsl:call-template>
		)
		<xsl:if test=".%af_src_comm_1*[2]"/>
				</xsl:call-template>
			)
		</xsl:if>
	</xsl:template>

	<xsl:template match="Update/Target">
		<xsl:apply-templates select="./Table"/>
		SET <xsl:apply-templates select="./ColumnUpdates"/>
	</xsl:template>

	<xsl:template match="Delete/Target">
		<xsl:apply-templates select="./Table"/>
	</xsl:template>

	<xsl:template match="Insert/Target/ColumnUpdates/Assign/SQLColumn[1]">
		<!-- The table name is not printed for LHS of assignments in insert -->
		<xsl:apply-templates select="./Column"/>
	</xsl:template>

	<xsl:template match="Create/ColumnDefinitions/SQLColumn">
		<xsl:apply-templates select="./Column"/>
		<xsl:if test="count(../../Phase) = 0">
			<xsl:apply-templates select="./Type"/>
			<xsl:apply-templates select="./Usage"/>
		</xsl:if>
	</xsl:template>

	<xsl:template match="SQLColumn">
		<xsl:variable name="table">
			<xsl:if test="name(..)!='Count' or name(./Column/*[1]) != 'Asterisk'"><xsl:apply-templates select="./Table"/></xsl:if>
		</xsl:variable>
		<xsl:variable name="column">
			<xsl:apply-templates select="./Column"/>
		</xsl:variable>
		<xsl:choose>
			<xsl:when test="$table = ''">
				<xsl:value-of select="$column"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="concat($table,'.', $column)"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="Create/Database|Drop/Database">
		DATABASE <xsl:apply-templates select="./Name"/>
	</xsl:template>

	<xsl:template match="Table">
		<xsl:call-template name="build-quoted-schema-object"/>
	</xsl:template>

	<xsl:template match="Create/Table|Drop/Table">
		TABLE <xsl:call-template name="build-quoted-schema-object"/>
	</xsl:template>

	<xsl:template match="View">
		<xsl:call-template name="build-quoted-schema-object"/>
	</xsl:template>

	<xsl:template match="Drop/View">
		VIEW <xsl:call-template name="build-quoted-schema-object"/>
	</xsl:template>

	<xsl:template match="Index">
		<xsl:apply-templates select="./Name"/>
	</xsl:template>

	<xsl:template match="Drop/Index">
		INDEX <xsl:apply-templates select="./Name"/>
	</xsl:template>

	<xsl:template match="Column">
		<xsl:apply-templates select="./Asterisk"/>
		<xsl:apply-templates select="./Name"/>
	</xsl:template>

	<xsl:template match="Table/Name|View/Name|Index/Name|Column/Name|Database/Name|Schema">
		<xsl:call-template name="quote-identifier"/>
	</xsl:template>

	<xsl:template match="Usage">
		<xsl:variable name="usage"><xsl:value-of select="."/></xsl:variable>
		<xsl:choose>
			<xsl:when test="$usage = 'Key'">    primary key   </xsl:when>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="OpaqueExpression">
		<xsl:if test="name(..) = 'As' and name(../..) = 'Sources'">
			(
		</xsl:if>
		<xsl:value-of select="."/>
		<xsl:if test="name(..) = 'As' and name(../..) = 'Sources'">
			)
		</xsl:if>
	</xsl:template>

	<xsl:template match="OrderExpression">
		<xsl:apply-templates select="./*[1]"/>
		<xsl:apply-templates select="./Asc"/>
		<xsl:apply-templates select="./Desc"/>
	</xsl:template>

	<xsl:template match="Asc">
		ASC
	</xsl:template>

	<xsl:template match="Desc">
		DESC
	</xsl:template>


	<!-- Print values: ? for parametric queries and convert expressions
	     for non-parametric queries                                       -->
	<xsl:template match="Parameter">
		<xsl:choose>
			<xsl:when test="$UseParams = 'yes' or $UseParams = 'nosubsel'">
				<xsl:choose>
					<xsl:when test="./@ParamName">
						@<xsl:value-of select="./@ParamName"/>
					</xsl:when>
					<xsl:otherwise>
						?
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<xsl:call-template name="print-non-parametric-parameter-ref">
					<xsl:with-param name="parameter-reference" select="."/>
				</xsl:call-template>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<!-- DatePart                                                         -->
	<xsl:template match="DatePart">
		DATEPART( <xsl:apply-templates select="./*[1]"/> , <xsl:apply-templates select="./*[2]"/> )
	</xsl:template>

	<!-- DatePartSpec                                                     -->
	<xsl:template match="DatePartSpec">
		<xsl:variable name="dps-val"><xsl:value-of select="normalize-space(./text())"/></xsl:variable>
		<xsl:choose>
			<xsl:when test="$dps-val = 'Year'">        year        </xsl:when>
			<xsl:when test="$dps-val = 'Quarter'">     quarter     </xsl:when>
			<xsl:when test="$dps-val = 'Month'">       month       </xsl:when>
			<xsl:when test="$dps-val = 'DayOfYear'">   dayofyear   </xsl:when>
			<xsl:when test="$dps-val = 'Day'">         day         </xsl:when>
			<xsl:when test="$dps-val = 'Week'">        week        </xsl:when>
			<xsl:when test="$dps-val = 'DayOfWeek'">   weekday     </xsl:when>
			<xsl:when test="$dps-val = 'Hour'">        hour        </xsl:when>
			<xsl:when test="$dps-val = 'Minute'">      minute      </xsl:when>
			<xsl:when test="$dps-val = 'Second'">      second      </xsl:when>
			<xsl:when test="$dps-val = 'Millisecond'"> millisecond </xsl:when>
		</xsl:choose>
	</xsl:template>

	<!-- Asterisk                                                         -->
	<xsl:template match="Asterisk">*</xsl:template>

	<!-- Count/Min/Max/Sum                                                -->
	<xsl:template match="Min|Max|Sum">
		<xsl:variable name="function">
			<xsl:choose>
				<xsl:when test="name()='Min'"> MIN </xsl:when>
				<xsl:when test="name()='Max'"> MAX </xsl:when>
				<xsl:when test="name()='Sum'"> SUM </xsl:when>
			</xsl:choose>
		</xsl:variable>
		<xsl:value-of select="$function"/>( <xsl:apply-templates select="./*[1]"/> )
	</xsl:template>

	<xsl:template match="Count">
		COUNT ( <xsl:apply-templates select="./*[1]"/> <xsl:apply-templates select="./*[2]"/> )
	</xsl:template>

	<!-- Binary expressions                                               -->
	<!-- Equal/NotEqual/Greater/GreaterOrEqual/Less/LessOrEqual/In/And/Or/Plus/Minus/Divide/Multiply
	     expressions                                                      -->
	<xsl:template match="Equal|NotEqual|Greater|GreaterOrEqual|Less|LessOrEqual|In|And|Or|Plus|Minus|Divide|Multiply">
		<xsl:variable name="operator">
			<xsl:choose>
				<xsl:when test="name()='Equal'">			=		</xsl:when>
				<xsl:when test="name()='NotEqual'">			<>	</xsl:when>
				<xsl:when test="name()='Greater'">			>		</xsl:when>
				<xsl:when test="name()='GreaterOrEqual'">	>=		</xsl:when>
				<xsl:when test="name()='Less'">				<	</xsl:when>
				<xsl:when test="name()='LessOrEqual'">		<=	</xsl:when>
				<xsl:when test="name()='In'">				IN		</xsl:when>
				<xsl:when test="name()='And'">				AND		</xsl:when>
				<xsl:when test="name()='Or'">				OR		</xsl:when>
				<xsl:when test="name()='Plus'">				+		</xsl:when>
				<xsl:when test="name()='Minus'">			-		</xsl:when>
				<xsl:when test="name()='Divide'">			/		</xsl:when>
				<xsl:when test="name()='Multiply'">			*		</xsl:when>
			</xsl:choose>
		</xsl:variable>
		(
			<xsl:call-template name="print-children-list">
				<xsl:with-param name="operator" select="$operator"/>
			</xsl:call-template>
		)
	</xsl:template>

	<!-- Postfix unary expressions                                        -->
	<!-- IsNull
	     expressions                                                      -->
	<xsl:template match="IsNull">
		<xsl:variable name="operator">
			<xsl:choose>
				<xsl:when test="name()='IsNull'">			IS NULL		</xsl:when>
			</xsl:choose>
		</xsl:variable>
		(
			<xsl:apply-templates select="./*[1]"/>
			<xsl:value-of select="$operator"/>
		)
	</xsl:template>

	<!-- Types                                                            -->
	<xsl:template match="Type">
		<xsl:variable name="type-val"><xsl:value-of select="normalize-space(./text())"/></xsl:variable>
		<xsl:choose>
			<xsl:when test="$type-val = 'DBTYPE_BSTR'">    nvarchar     </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_WSTR'">    nvarchar     </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_STR'">     varchar      </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_BOOL'">    bit          </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_I1'">      tinyint      </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_I2'">      smallint     </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_I4'">      int          </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_I8'">      bigint       </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_UI1'">     tinyint      </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_UI2'">     smallint     </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_UI4'">     int          </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_UI8'">     bigint       </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_R4'">      real         </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_R8'">      float        </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_DATE'">    datetime     </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_DBTIMESTAMP'">    datetime     </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_CY'">      money        </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_VARIANT'"> sql_variant  </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_GUID'"> uniqueidentifer  </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_ByteArray'"> varbinary  </xsl:when>
			<xsl:when test="$type-val = 'DBTYPE_DECIMAL'"> decimal      </xsl:when>
		</xsl:choose>
		<xsl:apply-templates select="./Size"/>
		<xsl:apply-templates select="./Precision"/>
		<xsl:apply-templates select="./Scale"/>		
	</xsl:template>

	<!-- Size (optional)                                                  -->
	<xsl:template match="Size">
	( <xsl:value-of select="./text()"/> )
	</xsl:template>
	
	<!-- Precision (optional)                                                  -->
	<xsl:template match="Precision">
	( <xsl:value-of select="./text()"/>
	</xsl:template>

	<!-- Scale (optional)                                                  -->
	<xsl:template match="Scale">
	, <xsl:value-of select="./text()"/> )
	</xsl:template>
	<!-- Cast                                                             -->
	<xsl:template match="Cast">
		CAST(<xsl:apply-templates select="./*[1]"/> AS <xsl:apply-templates select="./*[2]"/>)
	</xsl:template>
	
	<!-- By default don't do anything                                     -->
	<xsl:template match="*">
	</xsl:template>

	<!-- Print a schema object                                               -->
	<xsl:template name="build-quoted-schema-object"> 
		<xsl:param name="schema-object-node" select="."/>

		<xsl:variable name="schema">
			<xsl:apply-templates select="$schema-object-node/Schema"/>
		</xsl:variable>
		<xsl:variable name="table">
			<xsl:apply-templates select="$schema-object-node/Name"/>
		</xsl:variable>
		<xsl:choose>
			<xsl:when test="$schema = ''">
				<xsl:value-of select="$table"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="concat($schema,'.', $table)"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<!-- Convert an identifier to the OLEDB quotation form                -->
	<xsl:template name="quote-identifier"> 
		<xsl:param name="identifier" select="."/>

		<xsl:value-of select="$IdentifierStartQuotingCharacter"/>
		<xsl:call-template name="normalize-entity-aux">
			<xsl:with-param name="entity" select="$identifier"/>
			<xsl:with-param name="end-quoting-char" select="$IdentifierEndQuotingCharacter"/>
		</xsl:call-template>
		<xsl:value-of select="$IdentifierEndQuotingCharacter"/>
	</xsl:template>

	<!-- Convert a string to the string quotation form                    -->
	<xsl:template name="quote-string"> 
		<xsl:param name="string" select="."/>

		<xsl:value-of select="$StringStartQuotingCharacter"/>
		<xsl:call-template name="normalize-entity-aux">
			<xsl:with-param name="entity" select="$string"/>
			<xsl:with-param name="end-quoting-char" select="$StringEndQuotingCharacter"/>
		</xsl:call-template>
		<xsl:value-of select="$StringEndQuotingCharacter"/>
	</xsl:template>

	<!-- Convert an entity to the quotation form (recursive, aux)  by
         duplicating the end quoting character                            -->
	<xsl:template name="normalize-entity-aux"> 
		<xsl:param name="entity"/>
		<xsl:param name="end-quoting-char"/>

		<xsl:choose>
			<xsl:when test="$end-quoting-char != '' and contains($entity, $end-quoting-char)">
<!--				<xsl:when test="contains($entity, $end-quoting-char)">-->
				<xsl:value-of select="substring-before($entity, $end-quoting-char)"/>
				<xsl:value-of select="$end-quoting-char"/>
				<xsl:value-of select="$end-quoting-char"/>
				<xsl:call-template name="normalize-entity-aux">
					<xsl:with-param name="entity" select="substring-after($entity, $end-quoting-char)"/>
					<xsl:with-param name="end-quoting-char" select="$end-quoting-char"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$entity"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<!-- Print the children list                                          -->
	<xsl:template name="print-children-list">
		<xsl:param name="operator" select="','"/>
		
		<xsl:call-template name="print-list">
			<xsl:with-param name="value-node" select="./*"/>
			<xsl:with-param name="operator" select="$operator"/>
		</xsl:call-template>
	</xsl:template>

	<!-- Print a list                                                     -->
	<xsl:template name="print-list">
		<xsl:param name="operator" select="','"/>
		<xsl:param name="value-node" select="."/>

		<xsl:for-each select="$value-node">
			<xsl:apply-templates select="."/>
			<xsl:if test="position()!=last()">
				<xsl:value-of select="$operator"/>
			</xsl:if>
		</xsl:for-each>
	</xsl:template>

	<!-- Get the value of a parameter ref for the query                   -->
	<xsl:template name="print-non-parametric-parameter-ref">
		<xsl:param name="parameter-reference"/>

		<xsl:variable name="reference"><xsl:value-of select="$parameter-reference/@ref"/></xsl:variable>
		<xsl:call-template name="print-non-parametric-parameter">
			<xsl:with-param name="parameter" select="/Statement/Parameters/Parameter[@id=$reference]"/>
		</xsl:call-template>
	</xsl:template>

	<!-- Get the value of a parameter ref for the query                   -->
	<xsl:template name="print-non-parametric-parameter">
		<xsl:param name="parameter"/>

		<xsl:variable name="db-type"><xsl:value-of select="$parameter/@DBTYPE"/></xsl:variable>
		<xsl:variable name="value"><xsl:value-of select="$parameter/text()"/></xsl:variable>
		<xsl:choose>
			<xsl:when test="$db-type = 'DBTYPE_BSTR'"><xsl:call-template name="quote-string"><xsl:with-param name="string" select="$value"/></xsl:call-template></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_WSTR'"><xsl:call-template name="quote-string"><xsl:with-param name="string" select="$value"/></xsl:call-template></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_STR'"><xsl:call-template name="quote-string"><xsl:with-param name="string" select="$value"/></xsl:call-template></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_BOOL'">CAST( <xsl:call-template name="quote-string"><xsl:with-param name="string" select="$value"/></xsl:call-template> AS bit)</xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_I1'"><xsl:value-of select="$value"/></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_I2'"><xsl:value-of select="$value"/></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_I4'"><xsl:value-of select="$value"/></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_I8'"><xsl:value-of select="$value"/></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_UI1'"><xsl:value-of select="$value"/></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_UI2'"><xsl:value-of select="$value"/></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_UI4'"><xsl:value-of select="$value"/></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_UI8'"><xsl:value-of select="$value"/></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_R4'"><xsl:value-of select="$value"/></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_R8'"><xsl:value-of select="$value"/></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_DATE'">CAST( <xsl:call-template name="quote-string"><xsl:with-param name="string" select="$value"/></xsl:call-template> AS datetime)</xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_DBTIMESTAMP'">CAST( <xsl:call-template name="quote-string"><xsl:with-param name="string" select="$value"/></xsl:call-template> AS datetime)</xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_CY'">CAST( <xsl:call-template name="quote-string"><xsl:with-param name="string" select="$value"/></xsl:call-template> AS money)</xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_VARIANT'"><xsl:call-template name="quote-string"><xsl:with-param name="string" select="$value"/></xsl:call-template></xsl:when>
            <xsl:when test="$db-type = 'DBTYPE_GUID'"><xsl:call-template name="quote-string"><xsl:with-param name="string" select="$value"/></xsl:call-template></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_ByteArray'"><xsl:call-template name="quote-string"><xsl:with-param name="string" select="$value"/></xsl:call-template></xsl:when>
			<xsl:when test="$db-type = 'DBTYPE_DECIMAL'"><xsl:value-of select="$value"/></xsl:when>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
Моша
----------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights
...
Рейтинг: 0 / 0
14.11.2005, 19:36
    #33377594
kornal
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
SQL2005 Cube/Demension processing problem
Моша,
сделал как Вы посоветовали - теперь валится на этом запросе:
Код: plaintext
1.
2.
3.
SELECT %dw_olap_OrigBALDim%.%Level3% AS %dw_olap_OrigBALDimLevel30_0%,%dw_olap_OrigBALDim%.%Level2% AS %dw_olap_OrigBALDimLevel20_1%,
%dw_olap_OrigBALDim%.%Level1% AS %dw_olap_OrigBALDimLevel10_2%,
%dw_olap_OrigBALDim%.%baseId% AS %dw_olap_OrigBALDimbaseId0_3%
		FROM %dw_olap%.%OrigBALDim% AS %dw_olap_OrigBALDim%
Т.е. уже близко - если раньше были [], то теперь %. Осталось заменить % на " и все должно заработать...
...
Рейтинг: 0 / 0
15.11.2005, 04:28
    #33377864
Mosha
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
SQL2005 Cube/Demension processing problem
Это что-то необьяснимое - Откуда эти % взялись... Наверное Sybase IQ это совсем не то же самое что обычный Sybase... Или может быть файл плохо сохранился ? Ну можно сделать еще одну попытку и поменять на

Код: plaintext
1.
  <xsl:param name="in_IdentStartQuotingCharacter">"</xsl:param> 
  <xsl:param name="in_IdentEndQuotingCharacter">"</xsl:param> 

Но по моему проблема в

Код: plaintext
<mssqlcrt:provider type="prefix">Adaptive Server Anywhere</mssqlcrt:provider>

Какую строку этот Sybase IQ выдает из OLEDB ?

Моша
----------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights
...
Рейтинг: 0 / 0
15.11.2005, 23:00
    #33380207
kornal
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
SQL2005 Cube/Demension processing problem
Моша,

Ваш xsl cartrige содержит ошибки(обнаружил я это только когда попытался рестартовать сервис), но самое главное, что файл который я тут зааттачил работает, если в в файле sql2000.xsl убрать строчку:
Код: plaintext
<mssqlcrt:provider type="prefix"></mssqlcrt:provider>

и поставить её в sybase2.xsl. Т.е. как Вы совершенно правильно предположили, проблема заключается в имени и префиксе провайдера. Поставив пустой префикс в мой cartridge я заставляю AS выбирать его если другие cartriges не подходят - это конечно hack, но что делать?!.

Мой провайдер называется:
Код: plaintext
Sybase Adaptive Server Anywhere Provider 7.0
connect string in datasource:
Код: plaintext
Provider=ASAProv.70;Data Source=TEST_IQ;Persist Security Info=False;Integrated Security=SSPI

Спасибо!
...
Рейтинг: 0 / 0
Форумы / OLAP и DWH [игнор отключен] [закрыт для гостей] / SQL2005 Cube/Demension processing problem / 8 сообщений из 8, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]