473,385 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

[Q] complex output result again: the end of script was cutoff in the previous posting

Hello, I have three tables and would like to see the output result as
below:

--------------------- OUTPUT RESULT
--------------------------------------
index_id officeid officename officecode officedescript
Description attrcatitemid departmentID divisionID branchID
sectionID unitID

6 9 00012 02 NNN Department 133 6 6 6 6 6
3 9 00012 05 CCC Department 133 3 3 3 3 3
5 9 00012 03 AAB Division 134 3 5 5 5 5
9 9 00012 10 jjj Branch 135 3 5 9 9 9
4 9 00012 04 VVV Division 134 3 4 4 4 4
8 9 00012 08 lll Branch 135 3 4 8 8 8
10 9 00012 11 bbn Section 136 3 4 8 10 10
11 9 00012 12 vcc Unit 137 3 4 8 10 11
12 9 00012 13 uuu Section 136 3 4 8 12 12
1 9 00012 09 AAA Department 133 1 1 1 1 1
2 2 00013 01 BBB Department 133 2 2 2 2 2
7 2 00013 07 PPP Division 134 2 7 7 7 7

--------------------- OUTPUT RESULT END
-----------------------------------

table relationship:
A_Office.index_id = organization.officeid
A_Type.index_id = organization.attrcatitemid
organization.index_id = organization.departmentID
organization.index_id = organization.divisionID
organization.index_id = organization.branchID
organization.index_id = organization.sectionID
organization.index_id = organization.unitID

-------------------------------------------------------
Generating tables

A_Office table Script:

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[A_Office]') and OBJECTPROPERTY(id, N'IsUserTable')
= 1)
drop table [dbo].[A_Office]
GO

CREATE TABLE [dbo].[A_Office] (
[index_id] [int] NOT NULL ,
[officename] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL
) ON [PRIMARY]
GO

INSERT INTO A_Office (
[index_id], [officename])
VALUES (1, '00011')

GO
INSERT INTO A_Office (
[index_id], [officename])
VALUES (2, '00012')

GO
INSERT INTO A_Office (
[index_id], [officename])
VALUES (3, '00014')
GO
INSERT INTO A_Office (
[index_id], [officename])
VALUES (9, '00013')

----------------------------------

A_Type Table:

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[A_Type]') and OBJECTPROPERTY(id, N'IsUserTable') =
1)
drop table [dbo].[A_Type]
GO

CREATE TABLE [dbo].[A_Type] (
[index_id] [int] NOT NULL ,
[description] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL ,
[sortorder] [int] NOT NULL
) ON [PRIMARY]
GO
INSERT INTO A_Type (
[index_id], [description],[sortorder])
VALUES (133, 'Department', 1)
GO
INSERT INTO A_Type (
[index_id], [description],[sortorder])
VALUES (134, 'Division', 2)
GO
INSERT INTO A_Type (
[index_id], [description],[sortorder])
VALUES (135, 'Branch', 3)
GO
------------------------------------------
organization table script:

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[organization]') and OBJECTPROPERTY(id,
N'IsUserTable') = 1)
drop table [dbo].[organization]
GO

CREATE TABLE [dbo].[organization] (
[index_id] [int] NOT NULL ,
[officeid] [int] NOT NULL ,
[officecode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL ,
[officedescript] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL ,
[attrcatitemid] [int] NOT NULL ,
[departmentID] [int] NOT NULL ,
[divisionID] [int] NOT NULL ,
[branchID] [int] NOT NULL ,
[sectionID] [int] NOT NULL ,
[unitID] [int] NOT NULL ,
) ON [PRIMARY]
GO

INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (1, 9, '09', 'AAA', 133, 1, 1, 1, 1, 1)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (2, 2, '01', 'BBB', 133, 2, 2, 2, 2, 2)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (3, 9, '05', 'CCC', 133, 3, 3, 3, 3, 3)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (4, 9, '04', 'VVV', 134, 3, 4, 4, 4, 4)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (5, 9, '03', 'AAB', 134, 3, 5, 5, 5, 5)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (6, 9, '02', 'NNN', 133, 6, 6, 6, 6, 6)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (7, 2, '07', 'PPP', 134, 2, 7, 7, 7, 7)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (8, 9, '08', 'LLL', 135, 3, 4, 8, 8, 8)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (9, 9, '10', 'jjj', 135, 3, 5, 9, 9, 9)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (10, 9, '11', 'bbn', 136, 3, 4, 8, 10, 10)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (11, 9, '12', 'vcc', 137, 3, 4, 8, 10, 11)

GO
INSERT INTO organization (
[index_id], [officeid],[officecode],[officedescript],[attrcatitemid],[departmentID],[divisionID],[branchID],
[sectionID],[unitID])
VALUES (12, 9, '13', 'uuu', 136, 3, 4, 8, 12, 12)
Jul 20 '05 #1
0 1030

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert | last post by:
Hello, I am trying to get output formatted from a non-php script that I post to. Example: <form method=POST action=www.myurl.com/ColdFusion.cfm> bla bla bla </form>
2
by: Bob | last post by:
Everybody, I've been doing a lot of on-line research and cannot find any reference to the exact problem I'm having. Let me preface this question with the fact that I'm coming from an Oracle...
0
by: reneecccwest | last post by:
Hello, I have three tables and would like to see the output result as below: --------------------- OUTPUT RESULT -------------------------------------- index_id ...
0
by: reneecccwest | last post by:
Hello, I have three tables and would like to see the output result as below: --------------------- OUTPUT RESULT -------------------------------------- index_id ...
9
by: F. Da Costa | last post by:
Hi, Does anybody know why IE5+ does *not* honour array objects (like a table) across a session? Example: Frame A contains a var tableVar which is set via form Frame B (on init) using...
6
by: R. Stormo | last post by:
I have a problem showing output that is comming from a script. If I make a script running at commandline it do work and everything are showing. But when I try to execute it from within my proggy...
4
by: Ganesh Muthuvelu | last post by:
Hi STAN, Stan: Thanks for your response to my previous post on reading a XSD file using your article in "https://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspx". it works quite well...
8
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for...
14
by: fdu.xiaojf | last post by:
Hi, I'm writing a program which imports an external module writing in C and calls a function provided by the module to do my job. But the method produces a lot of output to the stdout, and this...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.