Compiled Messages: ------------------------------------------------------------ Message no. 6440 Posted by Imran Pathan (ipathan) on Sunday, February 12, 2006 8:07pm Subject: Hi what is a foreign key? ------------------------------------------------------------ Message no. 6441[Branch from no. 6440] Posted by Venkat Munagala (vrmunagala) on Sunday, February 12, 2006 8:10pm Subject: Re: Hi Hi Imran A foreign Key is the one which creates a relationship between two database tables. Rohit ------------------------------------------------------------ Message no. 6442[Branch from no. 6441] Posted by Rhonda Nichols (renichols2) on Sunday, February 12, 2006 8:21pm Subject: Re: Hi A foreign key is when a field or group of fields in one table matches the primary key of another table. -Rhonda Nichols ------------------------------------------------------------ Message no. 6443[Branch from no. 6440] Posted by Phanindra Maddhi (pmaddhi) on Sunday, February 12, 2006 9:21pm Subject: Re: Hi foreign key of one table is the primary key of the other By that we can establish a join between them phanidra ------------------------------------------------------------ Message no. 6446 Posted by Phanindra Maddhi (pmaddhi) on Sunday, February 12, 2006 9:33pm Subject: sql script Suppose we had created a script Is the same scritp can be executed in differet system. ------------------------------------------------------------ Message no. 6448[Branch from no. 6440] Posted by Krishnamurth Ashwini (kashwini) on Sunday, February 12, 2006 10:34pm Subject: Re: Hi Imran, About the Foreign Key: 1. Consider two tables, say Customer and Order (One customer can place many orders:One-to-many). ) 2. Let C_ID be the primary key of Customer Table (I assume you know the meaning of primary key!!!). 3. When Customer table is linked to the order table, you need to include the C_ID in the order table to complete this "One-to-Many" relationship. 4. In this Order table, the C_ID field would be called a "FOREIGN KEY", since it is the primary key of the 'related' table. Hope this helps, Ash ------------------------------------------------------------ Message no. 6450[Branch from no. 6446] Posted by Rohini Shrestha (rshrestha) on Sunday, February 12, 2006 10:53pm Subject: Re: sql script Well, I didn't get your question exactly. What do you mean by different systems? As my understanding, same SQL script ( a file with .sql extension) can be executed in different versions of oracle. It can be executed in multiple databses which serve time and effort. Hope this helps Rohini ------------------------------------------------------------ Message no. 6451[Branch from no. 6448] Posted by Rohini Shrestha (rshrestha) on Sunday, February 12, 2006 10:54pm Subject: Re: Hi Nice way of explaining..with an example to illustrate what you mean. Good job Ash, Rohini ------------------------------------------------------------ Message no. 6452[Branch from no. 6446] Posted by Swarna Bangaru (sbangaru) on Sunday, February 12, 2006 10:56pm Subject: Re: sql script Hope that you are talking about the different operating systems. Yes, there is no difference in running scripts in different operating systems ------------------------------------------------------------ Message no. 6456[Branch from no. 6446] Posted by Bikash Adhikari (badhikari) on Sunday, February 12, 2006 11:38pm Subject: Re: sql script I also do think that you are talking about different operating systems. And if you are then yes they can be execuated in them. BIkash ------------------------------------------------------------ Message no. 6457[Branch from no. 6440] Posted by Bikash Adhikari (badhikari) on Sunday, February 12, 2006 11:47pm Subject: Re: Hi

A foreign key is the primary key from a different table.
A foreign key is the primary key of one data structure that is placed into a related data structure to represent a relationship among those structures. Foreign keys resolve relationships, and support navigation among data structures.

References: faculty.washington.edu/~larsson/conf/aiha98/primer/glossary.htm
                 www.dmreview.com/resources/glossary.cfm

------------------------------------------------------------ Message no. 6459[Branch from no. 6440] Posted by Harold Harris (hjharris2) on Monday, February 13, 2006 1:16am Subject: Re: Hi A Foreign Key is a table field that creates a relationship between two tables. This Foreign Key is also a Primary Key in another table. The Foreign key value must also match the value of the Primary Key. HH ------------------------------------------------------------ Message no. 6460[Branch from no. 6446] Posted by Krupa Kandavalli (kkandavalli) on Monday, February 13, 2006 1:38am Subject: Re: sql script It's not always true that script written for one version of oracle is running fine on another version of oracle. There are good chances that script written on lower version of oracle runs fine on upper version of oracle, but vice-versa is not true. For example you have full outer join in 9i and above. So, if you use it in your script, this will not run on the 8i and lower versions. ------------------------------------------------------------ Message no. 6461[Branch from no. 6446] Posted by Sagun Piya (srpiya2) on Monday, February 13, 2006 2:42am Subject: Re: sql script As far as I know same script can be executed in another system. Sagun ------------------------------------------------------------ Message no. 6463[Branch from no. 6446] Posted by Gnaneshwar Bukka (gbukka) on Monday, February 13, 2006 11:09am Subject: Re: sql script HI Phani, sql script is suppose to work in almost all versions of oracle. Regarding different operating systems then it will work, there should be no problem. Gnaneshwar Bukka ------------------------------------------------------------ Message no. 6464[Branch from no. 6440] Posted by Gnaneshwar Bukka (gbukka) on Monday, February 13, 2006 11:11am Subject: Re: Hi Hi Imran, Foriegn key relates two tables i.e two tables can be joined with a foriegn key. Gnaneshwar Bukka. ------------------------------------------------------------ Message no. 6468[Branch from no. 6440] Posted by Waseem Manzoor (wmanzoor) on Monday, February 13, 2006 3:20pm Subject: Re: Hi hey Imran A foreign key is a set of one or more columns in any table which may hold the value(s) found in the primary key column(s) of some other table. Waseem Manzoor ------------------------------------------------------------ Message no. 6469[Branch from no. 6446] Posted by Waseem Manzoor (wmanzoor) on Monday, February 13, 2006 3:23pm Subject: Re: sql script hey phanindra your question is imbigous but still as I think you are asking about reusability of script on other machines. If this is the case then yes you can use your script file anywhere on any system. And the main reason to write script is reusability of that code. So we could minimize our headache of typing again and again the same queries for future. hope it will help you Waseem Manzoor ------------------------------------------------------------ Message no. 6470 Posted by Sagun Piya (srpiya2) on Monday, February 13, 2006 11:48pm Subject: problem while login to SQL Plus Hi Guys, I have a problem. I don't know why when I tried to login in SQL plus it displays ERROR: ORA-12541: TNS:no listener. DO u know what is that mean. I used correct USer name, Password and Host String but it doesn't work. Help me guys. Sagun ------------------------------------------------------------ Message no. 6471[Branch from no. 6470] Posted by Krishnamurth Ashwini (kashwini) on Tuesday, February 14, 2006 12:20am Subject: Re: problem while login to SQL Plus Sagun, I assume this may be the case: OracleOraDB10g_home1TNSListener may not have started. To do this follow the following steps. 1. Go to Start. 2. Go to Control Panel 3. Go to Administrative tools 4. Go to services 5. Check for OracleOraDB10g_home1TNSListener. 6. Right click on OracleOraDB10g_home1TNSListener. 7. Click Start. Then try to login to SQL*Plus. You should probably not get this error now. Let me know if this works. Ash ------------------------------------------------------------ Message no. 6472[Branch from no. 6471] Posted by Harold Harris (hjharris2) on Tuesday, February 14, 2006 12:30am Subject: Re: problem while login to SQL Plus A reboot of your system may also fix the problem. HH ------------------------------------------------------------ Message no. 6473[Branch from no. 6472] Posted by Rhonda Nichols (renichols2) on Tuesday, February 14, 2006 10:03am Subject: Re: problem while login to SQL Plus ....If you have your listener service set to "AUTOMATIC" rebooting will fix. I have mine set to manual so that I don't slow my boot up session everytime I log on to my computer. If you are not comfortable with starting services manually, make sure yours is set for automatic in the startup column. -Rhonda Nichols ------------------------------------------------------------ Message no. 6474[Branch from no. 6470] Posted by Sagun Piya (srpiya2) on Tuesday, February 14, 2006 11:13am Subject: Re: problem while login to SQL Plus Thank you guys. I got the problem fixed. I appreciate your help Sagun ------------------------------------------------------------ Message no. 6475[Branch from no. 6440] Posted by Sagun Piya (srpiya2) on Tuesday, February 14, 2006 11:37am Subject: Re: Hi A foreign key is a field name in a particular table which acts as a primary key for the other table. As for the other table this acts as a primary key but it is not in their table field but in other(foreign) table Sagun ------------------------------------------------------------ Message no. 6479[Branch from no. 6475] Posted by Muhammad Latif (mlatif) on Wednesday, February 15, 2006 11:57am Subject: Re: Hi Hi Imran: Foreign key is a field in one table that is acting as a primary key in another table, in order to create a realtionship between the two tables. Arsal ------------------------------------------------------------ Message no. 6480[Branch from no. 6469] Posted by Muhammad Latif (mlatif) on Wednesday, February 15, 2006 12:00pm Subject: Re: sql script Hi Phanindra: Once you save commands in text file with the extension ".sql", it becomes portable and reusable. Arsal ------------------------------------------------------------ Message no. 6488[Branch from no. 6440] Posted by Gwendolyn Mobley (gdmobley) on Wednesday, February 15, 2006 7:18pm Subject: Re: Hi A foreign key (FK) is a field in a database record that points to a key field of another database record in another table. Usually a foreign key in one table refers to the primary key (PK) of the other table. This way references can be made to link information together and it is an essential part of database normalization. en.wikipedia.org/wiki/Foreign_key gwen ------------------------------------------------------------ Message no. 6492[Branch from no. 6440] Posted by Antoinette Lockett (arlockett) on Wednesday, February 15, 2006 7:55pm Subject: Re: Hi Imran, I know I am late in answering your question but A foreign key links a record in one database table to a record in another table. A foreign key is a field (or fields) in one table that must exactly equal the primary key field (or fields) in another table. When the values match the records can be combined in a query. http://orion.kent.edu/steinberg/forkey.htm Antoinette Lockett ------------------------------------------------------------ Message no. 6493[Branch from no. 6446] Posted by Alex Auffenorde (aaauffenorde) on Wednesday, February 15, 2006 9:08pm Subject: Re: sql script I agree with the information here. A script written with a .sql extenion can be used on different machines. The version should not matter because pure SQL is not affect by the version of oracle you run. The only thing is if you are going from oracle to MS SQL Server there are known issues with reserved words. Alex ------------------------------------------------------------ Message no. 6510[Branch from no. 6440] Posted by Imran Pathan (ipathan) on Thursday, February 16, 2006 10:30pm Subject: Re: Hi Hi , Thaks to all for helping out with the definition of foreign key. Imran ------------------------------------------------------------ Message no. 6511[Branch from no. 6446] Posted by Imran Pathan (ipathan) on Thursday, February 16, 2006 10:32pm Subject: Re: sql script Hi Phani, Yes I think that The same script can be used in different systems using the extension .sql Imran ------------------------------------------------------------ Message no. 6512[Branch from no. 6440] Posted by Imran Pathan (ipathan) on Thursday, February 16, 2006 10:38pm Subject: Re: Hi Joke: The Top 11 Things People Think The 95 In Windows95 Really Stands For -------------------------------------------------------------------- 11. The percentage that will be complete on the shipping date. 10. The number of floppies it will ship on. 9. The percentage of people who will have to upgrade their hardware. 8. The number of megabytes of hard disk space required. 7. The number of pages in the *EASY-INSTALL* version of the manual. 6. The percentage of existing windows programs that won't run in the new OS. 5. The number of minutes to install. 4. The number of calls to tech support before you can get it to run. 3. The number of people who will actually PAY for the upgrade. 2. The number of MHz required for the OS to run. And now the #1 thing people think the 95 in Windows95 really stands for.. (Drum roll please...) 1. The year it was *DUE* to ship. ------------------------------------------------------------ Message no. 6520[Branch from no. 6440] Posted by Kelsey Pooley (kjpooley) on Saturday, February 18, 2006 1:08am Subject: Re: Hi It's important to note that when you are linking tables, the primary key must be designated before there can be a foreign key associated with it. It sounds logical but when you are building and linking your tables sometimes you forget and then can't figure out why you are getting an error! ------------------------------------------------------------ Message no. 6525[Branch from no. 6520] Posted by Abhash Bhandary (abhandary) on Saturday, February 18, 2006 3:34pm Subject: Re: Hi i think you are right Kelsy we do need a primary key first abhash ------------------------------------------------------------ Message no. 6526[Branch from no. 6511] Posted by Abhash Bhandary (abhandary) on Saturday, February 18, 2006 3:36pm Subject: Re: sql script ya i agree to all of you as well...i too think that as long as it is saved as a .sql file it can be run on any operating system abhash ------------------------------------------------------------ Message no. 6527[Branch from no. 6474] Posted by Abhash Bhandary (abhandary) on Saturday, February 18, 2006 3:38pm Subject: Re: problem while login to SQL Plus so which method did you use to fix the problem Sagun? abhash ------------------------------------------------------------ Message no. 6529[Branch from no. 6527] Posted by Sagun Piya (srpiya2) on Saturday, February 18, 2006 4:24pm Subject: Re: problem while login to SQL Plus Hey Abhash, I went to command promt and type lsnrctl start. It will say lsnrctl starts successfully. Then I was able to enter into SQL plus session. Sagun ------------------------------------------------------------ Message no. 6539[Branch from no. 6440] Posted by Kelli Lemon (kmlemon) on Saturday, February 18, 2006 10:05pm Subject: Re: Hi Thanks everyone for the information. Sorry that I couldn't have been much of help. I see that everyone else beat me to it, like always. Kelli ------------------------------------------------------------