database-schema

How to SELECT in Oracle using a DBLINK located in a different schema?

时光毁灭记忆、已成空白 提交于 2019-12-04 00:34:15
We have an Oracle DBMS (11g) and the following configuration: A DB user "MYUSER" Two schemas "MYUSER" and "SCHEMA_B" User "MYUSER" can access "SCHEMA_B" and has READ permissions on its tables A public DB link "DB_LINK" located in "SCHEMA_B" The DB_LINK is working when using the DB user "SCHEMA_B" directly Question : When logged on as "MYUSER", what is the correct syntax to access tables using the DB link of "SCHEMA_B"? Is it possible to do so at all? I already tried several constellations, which all did not work: select * from dual@"DB_LINK" select * from dual@"SCHEMA_B"."DB_LINK" select *

DB Schema for Appointment Booking App: What is the correct relationship between Doctors, Appointments, TimeSlots, Patients?

送分小仙女□ 提交于 2019-12-03 22:46:09
[ UPDATED SCHEMA: http://i.imgur.com/fX9CGNh.png ] I'm tasked with developing an appointment booking system that is designed for a small medical office. It is a Rails 3.2 app. I'm having difficulty designing a database schema that makes sense to me. Question: Given the following information, what is the correct relationship between doctors, patients, appointments, chairs and time_slots? Patients need to make appointments with a doctor's office. Depending on the type of appointment, each appointment is scheduled for one or more adjacent time_slots, and whether or not there can be two

Update Target Button is disabled in Sql Server Database Schema Comparison

为君一笑 提交于 2019-12-03 18:08:08
问题 I use Visual Studio 2013 Professional Update 4 in combination with multiple SQL Server 2012 Enterprise servers/instances. The Idea was to create a Version controlled deployment using a Visual Studio Solution with SQL Server Projects. However for some reason the "Update Target" and "Generate Script" button is disabled. I can update the local database project from the sql server database but the other way around is not working. (see screenshot) Google is not helpful at all although I found a

Create a scalable database schema for storing golf scores

青春壹個敷衍的年華 提交于 2019-12-03 17:28:54
I am trying to design a database to store all my friends and my golf scores. As you probably know, a golf score is comprised of 18 hole individual scores. I can think of two ways to design the schema: Create a table that has one column for each hole (e.g. h1 to h18), the table has FK player_id, round_id and course_id that referenced other tables. It has a total column, which is the sum of columns h1 to h18. If I change a hole score, I will need to manually update total column. Create a table that has a column for hole score, a column for hole index, a column for player_id, course_id, and round

how to get table's schema name

我的未来我决定 提交于 2019-12-03 14:35:02
I'm using SQL Server 2008 and have the following query: SELECT SO1.name AS Tab, SC1.name AS Col, SO2.name AS RefTab, SC2.name AS RefCol, FO.name AS FKName FROM dbo.sysforeignkeys FK INNER JOIN dbo.syscolumns SC1 ON FK.fkeyid = SC1.id AND FK.fkey = SC1.colid INNER JOIN dbo.syscolumns SC2 ON FK.rkeyid = SC2.id AND FK.rkey = SC2.colid INNER JOIN dbo.sysobjects SO1 ON FK.fkeyid = SO1.id INNER JOIN dbo.sysobjects SO2 ON FK.rkeyid = SO2.id INNER JOIN dbo.sysobjects FO ON FK.constid = FO.id How do you retrieve the table's schema name? Thanks for your help gbn Use OBJECT_SCHEMA_NAME SELECT OBJECT

Design users table for single sign in to use across sub domains

邮差的信 提交于 2019-12-03 14:14:29
We have a site which has sub domains like: example.com - Main Site food.example.com fashion.example.com And each domain and sub domain has a different database, like this: exampleDB - Main DB with Users Table foodDB fashionDB What have you tried? Right now, for single sign in we have planned to redirect users in our Main Site for signing up. While order processing in sub domains get the UserID from main DB and store in respective sub domain's Orders table. For reporting purposes we store the UserID without FK constraint in the Orders table since we have separate database. I can see here that

How to model many-to-many relationships in MongoDB (for a MySQL user)

淺唱寂寞╮ 提交于 2019-12-03 12:32:39
I come from a MySQL background and am trying to wrap my head around MongoDB . In particular, I'm struggling to conceptualize how I should model n:n relationships the "Mongo way." For this example, let's say we have two collections : users and interests . We need to be able to represent or query for several things in our data: User's interests User's rating of interest, e.g. "like" or "dislike" Users with a given interest Counter (which can be incremented/decremented) of each rating of the interest Interest name In MySQL , I would have created a users_interests table indexed on both user IDs

List all stored procedures with schema name

左心房为你撑大大i 提交于 2019-12-03 12:10:51
问题 Can anyone advise on a way to list all stored procedures along with their schema names in a database? Thanks! 回答1: SELECT [schema] = OBJECT_SCHEMA_NAME([object_id]), name FROM sys.procedures; or SELECT [schema] = SCHEMA_NAME([schema_id]), name FROM sys.procedures; For a specific database, you can just change the context to that database first, or change Marc's query slightly (my queries are no good in this case because they rely on functions that are context-sensitive): SELECT SchemaName = s

mongoengine - Ignore extra fields for schema validation

有些话、适合烂在心里 提交于 2019-12-03 10:40:27
问题 I am trying to query my database. Some records currently have extra fields that are not included in my model schema (by error, but I want to handle these cases). When I try to query the DB and transform the records into the schema, I get the following error: FieldDoesNotExist The field 'X' does not exist on the document 'Y' Because of the extra fields in the database that differ from the schema. Is there a way to ignore this schema validation for extra fields in mongoengine? 回答1: For ignoring

What is the difference between an Oracle and Microsoft schema?

余生长醉 提交于 2019-12-03 10:35:16
I am working on an enterprise project. Some members of the team have an Oracle background and some have a Microsoft SQL Server background. There is much confusion when we talk about schemas. I am trying to provide some clarity. Is this an accurate way to describe the difference in the meaning of schemas between the two technologies? An Oracle schema is associated with a single user and consists of the objects owned by the user. A MS SQL Server schema is a namespace. Tarzan Oracle schemas are like My Documents folders in the Windows OS. A user can grant permissions to other users to see things