Search Results

Search found 26581 results on 1064 pages for 'multiple tables'.

Page 13/1064 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • SQL - Multiple join conditions using OR?

    - by Brandi
    I have a query that is using multiple joins. The goal is to say "Out of table A, give me all the customer numbers in which you can match table A's EmailAddress with either email_to or email_from of table B. Ignore nulls, internal emails, etc.". It seems like it would be better to use an or condition in the join than multiple joins since it is the same table. When I try to use AND/OR it does not give the behaviour I expect... AND finishes in a reasonable time, but yields no results (I know that there are matches, so it must be some flaw in my logic) and OR never finishes (I have to kill it). Here is example code to illustrate the question: --my original query SELECT DISTINCT a.CustomerNo FROM A a WITH (NOLOCK) LEFT JOIN B e WITH (NOLOCK) ON a.EmailAddress = e.email_from RIGHT JOIN B f WITH (NOLOCK) ON a.EmailAddress = f.email_to WHERE a.EmailAddress NOT LIKE '%@mydomain.___' AND a.EmailAddress IS NOT NULL AND (e.email_from IS NOT NULL OR f.email_to IS NOT NULL) Here is what I tried, (I am attempting logical equivalence): SELECT DISTINCT a.CustomerNo FROM A a WITH (NOLOCK) LEFT JOIN B e WITH (NOLOCK) ON a.EmailAddress = e.email_from OR a.EmailAddress = e.email_to WHERE a.EmailAddress NOT LIKE '%@mydomain.___' AND a.EmailAddress IS NOT NULL AND (e.email_from IS NOT NULL OR e.email_to IS NOT NULL) So my question is two-fold: Why does having AND in the above query work in a few seconds and OR goes for minutes and never completes? What am I missing to make a logically equivalent statement that has only one join?

    Read the article

  • Single website multiple connection strings using asp mvc 2 and nhibernate

    - by jjjjj
    Hi In my website i use ASP MVC 2 + Fluent NHibernate as orm, StructureMap for IoC container. There are several databases with identical metadata(and so entities and mappings are the same). On LogOn page user fiils in login, password, rememberme and chooses his server from dropdownlist (in fact he chooses database). Web.config contains all connstrings and we can assume that they won't be changed in run-time. I suppose that it is required to have one session factory per database. Before using multiple databases, i loaded classes to my StructureMap ObjectFactory in Application_Start ObjectFactory.Initialize(init => init.AddRegistry<ObjectRegistry>()); ObjectFactory.Configure(conf => conf.AddRegistry<NhibernateRegistry>()); NhibernateRegistry class: public class NhibernateRegistry : Registry { public NhibernateRegistry() { var sessionFactory = NhibernateConfiguration.Configuration.BuildSessionFactory(); For<Configuration>().Singleton().Use( NhibernateConfiguration.Configuration); For<ISessionFactory>().Singleton().Use(sessionFactory); For<ISession>().HybridHttpOrThreadLocalScoped().Use( ctx => ctx.GetInstance<ISessionFactory>().GetCurrentSession()); } } In Application_BeginRequest i bind opened nhibernate session to asp session(nhibernate session per request) and in EndRequest i unbind them: protected void Application_BeginRequest( object sender, EventArgs e) { CurrentSessionContext.Bind(ObjectFactory.GetInstance<ISessionFactory>().OpenSession()); } Q1: How can i realize what SessionFactory should i use according to authenticated user? is it something like UserData filled with database name (i use simple FormsAuthentication) For logging i use log4net, namely AdoNetAppender which contains connectionString(in xml, of course). Q2: How can i manage multiple connection strings for this database appender, so logs would be written to current database? I have no idea how to do that except changing xml all the time and reseting xml configuration, but its really bad solution.

    Read the article

  • .net printing multiple reports in one document (architecture question)

    - by LawsonM
    I understand how to print a single document via the PrintDocument class. However, I want to print multiple reports in one document. Each "report" will consist of charts, tables, etc. I want to have two reports per page. I've studied the few examples I can find on how to combine multiple documents into one; however, they always seem to work by creating a collection of objects (e.g. customer or order) that are then iterated over and drawn in the OnPrintPage method. My problem and hence the "architecture" question is that I don't want to cache the objects required to produce the report since they are very large and memory intensive. I'd simply like the resulting "report". One thought I had was to print the report to a metafile, cache that instead in a "MultiplePrintDocument" class and then position those images appropriately two to a page in the OnPrintPage method. I think this would be a lot more efficient and scalable in my case. But I'm not a professional programmer and can't figure out if I'm barking up the wrong tree here. I think the Graphics.BeginContainer and Graphics.Save methods might be relevant, but can't figure out how to implement or if there is a better way. Any pointers would be greatly appreciated.

    Read the article

  • Sql Server 2005 multiple insert with c#

    - by bottlenecked
    Hello. I have a class named Entry declared like this: class Entry{ string Id {get;set;} string Name {get;set;} } and then a method that will accept multiple such Entry objects for insertion into the database using ADO.NET: static void InsertEntries(IEnumerable<Entry> entries){ //build a SqlCommand object using(SqlCommand cmd = new SqlCommand()){ ... const string refcmdText = "INSERT INTO Entries (id, name) VALUES (@id{0},@name{0});"; int count = 0; string query = string.Empty; //build a large query foreach(var entry in entries){ query += string.Format(refcmdText, count); cmd.Parameters.AddWithValue(string.Format("@id{0}",count), entry.Id); cmd.Parameters.AddWithValue(string.Format("@name{0}",count), entry.Name); count++; } cmd.CommandText=query; //and then execute the command ... } } And my question is this: should I keep using the above way of sending multiple insert statements (build a giant string of insert statements and their parameters and send it over the network), or should I keep an open connection and send a single insert statement for each Entry like this: using(SqlCommand cmd = new SqlCommand(){ using(SqlConnection conn = new SqlConnection(){ //assign connection string and open connection ... cmd.Connection = conn; foreach(var entry in entries){ cmd.CommandText= "INSERT INTO Entries (id, name) VALUES (@id,@name);"; cmd.Parameters.AddWithValue("@id", entry.Id); cmd.Parameters.AddWithValue("@name", entry.Name); cmd.ExecuteNonQuery(); } } } What do you think? Will there be a performance difference in the Sql Server between the two? Are there any other consequences I should be aware of? Thank you for your time!

    Read the article

  • How to prevent multiple definitions in C?

    - by Jordi
    I'm a C newbie and I was just trying to write a console application with Code::Blocks. Here's the (simplified) code: main.c: #include <stdio.h> #include <stdlib.h> #include "test.c" // include not necessary for error in Code::Blocks int main() { //t = test(); // calling of method also not necessary return 0; } test.c: void test() {} When I try to build this program, it gives the following errors: *path*\test.c|1|multiple definition of `_ test'| obj\Debug\main.o:*path*\test.c|1|first defined here| There is no way that I'm multiply defining test (although I don't know where the underscore is coming from) and it seems highly unlikely that the definition is somehow included twice. This is all the code there is. I've ruled out that this error is due to some naming conflict with other functions or files being called test or test.c. Note that the multiple and the first definition are on the same line in the same file. Does anyone know what is causing this and what I can do about it? Thanks!

    Read the article

  • Oracle 11gR2 exp does not export some tables

    - by Tilo Prütz
    I have an Oracle 11g (11.2.0.1) Database running on Linux (x64). Within the database I have a schema and 33 tables for it. When I log in via sqlplus I can list all the tables via SELECT OBJECT_NAME FROM USER_OBJECTS WHERE OBJECT_TYPE = 'TABLE'; But when I export the Tablespace using exp ... BUFFER=65536 FULL=N COMPRESS=N CONSISTENT=Y TABLESPACES=... FILE=... Then it only exports 24 of the 33 tables. I have tried to export the missing tables via exp ... TABLES=<missing_table> ... But then I get an error: EXP-00011: NPSMIGRO2_CM.DEFAULT_USR_ATTR_VALUES does not exist How can I find out what's wrong here? How can I export all the tables?

    Read the article

  • MySQL Privileges required to GRANT EVENT, EXECUTE, LOCK TABLES, and TRIGGER

    - by Brad
    I have an account, user_a, and I would like to grant all available permissions on some_db to user_b. I have tried the following query: GRANT ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE VIEW, DELETE, DROP, EVENT, EXECUTE, INDEX, INSERT, LOCK TABLES, REFERENCES, SELECT, SHOW VIEW, TRIGGER, UPDATE ON `some_db`.* TO 'user_b'@'%' WITH GRANT OPTION The result: Access denied for user 'user_a'@'%' to database 'some_db' Some experimentation has shown me that the only permissions my account (user_a) is unable to grant are EVENT, EXECUTE, LOCK TABLES, and TRIGGER. What privileges are required for my account to GRANT these privileges to another user? If I run SHOW GRANTS, I get this output: "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'user_a'@'%' IDENTIFIED BY PASSWORD '1234567890abcdef' WITH GRANT OPTION" "GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE ON `some_other_unrelated_db`.* TO 'user_a'@'%'" "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE ON `another_unrelated_db`.* TO 'user_a'@'%' WITH GRANT OPTION"

    Read the article

  • Existing tables with binaries to use filestream

    - by user1098487
    I've got a few tables for which I want to use filestream storage. These tables already contain binary data and have rowguids. However at the time they were were created, the tables were not added to a filestream enabled filegroup. What is the best way to have these tables use filestream at this point? Do I need to drop + recreate the tables and migrate the data? Is there an easier way? The database already has filestream enabled and there are other tables which are using them.

    Read the article

  • MEF Constructor Parameters with Multiple Constructors

    - by InterWAS
    Hi, i starting to use MEF, and i have a class with multiple constructors, like this: [Export(typeof(ifoo))] class foo : ifoo { void foo() { ... } [ImportingConstructor] void foo(object par1) { ... } } Everthing works fine, except that the 2nd constructor is never called, i am using catalog.ComposeExportedValue() when composing, what's wrong?

    Read the article

  • Best way to generate report using multiple databases

    - by Vinaaven
    Hi All, I am new to the reporting world. Wanted to know which is the right solution to about for generating a single report by querying for data from multiple databases. We are planning to use some reporting solution like Jasper Reports or BIRT. Generally the databases are going to be postgresql. Please do feel free to let me know about any other better solutions as well. Thanks.

    Read the article

  • Multiple IDE project files

    - by TomWij
    We are currently working in a team where we use both Visual Studio and Code::Blocks, is there a way to replicate changes between those project files? So if one adds a file to the project file it will also get adjusted in the project file of the other IDE? Please note: We want our project to work on multiple IDE's, platforms and compilers. Thus a general solution is welcome too.

    Read the article

  • Customising Silverlight AutoCompleteBox with multiple filtered ListBoxes

    - by ianbeks
    Hi, How should I go about customising the AutoCompleteBox in Silverlight so that while typing I can filter multiple Selector ListBoxes. Basically I want a Popup that contains 'n' ListBoxes vertically stacked and when I type, the filtering operates on all of them simultaneously. I can then select an item from any of the ListBoxes. Thanks in advance for any guidance you may have. Beks

    Read the article

  • Real time SQL database updates between multiple VB.NET clients

    - by Marcel
    Hi, I hope somebody can help me out on this question. I'm using a SQL database and I'm writing a VB.NET client application. This application is used on multiple computers at the same time. If one of the clients makes an update to the database I would like to have the other clients to be aware of the update. Has ony one already done this before? Thank you very much! Marcel

    Read the article

  • Animating multiple UIViews at once using CoreAnimation

    - by Thomas
    Hi, I'm using a UIImageView as a background-image and placed multiple UIButtons on it. Now I want to move the UIImageView (with all the buttons on it) out of sight with a smooth animation. I couldn't find a container or grouping element in IB, so is there a way to move all the Views at once? Thank you in advance and sorry for my english!

    Read the article

  • How to add a Drupal CCK Custom Field which supports unique identification of multiple values

    - by jtw12
    I need to create a custom field that supports multiple values which can be uniquely identified (beyond the delta field which changes when the values are re-ordered). I have created a module for the field and specified the two database columns that I would like CCK to use (one for the value and one for the ID) but I am not sure where the entry point is for adding in a unique id for each value (probably will just take the id from a sequence).

    Read the article

  • Firebird multiple statements

    - by Aldo
    Hello, is there any way to execute multiple statements (none of which will have to return anything) on Firebird? Like importing a SQL file and executing it. I've been looking for a while and couldn't find anything for this.

    Read the article

  • Multiple Jquery modal Dialog Boxes in one page?

    - by Ryan Max
    Hi, I am brand stinking new to jquery and attempting to have a "Services" page for a tech website I am working on. I am having trouble with different services opening the same info in the window. Basically I am using the code straight from the demo. Any ideas on how to have multiple windows in the same page? Thanks!

    Read the article

  • Documenting PHP multiple inheritance with PhpDoc

    - by Sam Dark
    I have multiple inheritance like this one: http://stackoverflow.com/questions/356128/can-i-extend-a-class-using-more-than-1-class-in-php (let's not discuss this approach itself please) and want my IDE to know about inherited class methods and properties. Is there a way to do it with PhpDoc?

    Read the article

  • multiple class inheritance

    - by redcoder
    In PHP, is it possible to have multiple inheritance (by the nature of the PHP, not writting modification code) ? example : class a { public function foo(); } class b { public function bar(); } class c extends a, b { public function baz(); }

    Read the article

  • mysql multiple insert - what happens on error?

    - by aviv
    What happens in mysql multiple records insert during an error. I have a table: id | value 2 | 100 UNIQUE(id) Now i try to execute the query: INSERT INTO table(id, value) VALUES (1,10),(2,20),(3,30) I will get a duplicate-key error for the (2,20) BUT... Will the (1,10) get into the database? Will the (3,30) get into the database?

    Read the article

  • C# - Sharing static data between multiple processes

    - by Murtaza Mandvi
    I have a WCF service (instantiated within a Console application on NetTCP), this service has static data (large volume) which gets instantiated on the load. I have multiple instances of this Console application running at once, and all of them are doing the same static data initialization , is there a way that I can have a single data source and share the data among processes so that each process does not have to consume large amount of memory?

    Read the article

  • C# multiple asynchronous HttpRequest with one callback

    - by aepheus
    I want to make 10 asynchronous http requests at once and only process the results when all have completed and in a single callback function. I also do not want to block any threads using WaitAll (it is my understanding that WaitAll blocks until all are complete). I think I want to make a custom IAsyncResult which will handle multiple calls. Am I on the right track? Are there any good resources or examples out there that describe handling this?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >