Search Results

Search found 10101 results on 405 pages for 'temporary tables'.

Page 132/405 | < Previous Page | 128 129 130 131 132 133 134 135 136 137 138 139  | Next Page >

  • MySQL stored procedure to INSERT DELAYED but CREATE TABLE first if needed?

    - by dkamins
    I'm planning on doing a lot of INSERT DELAYED into MyISAM tables. But the tables might not exist yet. Let's say e.g. a new table will exist for each day. So instead of detecting absence of table in my client and creating then retrying the insert, it seems like a good case for a stored procedure ("function"). Is this possible, and what would it look like? Are there any downsides to this approach?

    Read the article

  • Query for multiple joins

    - by Shailaja
    i have 3 tables named dataset,dataelem and transformdataelem with column names as below: main.Dataset ------------ datasetID (PK) applicationID main.Dataelem ------------- dataelemID(PK) datasetID(FK) dataelemname biztermID main.Transformdataelem ---------------------- OutputdataelemID InputdataelemID My requirement is: All tables are referenced. Extract all the dataelemId rows from dataelem table where applicationID of dataset table is equal to 1044 and biztermid shud be null. Then whatever resultant dataelemIDs from the above query should be matched with outputdataelemID of Transformdataelem table and we shud get the respective input dataelemId's. Again with these matched inputdataelemID's we shud get the dataelemname's from datelem table.

    Read the article

  • need help in aggregate select

    - by eugeneK
    Hi, i have a problem with selecting some values from my DB. DB is in design stages so i can redesign it a bit of needed. You can see the Diagram on this image Basically what i want to select is select c.campaignID, ct.campaignTypeName, c.campaignName, c.campaignDailyBudget, c.campaignTotalBudget, c.campaignCPC, c.date, cs.campaignStatusName ***impressions, ***clicks, ***cast(campaignTotalBudget-(clicks*campaignCPC) as decimal(18,1)) as remainingFunds from Campaigns as c left join CampaignTypes as ct on c.campaignTypeID=ct.campaignTypeID left join CampaignStatuses as cs on c.campaignStatusID=cs.campaignStatusID left join CampaignVariants as cv on c.campaignID=cv.campaignID left join CampaignVariants2Visitors as c2v on cv.campaignVariantID=c2v.campaignVariantID left join Visitors as v on c2v.visitorID=v.visitorID ..... order by c.campaignID desc Problem is that Visitors table has column named isClick so i don't know the way to separate what is impression with isClick=false and what is click isClick=true so i can show nice form with all the stuff about campaign and visitors... I don't think to split Visitors to two tables like Impressions and Click is a good idea because again i would need to have Visitors with two more tables thanks

    Read the article

  • Use LINQ to insert data from dataset to SQL

    - by Mayo
    Let's say I have a dataset in an ASP.NET website (.NET 3.5) with 5 tables, each has roughly 30,000 rows and an average of 12 columns. I want to insert all of the data from the dataset into 5 very-similar-but-not-quite-identical tables in SQL Server 2008. I also want to use LINQ (personal preference - trying to learn something new). Is it as simple as iterating through the dataset and, for each row, creating a new instance of the associated class, initializing its data with the dataset's row, adding it to the data model, and then doing one giant SubmitChanges at the end? Are there better ways of doing this with LINQ? Or is this the de-facto standard?

    Read the article

  • How can I create a cron job that runs a task every three weeks?

    - by itj
    I have a task that needs to be performed on my project schedule (3 weeks). I'm able to set up cron to do this every week, or (for example) on the 3rd week of every month - but can't find a way to do this every three weeks. I could hack the script to create temporary files (or similar) so it could work out it was the third time it has been run - but this solution smells. Can it be done in a clean way?

    Read the article

  • Storing dates i Train schedule MYSQL

    - by App_beginner
    Hi I have created a train schedule database in MYSQL. There are several thousand routes for each day. But with a few exceptions most of the routes are similar for every working day, but differ on weekends. At this time I basically update my SQL tables at midnight each day, to get the departures for the next 24 hours. This is however very inconvenient. So I need a way to store dates in my tables so I don't have to do this every day. I tried to create a separate table where I stored dates for each routenumber (routenumbers are resetted each day), but this made my query so slow that it was impossible to use. Does this mean I would have to store my departure and arrival times as datetimes? In that case the main table containing routes would have several million entries. Or is there another way? My routetable looks like this: StnCode (referenced in seperate Station table) DepTime ArrTime Routenumber legNumber

    Read the article

  • Best way to order by columns in relationships?

    - by Timmy
    im using sqlalchemy, and i have a few polymorphic tables, and i want to sort by a column in one of the relationship. i have tables a,b,c,d, with relationship a to b, b to c, c to d. a to b is one-to-many b to c and c to d are one-to-one, but polymorphic. given an item in table a, i will have a list of items b, c, d (all one to one). how do i use sqlalchemy to sort them by a column in table d?

    Read the article

  • Export XML with only one MySQL request ?

    - by mere-teresa
    I want to export in XML format some data from 7 tables (MySQL database), and then I want to import in another database. And I have a update or insert rule for data. I already have a SQL query retrieving all data, with JOINs on my 7 tables. But...when I try to put data in XML format, I reach a limit. My PHP loop can catch each row, but I would like to benefit from hierachical structure of the XML, and all I have are rows with the same data repeated. It is better to query once and to construct the XML tree in PHP or to query each time I want access to a lower level ?

    Read the article

  • Small Business Server 2011 and Remote access to documents

    - by Tim Long
    Assume I'm working away from the office; its a hotel computer Windows 7, Office 2010 and fast - so the best possible conditions. Using Companyweb - Every time I open a document, I have to go through the logon process - seems odd to have to do that. Is this a 'by design' feature or is something wrong with my configuration? When I do open the documents, are they being stored somewhere locally and should I be looking to delete on this computer - or are they in a temporary file?

    Read the article

  • Change master table PK and update related table FK (changing PK from Autoincrement to UUID on Mysql)

    - by eleonzx
    I have two related tables: Groups and Clients. Clients belongs to Groups so I have a foreign key "group_id" that references the group a client belongs to. I'm changing the Group id from an autoincrement to a UUID. So what I need is to generate a UUID for each Group and update the Clients table at once to reflect the changes and keep the records related. Is there a way to do this with multiple-table update on MySQL? Adding tables definitions for clarification. CREATE TABLE `groups` ( `id` char(36) NOT NULL, `name` varchar(255) DEFAULT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$ CREATE TABLE `clients` ( `id` char(36) NOT NULL, `name` varchar(255) NOT NULL, `group_id` char(36) DEFAULT NULL, `active` tinyint(1) DEFAULT '1' PRIMARY KEY (`id`), KEY `fkgp` (`group_id`), CONSTRAINT `fkgp` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$

    Read the article

  • Way to check for foreign key references before deleting in MySQL?

    - by Chad Johnson
    I'm working with a content management system, and users are prompted with a confirmation screen before deleting records. Some records are foreign key referenced in other tables, and therefore they cannot be deleted. I would like to display a message beside a given record if it has foreign key references. To know whether I should display the message for a record, I could just query the referencing table and see if there are references. But the problem is, there are about a dozen tables with records potentially referencing this record, and a lookup could take a "long" time. Is there an easy way to tell whether the record is delete-ready (ie. has no foreign key references)?

    Read the article

  • Does database affect classes?

    - by satyanarayana
    I had created one class User and UserDAOImpl class for querying DB using class User. As there is one table to be queried, these two classes are sufficient for me. What if there is a case where new fields are to be added to that one table is to be divided into 3 tables( user_info, user_profile and user_address) to store user? As new fields are added, I need to change classes User and UserDAOImpl, it seems these two are not sufficient. It seems database changes affect my classes. In this case, do I need to divide class User into 3 classes as tables are changes? Can any one suggest me how can I solve this without making too many changes?

    Read the article

  • how to implement inheritance in hibernate ??

    - by user359057
    Hi guys i am working in a web application. I have a entities as BaseEntity --Which contains user login info like createdBy,createdTime,EditedBy,editedTime Employee -- which contains employee information like name,address,etc... RegularEmployee --which contains salary ,bonus tht kind of fields and ContactEmployee -- which contains HourlyRate,contactPeriod etc.... My inheritance structure is BaseEntity <--- Employee <---- RegularEmployee (i.e. Employee extends BaseEntity and RegularEmployee extends Employee ContractEmployee also extend Employee Class ). How to design database structure in this case considering all the tables have id and version fields (all tables should at least have these two fields).

    Read the article

  • What table is affected by delete when form based on query?

    - by webworm
    In MS Access 2003 I have a form whose record source is equal to a query that involves an INNER JOIN. The join is between a location table and a container table. Containers are objects that are stored in specific locations each location and container are specified by ID values. SELECT DISTINCTROW Container.Container_ID, Location.Location_ID FROM Location INNER JOIN Container ON Location.[Location_ID] = Container.[Location_ID] What I am trying to figure out is this …. When I delete a record (using the form navigation controls) in the form based on the above query which tables are affected? Are records in the Container and Location tables deleted or is it just in the location table? Thanks!

    Read the article

  • Can you automatically remove characters from entities created?

    - by JamesStuddart
    Hi, In my sql database I have tables with name which include underscores, for readability. Just to try and make it clearer see below: TableFoo TableFoo_TableBah Where TableFoo has a key linking to TableFoo_TableBah, this is done so you can quickly see what the table TableBah relates to. I have used this naming convention before with tools such as CodeSmith which give the option to remove the underscores, but I cannot see how to do this in Entity Framework 4. Is there a way to do this, or am I stuck with either renaming my tables or having objets such as TableFoo_TableBah? Thanks,

    Read the article

  • Get information from a higher class?

    - by Clint Davis
    I don't know really how to word the question so please bear with me... I have 3 classes: Server, Database, and Table. Each class has a "Name" property. How I want it to work is that each server can have multiple databases and each database can have multiple tables. So in the Server class I have this property. Private _databases As List(Of Database) Public Property Databases() As List(Of Database) Get Return _databases End Get Set(ByVal value As List(Of Database)) _databases = value End Set End Property And I have something similar in the Database class for the tables. This works fine now because I can do something like this to get all the databases in the server. For Each db In s.Databases 's being the server object Debug.Print(db.Name) Next I would like to expand these classes. I want the server class to handle all the connection information and I would like the other classes to use the server class's connection information in them. For example, I setup a server class and set the connection string to the server. Then I want the database class to use serverclass.connectionstring property to connect to the server and get a list of all the databases. But I want to keep that code in the database class. How can I do this? I've attached some code of what I want to do. Public Class Server Private _name As String Public Property Name() As String Get Return _name End Get Set(ByVal value As String) _name = value End Set End Property Private _databases As List(Of Database) Public Property Databases() As List(Of Database) Get Return _databases End Get Set(ByVal value As List(Of Database)) _databases = value End Set End Property End Class '-----New class Public Class Database Private _name As String Public Property Name() As String Get Return _name End Get Set(ByVal value As String) _name = value End Set End Property Private _tables As List(Of Table) Public Property Tables() As List(Of Table) Get Return _tables End Get Set(ByVal value As List(Of Table)) _tables = value End Set End Property 'This is where I need help! Private Sub LoadTables () dim connectionstring as string = server.connectionstring 'Possible? 'Do database stuff End Class Thanks for reading!

    Read the article

  • looking for RTF template system with simple DSL

    - by 01
    Is there any framework that fills up rtf document with data? The idea is to make business people/testers change the document in MsWord and than generate reports from that. The problem is with tables, Id need to create some special DSL for handling tables and showing hidding text/page parts. Id rather not do that and use some existing solution. I tried to search for something, but I only found frameworks that can produce rtf output from xml input and i want to use rtf as input and output.

    Read the article

  • Designing Relational Survey Questionnaires Database

    - by user1213055
    I'm trying to build a simple sql database for following access database. Currently there is no relationship and I just have two tables male and female with 6 sections in each form. How can I design it a better way so end user can connect to the database and analyze using STATA or SPSS ? I'm really confused whether I should create one table with all fields or break down into different tables. The database is specific to this study only so I'm not looking for a generic survey database where user can create surveys and capture them. Any feedback or suggestion is much appreciated.

    Read the article

  • Customers and suppliers database design issue

    - by hectorsq
    I am developing a web application in which I will have customers and suppliers. Initially I thought on using a Customers table and a Suppliers table. Then when I was thinking on bank transactions, I noticed that each transaction needs to refer to a customer or a supplier, so I thought on using a single table named Business in which I will save both customers and suppliers. If I use Customers and Suppliers tables when I want to list the bank transactions I will have to search in both tables to get the company name. If I use a Businesses table I will have to use a business type column, and have the union of possible fields for all businesses types. Any suggestions on the design?

    Read the article

  • Will a source-removal sort always return a maximal cycle?

    - by Jason Baker
    I wrote a source-removal algorithm to sort some dependencies between tables in our database, and it turns out we have a cycle. For simplicity, let's say we have tables A, B, C, and D. The edges are like this: (A, B) (B, A) (B, C) (C, D) (D, A) As you can see, there are two cycles here. One is between A and B and another is between all four of them. Will this type of sort always choke on the largest cycle? Or is that not necessarily the case?

    Read the article

  • allow only distinct values in ComboBox

    - by Ravinder Gangadher
    In my project, I am trying to populate ComboBox from DataSet. I succeeded in populating but the values inside the ComboBox are not distinct (Because it just showing the values present in DataSet). I cant bind the ComboBox to DataSet because I am adding "Select" text at first of populating the values. Here is my code. ComboBox --> cmb DataSet --> ds DataSet Column Name --> value(string) cmb.Items.Clear(); cmb.Items.Add("Select"); for (int intCount = 0; intCount < ds.Tables[0].Rows.Count; intCount++) { cmb.Items.Add(ds.Tables[0].Rows[intCount][value].ToString()); } cmb.SelectedIndex = 0; My question is how to allow distinct values (or restrict duplicate values) inside the ComboBox.

    Read the article

  • Offline database access

    - by dtech
    I have a small application which basically consists of an user-friendly CRUD interface to a few tables (and joined tables) It currently works with a MySQL database but I would like to make it available offline. My first thought was to create a SQLite "buffer" in between the MySQL database and the application, e.g. by executing all queries on the SQLite but also storing them in a log table so that they can be executed later in the main database with very basic conflict resolution (I will basically let the user solve it if a conflict is detected) Due to the simplicity of the application this shouldn't be too difficult and good exercise, but I think I would be re-inventing the wheel. So my question is: are there existing solutions or other approaches for this problem?

    Read the article

  • Is it possible to create an enum whose instance can't be created but can be used for readonly purpos

    - by Shantanu Gupta
    I created an enum where I stored some table names. I want it to be used to get the name of the table like ds.Tables[BGuestInfo.TableName.L_GUEST_TYPE.ToString()]. public class a { public enum TableName : byte { L_GUEST_TYPE = 0 ,L_AGE_GROUP = 1 ,M_COMPANY = 2 ,L_COUNTRY = 3 ,L_EYE_COLOR = 4 ,L_GENDER = 5 ,L_HAIR_COLOR = 6 ,L_STATE_PROVINCE = 7 ,L_STATUS = 8 ,L_TITLE = 9 ,M_TOWER = 10 ,L_CITY = 11 ,L_REGISTER_TYPE = 12 } } class b { a.TableName x; //trying to restrict this ds.Tables[a.TableName.L_GUEST_TYPE] //accessible and can be used like this } This is my enum. Now I have not created any instance of this enum so that no one can use it for other than read only purpose. For this enum to be accessible in outer classes as well I have to make it public which means some outer class can create its object as well. So what can i do so as to restrict its instance creation.

    Read the article

< Previous Page | 128 129 130 131 132 133 134 135 136 137 138 139  | Next Page >