Sponsored Content
Full Discussion: Two databases
Top Forums Shell Programming and Scripting Two databases Post 302542300 by panyam on Wednesday 27th of July 2011 07:09:34 AM
Old 07-27-2011
Hello Anjali,

First of it's Data Base related topic and not sure why you posted here.

However,

Assuming that you are using Oracle as Data Base.

In order to access two "same" tables created in two different schemas, you have to have grant privilges. Assuming all are in place:

This will give you the common "rows" from two tables:

Code:
 
select empname from Employee where empname in (select empname from schema2.Employee)

This will give you the rows present in Schema1 Employee table but not in Schema2:

Code:
 
select empname from Employee where empname not in (select empname from schema2.Employee)

Read Oracle Documents for more information on this.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ASP and Databases on UNIX?

I have been asked to use ASP on UNIX and I have no idea what the limitations are. I have pages using ASP on NT with SQL7, is there an easy transition for my current pages to work on UNIX? Any help is much appreciated. THX (5 Replies)
Discussion started by: dkropolis
5 Replies

2. UNIX for Dummies Questions & Answers

Unix and databases

I had a person ask me if a Sql database can be run with Unix? I don't know can this be done? They only have Sql dba's and no oracle dba but want to use a Unix box???? (1 Reply)
Discussion started by: tyranunn
1 Replies

3. Cybersecurity

Security Databases are corrupt. HELP!!

Help! SCO Unix 5.05. A relatievely new system went down on me today. I got the dreaded error: Out of Space on Device (1/42). I was able to clear up some space in the /tmp directory, however, when I try to boot, the system prompts me to go into single user mode and I get the... (2 Replies)
Discussion started by: gseyforth
2 Replies

4. UNIX for Dummies Questions & Answers

Checking which databases are installed

I want to check which databases are installed on my FreeBSD installation. This is what I did: pkg_info | grep mysql How do I check all in one go whether also sqlite, postgresql, firebird is installed? Thanks in advance (3 Replies)
Discussion started by: figaro
3 Replies

5. Web Development

Deleting databases in MYSQL problem asking...

Hi, I'm the new user of mysql. I facing one problem to delete one of the database in mysql. Hope can get all of your suggestion and advice. Input: mysql> show databases; +-------------------------+ | Database | +-------------------------+ | information_schema | |... (3 Replies)
Discussion started by: patrick87
3 Replies

6. Solaris

SVM - there are no existing databases.

I am facing problems with SVM installed on vmware workstation on intel platform. I have created replicas and a mirror volume using unmountable slices. But when I reboot my hardware I am not able to execute any SVM cmd's getting an error "there are no existing databases." Below are o/p's of few... (0 Replies)
Discussion started by: rahul_11d
0 Replies

7. UNIX for Dummies Questions & Answers

Diff command with databases

How can we compare query results from different databases using Unix diff command from command-line in Ab Initio tool? (1 Reply)
Discussion started by: eshalife
1 Replies

8. Shell Programming and Scripting

Need help in backing up of databases.

Hi Everyone, I am new to DBA stuff. I wonder if anyone can help me. Task is that, I have 10 databases and need to take backups of all the databases using data pump in Unix/Linux, compress them using gzip and use cron to schedule the job twice a day. Appreciate if anyone can help me in... (1 Reply)
Discussion started by: sreepriya0987
1 Replies

9. Programming

MySQL Databases

Hello all again, How do you guys backup your MySQL databases? I have a few programs that have an default back up that make an .sql file which is great but I also use OpenX which runs on PHP and has a database. That does not have an auto-back-up feature so do I just download the... (2 Replies)
Discussion started by: AimyThomas
2 Replies
COMMENT(7)							   SQL Commands 							COMMENT(7)

NAME
COMMENT - define or change the comment of an object SYNOPSIS
COMMENT ON [ TABLE object_name | COLUMN table_name.column_name | AGGREGATE agg_name (agg_type) | CONSTRAINT constraint_name ON table_name | DATABASE object_name | DOMAIN object_name | FUNCTION func_name (arg1_type, arg2_type, ...) | INDEX object_name | OPERATOR op (leftoperand_type, rightoperand_type) | RULE rule_name ON table_name | SCHEMA object_name | SEQUENCE object_name | TRIGGER trigger_name ON table_name | TYPE object_name | VIEW object_name ] IS 'text' INPUTS object_name, The name of the object to be be commented. Names of tables, aggregates, domains, functions, indexes, operators, sequences, types, and views may be schema-qualified. text The comment to add. OUTPUTS COMMENT Message returned if the table is successfully commented. DESCRIPTION
COMMENT stores a comment about a database object. Comments can be easily retrieved with psql's dd, d+, or l+ commands. Other user interfaces to retrieve comments can be built atop the same built-in functions that psql uses, namely obj_description() and col_descrip- tion(). To modify a comment, issue a new COMMENT command for the same object. Only one comment string is stored for each object. To remove a com- ment, write NULL in place of the text string. Comments are automatically dropped when the object is dropped. Note: There is presently no security mechanism for comments: any user connected to a database can see all the comments for objects in that database (although only superusers can change comments for objects that they don't own). Therefore, don't put security-crit- ical information in comments. USAGE
Attach a comment to the table mytable: COMMENT ON TABLE mytable IS 'This is my table.'; Remove it again: COMMENT ON TABLE mytable IS NULL; Some more examples: COMMENT ON AGGREGATE my_aggregate (double precision) IS 'Computes sample variance'; COMMENT ON COLUMN my_table.my_field IS 'Employee ID number'; COMMENT ON DATABASE my_database IS 'Development Database'; COMMENT ON DOMAIN my_domain IS 'Email Address Domain'; COMMENT ON FUNCTION my_function (timestamp) IS 'Returns Roman Numeral'; COMMENT ON INDEX my_index IS 'Enforces uniqueness on employee id'; COMMENT ON OPERATOR ^ (text, text) IS 'Performs intersection of two texts'; COMMENT ON OPERATOR ^ (NONE, text) IS 'This is a prefix operator on text'; COMMENT ON RULE my_rule ON my_table IS 'Logs UPDATES of employee records'; COMMENT ON SCHEMA my_schema IS 'Departmental data'; COMMENT ON SEQUENCE my_sequence IS 'Used to generate primary keys'; COMMENT ON TABLE my_schema.my_table IS 'Employee Information'; COMMENT ON TRIGGER my_trigger ON my_table IS 'Used for R.I.'; COMMENT ON TYPE complex IS 'Complex Number datatype'; COMMENT ON VIEW my_view IS 'View of departmental costs'; COMPATIBILITY
SQL92 There is no COMMENT in SQL92. SQL - Language Statements 2002-11-22 COMMENT(7)
All times are GMT -4. The time now is 03:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy