PageRenderTime 24ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/SQL/scripts/db/tblstruct.asp

http://github.com/khaneh/Orders
ASP | 222 lines | 212 code | 10 blank | 0 comment | 0 complexity | 2b2dbfbdb77a0540e6e28e835bb53aef MD5 | raw file
  1<!-- #INCLUDE FILE="../inc/mla_sql_include.asp" -->
  2<%
  3	Dim myNodeId, myDbName, myTblName, myTblShortName, myArrCol, myColCount, myArrIx, myIxCount, myCurrentIx, myArrFk, myFkCount, myCurrentFk, myArrTr, myTrCount, myTrName, myTrShortName, i, j, myObjStr, myStrClass, myStrTree, myArrCnt, myCntCount, myCntName, myCntShortName, myIxName, myFkName
  4	myNodeId = Request.QueryString("nid")
  5	myDbName = Request.QueryString("db")
  6	myTblName = Request.QueryString("tbl")
  7	openConnection
  8	myStrTree = getTreeStr(Mid(myNodeId, 2) & "_1_2", Array(myDbName, myTblName))
  9	myTblShortName = getObjShortName(myDbName, myTblName)
 10	myArrCol = getTblCol(myDbName, myTblName)
 11	myArrIx = getTblIx(myDbName, myTblName)
 12	myArrFk = getTblForeignKey(myDbName, myTblName)
 13	myArrTr = getTblTrigger(myDbName, myTblName)
 14	myArrCnt = getTblConstraint(myDbName, myTblName)
 15	closeConnection
 16	If isArray(myArrCol) Then myColCount = UBound(myArrCol, 2) Else myColCount = -1 End If
 17	If isArray(myArrIx) Then myIxCount = UBound(myArrIx, 2) Else myIxCount = -1 End If
 18	If isArray(myArrFk) Then myFkCount = UBound(myArrFk, 2) Else myFkCount = -1 End If
 19	If isArray(myArrTr) Then myTrCount = UBound(myArrTr, 2) Else myTrCount = -1 End If
 20	If isArray(myArrCnt) Then myCntCount = UBound(myArrCnt, 2) Else myCntCount = -1 End If
 21%>
 22<!-- #INCLUDE FILE="../inc/metaheader.asp" -->
 23<BODY>
 24	<P CLASS="treeinfo"><% = myStrTree %></P>
 25
 26	<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 CLASS="content" SUMMARY="Database Information">
 27		<TR><TD CLASS="caption"><IMG SRC="../../themes/<% = mla_cfg_theme %>/images/mylittletree/table.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALIGN="MIDDLE" ALT="Columns"> <% = myTObj.getTerm(331) %></TD></TR>
 28		<TR><TD>
 29			<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER CLASS="content" WIDTH="100%" SUMMARY="Table Stucture">
 30				<THEAD>
 31					<TR><TD CLASS="collabel"><% = myTObj.getTerm(311) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(300) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(301) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(302) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(303) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(304) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(305) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(306) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(323) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(307) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(308) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(309) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(310) %></TD></TR>
 32				</THEAD>
 33				<TBODY>
 34					<%
 35						Set myObjStr = New mlt_string
 36						For i = 0 To myColCount
 37							If i MOD 2 = 0 Then myStrClass = "odd" Else myStrClass = "even" End If
 38							myObjStr.strAppend "<TR CLASS=""" & myStrClass & """>" & vbCrLf
 39							myObjStr.strAppend "<TD NOWRAP>"
 40							If myArrCol(12, i) Then
 41								myObjStr.strAppend "<IMG SRC=""../../themes/" & mla_cfg_theme & "/images/action/pkey.gif"" WIDTH=""15"" HEIGHT=""15"" BORDER=0 ALT=""Primary Key"" ALIGN=""MIDDLE"">"
 42							Else
 43								myObjStr.strAppend "&nbsp;"
 44							End If
 45							myObjStr.strAppend "</TD>" & vbCrLf
 46							myObjStr.strAppend "<TD NOWRAP><B>" & myArrCol(0, i) & "</B></TD>" & vbCrLf
 47							myObjStr.strAppend "<TD NOWRAP>" & myArrCol(1, i) & "</TD>" & vbCrLf
 48							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>" & myArrCol(2, i) & "</TD>" & vbCrLf
 49							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrCol(3, i) & "</TD>" & vbCrLf
 50							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrCol(4, i) & "</TD>" & vbCrLf
 51							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrCol(5, i) & "</TD>" & vbCrLf
 52							myObjStr.strAppend "<TD NOWRAP>" & myArrCol(6, i) & "&nbsp;</TD>" & vbCrLf
 53							myObjStr.strAppend "<TD NOWRAP>" & myArrCol(7, i) & "&nbsp;</TD>" & vbCrLf
 54							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrCol(8, i) & "</TD>" & vbCrLf
 55							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrCol(9, i) & "</TD>" & vbCrLf
 56							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrCol(10, i) & "</TD>" & vbCrLf
 57							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrCol(11, i) & "</TD>" & vbCrLf
 58							myObjStr.strAppend "</TR>" & vBCrLf
 59						Next
 60						Response.Write myObjStr.getStr()
 61						Set myObjStr = Nothing
 62					%>
 63				</TBODY>
 64			</TABLE>
 65		</TD></TR>
 66	</TABLE>
 67
 68	&nbsp;<BR>
 69
 70	<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 CLASS="content" SUMMARY="Database Information">
 71		<TR><TD CLASS="caption" COLSPAN=2><IMG SRC="../../themes/<% = mla_cfg_theme %>/images/mylittletree/index.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALIGN="MIDDLE" ALT="Indexes"> <% = myTObj.getTerm(312) %></TD></TR>
 72		<TR><TD>
 73			<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER CLASS="content" WIDTH="100%" SUMMARY="Table Indexes">
 74				<THEAD>
 75					<TR><TD CLASS="collabel"><% = myTObj.getTerm(313) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(314) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(315) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(316) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(319) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(317) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(318) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(322) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(320) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(321) %></TD></TR>
 76				</THEAD>
 77				<TBODY>
 78					<%
 79						myCurrentIx = 0
 80						j = 0
 81						Set myObjStr = New mlt_string
 82						For i = 0 To myIxCount
 83							If myArrIx(3, i) Then
 84								myIxName = "[" & rembracket(myArrIx(1, i)) & "]"								
 85							Else
 86								myIxName = "[" & rembracket(myTblShortName) & "].[" & rembracket(myArrIx(1, i)) & "]"
 87							End If
 88							If j MOD 2 = 0 Then myStrClass = "odd" Else myStrClass = "even" End If
 89							myCurrentIx = myArrIx(0, i)
 90							myObjStr.strAppend "<TR CLASS=""" & myStrClass & """>" & vbCrLf
 91							myObjStr.strAppend "<TD NOWRAP><B>" & myArrIx(1, i) & "</B></TD>" & vbCrLf
 92							myObjStr.strAppend "<TD NOWRAP>"
 93							Do While myArrIx(0, i) = myCurrentIx
 94								myObjStr.strAppend myArrIx(2, i) & "<BR>"
 95								i = i + 1
 96								If i > myIxCount Then Exit Do
 97							Loop
 98							i = i - 1
 99							myObjStr.strAppend "</TD>" & vbCrLf
100							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrIx(3, i) & "</TD>" & vbCrLf
101							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrIx(4, i) & "</TD>" & vbCrLf
102							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrIx(7, i) & "</TD>" & vbCrLf
103							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrIx(5, i) & "</TD>" & vbCrLf
104							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>" & myArrIx(6, i) & "</TD>" & vbCrLf
105							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrIx(8, i) & "</TD>" & vbCrLf
106							myObjStr.strAppend "<TD NOWRAP ALIGN=RIGHT>&nbsp;" & myArrIx(9, i) & "</TD>" & vbCrLf
107							myObjStr.strAppend "<TD NOWRAP>&nbsp;" & myArrIx(10, i) & "</TD>" & vbCrLf
108							myObjStr.strAppend "</TR>" & vBCrLf
109							j = j + 1
110						Next
111						Response.Write myObjStr.getStr()
112						Set myObjStr = Nothing
113					%>
114				</TBODY>
115			</TABLE>
116		</TD></TR>
117	</TABLE>
118
119	&nbsp;<BR>
120
121	<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 CLASS="content" SUMMARY="Database Information">
122		<TR><TD CLASS="caption" COLSPAN=2><IMG SRC="../../themes/<% = mla_cfg_theme %>/images/mylittletree/relation.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALIGN="MIDDLE" ALT="Relationship"> <% = myTObj.getTerm(324) %></TD></TR>
123		<TR><TD>
124			<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER CLASS="content" WIDTH="100%" SUMMARY="Table Relationship">
125				<THEAD>
126					<TR><TD CLASS="collabel"><% = myTObj.getTerm(325) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(326) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(327) %></TD></TR>
127				</THEAD>
128				<TBODY>
129					<%
130						myCurrentFk = 0
131						Set myObjStr = New mlt_string
132						For i = 0 To myFkCount
133							If myCurrentFk <> myArrFk(0, i) Then
134								myFkName = "[" & rembracket(myArrFk(1, i)) & "]"
135								myStrClass = "odd"
136								myObjStr.strAppend "<TR CLASS=""" & myStrClass & """>" & vBCrLf
137								myObjStr.strAppend "<TD NOWRAP><B>" & myArrFk(1, i) & "</B></TD>" & vbCrLf
138								myObjStr.strAppend "<TD NOWRAP><B>" & myArrFk(2, i) & "</B></TD>" & vbCrLf
139								myObjStr.strAppend "<TD NOWRAP><B>" & myArrFk(3, i) & "</B></TD>" & vbCrLf
140								myObjStr.strAppend "</TR>" & vBCrLf
141								myCurrentFk = myArrFk(0, i)
142							End If
143							myStrClass = "even"
144							myObjStr.strAppend "<TR CLASS=""" & myStrClass & """>" & vBCrLf
145							myObjStr.strAppend "<TD NOWRAP>&nbsp;</TD>" & vbCrLf
146							myObjStr.strAppend "<TD NOWRAP>" & myArrFk(4, i) & "</TD>" & vbCrLf
147							myObjStr.strAppend "<TD NOWRAP>" & myArrFk(5, i) & "</TD>" & vbCrLf
148							myObjStr.strAppend "<TD NOWRAP>&nbsp;</TD>" & vbCrLf
149							myObjStr.strAppend "</TR>" & vBCrLf
150						Next
151						Response.Write myObjStr.getStr()
152						Set myObjStr = Nothing
153					%>
154				</TBODY>
155			</TABLE>
156		</TD></TR>
157	</TABLE>
158
159	&nbsp;<BR>
160
161	<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 CLASS="content" SUMMARY="Database Information">
162		<TR><TD CLASS="caption" COLSPAN=2><IMG SRC="../../themes/<% = mla_cfg_theme %>/images/mylittletree/trigger.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALIGN="MIDDLE" ALT="Triggers"> <% = myTObj.getTerm(328) %></TD></TR>
163		<TR><TD>
164			<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER CLASS="content" WIDTH="100%" SUMMARY="Trigger List">
165				<THEAD>
166					<TR><TD CLASS="collabel"><% = myTObj.getTerm(329) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(121) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(122) %></TD></TR>
167				</THEAD>
168				<TBODY>
169					<%
170						Set myObjStr = New mlt_string
171						For i = 0 To myTrCount
172							myTrName = "[" & rembracket(myDbName) & "].[" & rembracket(myArrTr(1, i)) & "].[" & rembracket(myArrTr(0, i)) & "]"
173							myTrShortName = "[" & rembracket(myArrTr(1, i)) & "].[" & rembracket(myArrTr(0, i)) & "]"
174							If j MOD 2 = 0 Then myStrClass = "odd" Else myStrClass = "even" End If
175							myObjStr.strAppend "<TR CLASS=""" & myStrClass & """>" & vBCrLf
176							myObjStr.strAppend "<TD NOWRAP><IMG SRC=""../../themes/" & mla_cfg_theme & "/images/mylittletree/trigger.gif"" WIDTH=""16"" HEIGHT=""16"" BORDER=0 ALT=""" & myArrTr(0, i) & """ ALIGN=""MIDDLE""> <A HREF=""trstruct.asp?nid=" & myNodeId & "&db=" & Server.URLEncode(myDbName) & "&tbl=" & Server.URLEncode(myTblName) & "&tr=" & Server.URLEncode(myTrName) & """><B>" & myArrTr(0, i) & "</B></A></TD>" & vbCrLf
177							myObjStr.strAppend "<TD NOWRAP>" & myArrTr(1, i) & "</TD>" & vbCrLf
178							myObjStr.strAppend "<TD NOWRAP>" & myArrTr(2, i) & "</TD>" & vbCrLf
179							myObjStr.strAppend "</TR>" & vBCrLf
180						Next
181						Response.Write myObjStr.getStr()
182						Set myObjStr = Nothing
183					%>
184				</TBODY>
185			</TABLE>
186		</TD></TR>
187	</TABLE>
188
189	&nbsp;<BR>
190
191	<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 CLASS="content" SUMMARY="Database Information">
192		<TR><TD CLASS="caption" COLSPAN=2><IMG SRC="../../themes/<% = mla_cfg_theme %>/images/mylittletree/constraint.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALIGN="MIDDLE" ALT="Constraints"> <% = myTObj.getTerm(347) %></TD></TR>
193		<TR><TD>
194			<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER CLASS="content" WIDTH="100%" SUMMARY="Constraint List">
195				<THEAD>
196					<TR><TD CLASS="collabel"><% = myTObj.getTerm(348) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(121) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(122) %></TD><TD CLASS="collabel"><% = myTObj.getTerm(349) %></TD></TR>
197				</THEAD>
198				<TBODY>
199					<%
200						Set myObjStr = New mlt_string
201						For i = 0 To myCntCount
202							myCntName = "[" & rembracket(myDbName) & "].[" & rembracket(myArrCnt(1, i)) & "].[" & rembracket(myArrCnt(0, i)) & "]"
203							myCntShortName = "[" & rembracket(myArrCnt(0, i)) & "]"
204							If j MOD 2 = 0 Then myStrClass = "odd" Else myStrClass = "even" End If
205							myObjStr.strAppend "<TR CLASS=""" & myStrClass & """>" & vBCrLf
206							myObjStr.strAppend "<TD NOWRAP><IMG SRC=""../../themes/" & mla_cfg_theme & "/images/mylittletree/constraint.gif"" WIDTH=""16"" HEIGHT=""16"" BORDER=0 ALT=""" & myArrCnt(0, i) & """ ALIGN=""MIDDLE""> <B>" & myArrCnt(0, i) & "</B></TD>" & vbCrLf
207							myObjStr.strAppend "<TD NOWRAP>" & myArrCnt(1, i) & "</TD>" & vbCrLf
208							myObjStr.strAppend "<TD NOWRAP>" & myArrCnt(2, i) & "</TD>" & vbCrLf
209							myObjStr.strAppend "<TD NOWRAP>" & txt2html(myArrCnt(3, i)) & "</TD>" & vbCrLf
210							myObjStr.strAppend "</TR>" & vBCrLf
211						Next
212						Response.Write myObjStr.getStr()
213						Set myObjStr = Nothing
214					%>
215				</TBODY>
216			</TABLE>
217		</TD></TR>
218	</TABLE>
219
220</BODY>
221</HTML>
222<!-- #INCLUDE FILE="../inc/mla_sql_end.asp" -->