473,545 Members | 2,788 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

table name as a column datatype

20 New Member
Hello all

Recently I was playing with column data types and found that you can have a table name as the column's datatype although it looks like an "array object". For ex. if I have table1 and table2, it seems something like the following is possible..

create table table2(id bigint,table1[]);

Am just interested in what are the situations one would go for such an option? Any example or a direction for reading on this topic would be much appreciated.

Thanks a lot.
Jun 14 '08 #1
1 2972
pravinasp
20 New Member
Hello all,

My bad, i should have mentioned it, am working on postgres. If anyone has used table as a columns datatype I would be glad to hear from you if you could tell me when to go for such an option.


Cheers
Jul 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
21248
by: Bruce | last post by:
Hi, I want to change the datatype of an existing column from char to varbinary. When I run the "Alter Table" statement, I get the following error message - Disallowed implicit conversion from data type char to data type varbinary, table 'test.dbo.testalter', column 'col1'. Use the CONVERT function to run this query.
3
2175
by: Martin Mrazek | last post by:
Hi, I have tables named like ag97a027, ag98a027, ... where 97 and 98 is from year 1997, 1998 and a027 is just specification of product type. I need carry out repeated operataions over these tables. To generate their names is easy, for example use declare @Yint int, @Y char(2), @tabName char(8) set @Yint = 1997 while @Yint < 2002
2
3592
by: charles leviton | last post by:
Hi all, Just trying to get a feel here. THe shop I work at insists on prefixing all column names with the table name, so it is order_id in the ORDER table and Customer_id in the CUSTOMER table. I find this irksome and much prefer that a coding standard be imposed whereby any column name has to be qualified by the table name. So it would be...
1
3544
by: keithb | last post by:
The following code sets a DataTable column DataType to "String" column.DataType = System.Type.GetType("System.String"); What is the corresponding statement when the data type is boolean? I have tried both "bit', "bool", and "boolean" and all cause an error. One would think that a simple search for "System.Type.GetType" in Books On Line...
0
2074
by: Joe Meng | last post by:
Greetings, I've seen this question asked and answered here, just not completely yet. I'm wondering how to use a column value as a table name in another query. So far it's looking like you must use dynamic SQL, external to DB2. An example: TableX contains column TabName, which is populated by the names of tables in the database. Each of...
4
1924
by: ahmed222too | last post by:
when i use this quary to add new column, the engine reject the table name and focus on (-) in the table name alter table AH10-A1*1*1-101006 add column sss note: this schema of table name (AH10-A1*1*1-101006 ) is applied on 500 table so it is defficult to change the tables name
5
1782
by: Jim in Arizona | last post by:
I built a webpage using vb.net (.net 2.0) that creates a form letter. This letter pulls data from a database. Although I populate the address with the person's full name, which comes from the name column of a customer table, I need to just get the first name for the Dear part of the letter (ie: Dear John instead of Dear John Smith). It would...
4
1825
by: MGM | last post by:
Hello everyone, I once again have a problem :p I need to write a query to get the total amount of rows in a table. Problem is, the table name is dynamic and part of its value is stored in another table. Here's my query: SELECT id, name, (SELECT COUNT(*) AS amtColumns FROM CDT_DEM_Columns WHERE (pageid =...
1
2766
by: pulavarthipraveen | last post by:
When I tried to change the datatype of the column through "Alter table tablename Alter column columnname Newdatatype" query it's is throw the error below: "The index 'IndexName' is dependent on column 'columnname'" . But it allowed me to change the column datatype through Enterprise Manager Table Designer without any restictions. 1) What...
0
7689
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7943
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7786
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6022
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5359
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3490
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.