Search Results

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

Page 19/405 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • How to create multiple tables with the same schema using SQLite jdbc

    - by Space_C0wb0y
    I want to split a large table horizontally, and I would like to make sure that all three of them have the same schema. Currently I am using this piece of code to create the tables: statement .executeUpdate("CREATE TABLE AnnotationsMolecularFunction (Id INTEGER PRIMARY KEY ASC AUTOINCREMENT, " + "ProteinId NOT NULL, " + "GOId NOT NULL, " + "UNIQUE (ProteinId, GOId)" + "FOREIGN KEY(ProteinId) REFERENCES Protein(Id))"); There is one such statement for each table. This is bad, because if I decide to change the schema later (which will most certainly happen), I will have to change it three times, which begs for errors, so I would like a way to make sure that the other tables have the same schema without explicitly writing it again. I can use: statement .executeUpdate("CREATE TABLE AnnotationsBiologicalProcess AS SELECT * FROM AnnotationsMolecularFunction"); to create the other tables with the same columns, but the constraints are not aplied. I could of course just generate the same query-string three times with different table-names in Java, but I would like to know if there is an SQL-way of achieving this.

    Read the article

  • How to merge two tables based on common column and sort the results by date

    - by techiepark
    Hello friends, I have two mysql tables and i want to merge the results of these two tables based on the common column rev_id. The merged results should be sorted by the date of two tables. Please help me. CREATE TABLE `reply` ( `id` int(3) NOT NULL auto_increment, `name` varchar(25) NOT NULL default '', `member_id` varchar(45) NOT NULL, `rev_id` int(3) NOT NULL default '0', `description` text, `post_date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `flag` char(2) NOT NULL default 'N', PRIMARY KEY (`id`), KEY `member_id` (`member_id`) ) ENGINE=MyISAM; CREATE TABLE `comment` ( `com_id` int(8) NOT NULL auto_increment, `rev_id` int(5) NOT NULL default '0', `member_id` varchar(50) NOT NULL, `comm_desc` text NOT NULL, `date_created` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`com_id`), KEY `member_id` (`member_id`) ) ENGINE=MyISAM;

    Read the article

  • Union on two tables with a where clause in the one

    - by Lostdrifter
    Currently I have 2 tables, both of the tables have the same structure and are going to be used in a web application. the two tables are production and temp. The temp table contains one additional column called [signed up]. Currently I generate a single list using two columns that are found in each table (recno and name). Using these two fields I'm able to support my web application search function. Now what I need to do is support limiting the amount of items that can be used in the search on the second table. the reason for this is become once a person is "signed up" a similar record is created in the production table and will have its own recno. doing: Select recno, name from production UNION ALL Select recno, name from temp ...will show me everyone. I have tried: Select recno, name from production UNION ALL Select recno, name from temp WHERE signup <> 'Y' But this returns nothing? Can anyone help?

    Read the article

  • SQL joining 3 tables when 1 table is emty

    - by AdRock
    I am trying to write a query that connects 3 tables. The first table is info about each festival The second table is the number of votes for each festival The third table is reviews for each festival I want to join all 3 tables so i get all the feilds from table1, join table1 with table2 on the festivalid but i also need to count the number of records in table 3 that applys to each festival. The first 2 tables give me a result becuase they both have data in them but table 3 is empty becuase there are no reviews yet so adding that to my query fives me no results SELECT f.*, v.total, v.votes, v.festivalid, r.reviewcount as count FROM festivals f INNER JOIN vote v ON f.festivalid = v.festivalid INNER JOIN (SELECT festivalid, count(*) as reviewcount FROM reviews) GROUP BY festivalid) as r on r.festivalid = v.festivalid

    Read the article

  • Storing Tables of Information on the Android Platform.

    - by Tarmon
    I have about twenty pages of information that is stored in tables that needs to be stored in my Android application. Each column is a designated stop on a bus route and the column is filled with times that the bus will be at the stop. There is also certain information that needs to be associated with some times, such as if the bus is handicap accessible at a certain time. Here is an example of one of the tables: Bus Times I have thought about using a SQL lite as that seems as though it would be able to store these tables quite easily; but when I think of using SQL I think of dynamic data storage and this shouldn't be changing more than once a year. Is SQL appropriate for this application? Is there a better way to do this? Thanks, Rob

    Read the article

  • Rails Unit Testing with MyISAM Tables

    - by tadman
    I've got an application that requires the use of MyISAM on a few tables, but the rest are the traditional InnoDB type. The application itself is not concerned with transactions where it applies to these records, but performance is a concern. The Rails testing environment assumes the engine used is transactional, though, so when the test database is generated from the schema.rb it is imported with the same engine. Is it possible to over-ride this behaviour in a simple manner? I've resorted to an awful hack to ensure the tables are the correct type by appending this to test_helper.rb: (ActiveRecord::Base.connection.select_values("SHOW TABLES") - %w[ schema_info ]).each do |table_name| ActiveRecord::Base.connection.execute("ALTER TABLE `#{table_name}` ENGINE=InnoDB") end Is there a better way to make a MyISAM-backed model be testable?

    Read the article

  • How to combine 12 tables with some different and some same fields

    - by Deven
    Hi friends i am having problem in joining tables in oracle my tables are shown bellow table1 looks like id Name Jan 7001 Deven 22 7002 Clause 55 7004 Monish 11 7010 Dipesh 55 7070 Dipika 100 table2 looks like id Name Feb 7001 Deven 12 7002 Clause 15 7003 Nimesh 20 7004 Monish 21 7005 Ritesh 22 table 3 looks like id Name Mar 7001 Deven 122 7020 Chalse 155 7003 Nimesh 88 7033 Monica 217 7070 Dipika 180 like this i am having 12 tables from january to December hwo can i combine this and get out put like bellow table2 looks like id Name Jan Feb Mar ...................... Dec 7001 Deven 22 12 122 7002 Clause 55 15 - .......................- 7003 Nimesh - 20 88 .......................2 7004 Monish 11 21 - .......................- 7005 Ritesh - 22 - .......................20 7010 Dipesh 55 - - .......................- 7020 Chalse - - 155 .......................- 7033 Monica - - 217 .......................100 7070 Dipika 100 - - .......................-

    Read the article

  • Two Tables Serving as one Model in Rails

    - by matsko
    Is is possible in rails to setup on model which is dependant on a join from two tables? This would mean that for the the model record to be found/updated/destroyed there would need to be both records in both database tables linked together in a join. The model would just be all the columns of both tables wrapped together which may then be used for the forms and so on. This way when the model gets created/updated it is just one form variable hash that gets applied to the model? Is this possible in Rails 2 or 3?

    Read the article

  • Loading tables dynamically with NHibernate

    - by Trevor Goertzen
    I'm working on a project that requires me to load tables based on table names stored in another table. More tables will be added to the DB (and by someone else), so creating NHibernate mapping files for each table isn't an option. Does anyone know if it is possible to load tables dynamically using NHibernate? Edit: I should add that I'm on .NET 2.0, so I can't use Fluent NHibernate. Thanks for the suggestion though guys. I will use that as evidence in convincing my associates to upgrade.

    Read the article

  • How to send html form data from one form to multiple database tables

    - by user1701556
    I am able to send html form data to database using hibernate. I am using mySQL, Hibernate, Java 1.6, Spriong 3.0. But I would like to send that same data to multiple tables in the database. My issue is that I want to use only one html form not multiple html form. I have these tables: name, address, email, login, phone_num. From this one html form I want data to go to different tables depending on what the data is. I want to do it using Hibernate so that I am not manually taking form data and inserting it in the database. Please let me know if this is possible.

    Read the article

  • DAO design pattern and using it across multiple tables

    - by Casey
    I'm looking for feedback on the Data Access Object design pattern and using it when you have to access data across multiple tables. It seems like that pattern, which has a DAO for each table along with a Data Transfer Object (DTO) that represents a single row, isn't too useful for when dealing with data from multiple tables. I was thinking about creating a composite DAO and corresponding DTO that would return the result of, let's say performing a join on two tables. This way I can use SQL to grab all the data instead of first grabbing data from one using one DAO and than the second table using the second DAO, and than composing them together in Java. Is there a better solution? And no, I'm not able to move to Hibernate or another ORM tool at the moment. Just straight JDBC for this project.

    Read the article

  • many to many tables linked to grid view

    - by yousof
    i have web page that save data for stores, these stores have activities i want to determine the activities for those stores. this reason i make three tables: first one is : tbOLActivity has fields: ActivityId int (pk), ActivityName nvarchar(50) second one is : tbOLStore has fields: StoreId int (pk), StoreName nvarchar(50), ActivityId int (fk), Address navrchar(50) therd one is: tbOLStoreActivty has fields : SerialNo int (pk), StoreId int (fk), ActivityId int (fk), Activity_Status int i make combobox in web page called "AcivityCombo" to display the data of tbOLActivity table If CtvAct.GetRecords("Fill_ActivityTb") = True Then AcivityCombo.DataSource = CtvAct.MainDataset.Tables("tbOLActivity").DefaultView AcivityCombo.DataTextField = "ActivityName" AcivityCombo.DataValueField = "ActivityId" AcivityCombo.DataBind() the problem is how to select item from this combo and insert it into gridview then save data into the tables

    Read the article

  • SQL Filter Multiple Tables Data

    - by Brad
    If it matters, I'm using Firebird 2.1 database. I have three tables, one with keywords, one with negative keywords, and the other with required keywords. I need to be able to filter the data so the output has just the keywords that meat the stipulation of not being in the negative keyword list, and IF there are any required words, then it will require the results to have those keywords in the end result. The tables are very similar, the field in the tables that I would be matching against are all called keyword. I don't know SQL very well at all. I'm guessing it would be something like SELECT keyword from keywordstable where keyword in requiredkeywordstable and where NOT in negativekeywordstable Just a side note, The required keywords table could be empty which would mean there are no required keywords. Any help would be appreciated. -Brad

    Read the article

  • How to create relationship between two tables with revisions using Entity Framework

    - by Chris Ridenour
    So I am in the process of redesigning a small database (and potentially a much larger one) but want to show the value of using revisions / history of the business objects. I am switching the data from Access to MSSQL 2008. I am having a lot of internal debate on what version of "revision history" to use in the design itself - and thought I had decided to add a "RevisionId" to all tables. With this design - adding a RevisionId to all tables we would like tracked - what would be the best way to create Navigational Properties and Relationships between two tables such as | Vendor | VendorContact | where a Vendor can have multiple contacts. The Contacts themselves will be under revision. Will it require custom extensions or am I over thinking this? Thanks in advance.

    Read the article

  • Select data from three different tables with null data

    - by user3678972
    I am new in Sql. My question is how to get data from three different tables with null values. I have tried a query as below: SELECT * FROM [USER] JOIN [Location] ON ([Location].UserId = [USER].Id) JOIN [ParentChild] ON ([ParentChild].UserId = [USER].Id) WHERE ParentId=7 which I find from this link. Its working fine but, it not fetches all and each data associated with the ParentId Something like it only fetches data which are available in all tables, but also omits some data which not available in Location tables but it comes under the given ParentId. For example: UserId ParentId 1 7 8 7 For userId 8, there is data available in Location table,so it fetches all data. But there is no data for userId 1 available in Location table, so the query didn't work for this. But I want all and every data. If there is no data for userId then it can return only null columns. Is it possible ?? hope everyone can understand my problem.

    Read the article

  • Cannot copying tables when compiling on Device

    - by Amarpreet
    Hi guys, I am working on sqlite application with around 10 tables in database. it works fine when i run on simulator. And when i open the sqlite file from Applications folder of simulator it shows me all the tables and data. the problem arises when i run app on device. I downloaded the application from device and i checked the sqlite database files there were no tables in it. please help me solving this problem. thanks.

    Read the article

  • Loop through multiple tables to execute same query

    - by pcvnes
    Hi, I have a database wherein per day a table is created to log process instances. The tables are labeled MESSAGE_LOG_YYYYMMDD Currently i want to sequentially execute the same QUERY against all those tables. I wrote the PL/SQL below, but got stuck at line 10. How can i execute the SQL statement against successfully against all tables here ? DECLARE CURSOR all_tables IS SELECT table_name FROM all_tables WHERE TABLE_NAME like 'MESSAGE_LOG_2%' ORDER BY TABLE_NAME ; BEGIN FOR msglog IN all_tables LOOP SELECT count(*) FROM TABLE msglog.TABLE_NAME ; END LOOP; END; / Cheers, Peter

    Read the article

  • Design ideas for a versioned db schema with related tables also versioned

    - by vfilby
    Here is the drill, I want to version a database. I have done this before using multiple rows where the table primary key becomes a combination of the row id and either a datestamp or a version #. Now I want to version a table that depends on many other small tables. Versioning each table will be a giant PITA, so I am looking for good options to verion a schema where the data to be versioned spreads over multiple tables. All related tables are properly keyed with foreign key relationships. The database is currently on Sql Server 2005.

    Read the article

  • SQL: Join Parent - Child tables

    - by pray4Mojo
    I'm building a simple review website application and need some help with SQL Query. There are 3 tables (Topics, Comments, Users). I need a SQL query to select the data from all 3 tables. The 'Topics' table is the parent and the 'Comments' table contains the child records (anywhere from zero to 100 records per parent. The third table 'Users' contains the user information for all users. Here are the fields for the 3 tables: Topics (topicID, strTopic, userID) Comments (commentID, topicID, strComment, userID) Users (userID, userName) I tried: SELECT * FROM Topics Inner Join Comments ON Topics.topicID = Comments.topicID Inner Join Users ON Topics.userID = Users.userID But this does not work correctly because there are multiple topics and the User info is not joined to the Comments table. Any help would be appreciated.

    Read the article

  • 600 tables in DDBB

    - by Michael
    Hi all, I'm a very young software architect. Now I'm working in a very large and I have to lead a group of developers to rewrite all the mortgage system of the bank. I'm looking at database tables and I realize that there is no any data model, neither documentation. The worst part is that there are about 1000 tables in dev environment, and like 600 in production. I trust more the production environment, but anyway, what can I do? I mean, I can suicide me or something, but is there any good reverse engineering tool, so at least I could get the schema definition with the relations between tables and comments extracted from the fields? Can you advice me something? Thanks in advance.

    Read the article

  • Subsonic : Same column name different tables

    - by John Transformer
    Hi, I have a query where I need to do a "Where" clause for two different columns in two different tables but subsonic creates the same parametrized parameter name for both which is causing an issue. How can I fix this? string _RawSql = new Select() .From(Tables.Table1) .InnerJoin(Tables.Table2) .InnerJoin(Table3.SidColumn, Table2.Table3SidColumn) .Where(Table1.SidColumn).IsEqualTo(2) .And(Table3.SidColumn).IsEqualTo(1) .BuildSqlStatement(); The query this is creating is SELECT .... FROM [dbo].[Table1] INNER JOIN [dbo].[Table2] ON [dbo].[Table1].[Table2Sid] = [dbo].[Table2].[Sid] INNER JOIN [dbo].[Table3] ON [dbo].[Table2].[Table3Sid] = [dbo].[Table3].[Sid] WHERE [dbo].[Table1].[Sid] = @Sid AND [dbo].[Table3].[Sid] = @Sid Note that in the last two lines its using @Sid for both Table1 and Table3. How go I do it so it uses @Sid0 and @Sid1? Any help would be appreciated. Thanks

    Read the article

  • Entity Framework 4 Hiding Underlying Resolver Tables when model is generated from database

    - by grrrrrrrrrrrrr
    When creating an entity framework model from scratch it is possible to specify a Many to Many relationship in the model. e.g Entity1 * ----- * Entity2 When a database is then generated from this, a resolver table is then created automatically between the two entities, this is hidden in the code model, allowing direct access to each of the entities via properties. e.g. Entity1 ----* ResolverEntity *----- Entity2 My question is, when a model is generated from an existing database, which contains resolver tables, is it possible to create the same effect so the resolver tables do not appear in the generated object model? When I have attempted this, the entity framework appears to create entities in the model for the resolver tables with no obvious way of hiding them in the object model. Thanks.

    Read the article

  • MySQL Federated Tables Escaped Table Names

    - by Gordon
    I am trying to use MySQL federated tables. The problem is that the documentation specified at http://dev.mysql.com/doc/refman/5.0/en/federated-use.html says that a federated table should be created using the following format for the CONNECTION parameter: scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name E.G. CONNECTION='mysql://username:password@hostname:port/database/tablename' CONNECTION='mysql://username@hostname/database/tablename' CONNECTION='mysql://username:password@hostname/database/tablename' The problem is that the table I am trying to connect to has non-standard characters in it and I cannot find the proper way to scape them in the connections tring. For example, a table named `Table (one)` . Which has the space and the parenthesis, requiring backticks surrounding it inside any SQL code. Anyone know the proper way to do this?

    Read the article

  • What's the difference between a Table and a Named Range in Excel 2007?

    - by technomalogical
    Can someone explain the difference between Tables and Named Ranges in Excel 2007? It seems that in addition to having the features of Named Ranges, they're somehow marked as Tables which gives them special formatting & filtering options in the ribbon. Other questions: Can I treat a table as a named range? Does a named range provide me any functionality not offered by a table, and vice versa? Should I use one over the other (assuming that consumers of the spreadsheet are using Excel 2007 or higher)? Google has not been helpful (excel difference between named range and table and excel 2007 difference between named range and table) and I've found one resource describing table functionality, but no reference to named ranges.

    Read the article

  • Linked Tables not working With Access Database

    - by Kronass
    Hi, I have an Access database in a computer and I want to access it from other computer in the network. so I made mapped drive and created Linked Tables, then Imported all the objects (forms, queries, reports). when I open access database in the second computer and make any changes in using the forms non of the changes are affected in the main computer (supposedly server) and vise-versa. what am I missing? if this way will not work how can I access the Access database from other computer in the network and be able to use all the objects and make changes in it? hint: Access Version at main computer is 2003 and client pc 2007, will it effect?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >