Search Results

Search found 26283 results on 1052 pages for 'temporary table'.

Page 74/1052 | < Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >

  • how to compare the values inside a table in sql

    - by Ranjana
    how to compare the values of same table(say for eg: Order table) each and every time the record get inserted , if the record with same values get inserted already in same table i should not insert the new record with same values. how to do that exactly in sql server 2008

    Read the article

  • Can't INSERT INTO SELECT into a table with identity column

    - by Eran Goldin
    In SQL server, I'm using a table variable and when done manipulating it I want to insert its values into a real table that has an identity column which is also the PK. The table variable I'm making has two columns; the physical table has four, the first of which is the identity column, an integer IK. The data types for the columns I want to insert are the same as the target columns' data types. INSERT INTO [dbo].[Message] ([Name], [Type]) SELECT DISTINCT [Code],[MessageType] FROM @TempTableVariable END This fails with Cannot insert duplicate key row in object 'dbo.Message' with unique index 'IX_Message_Id'. The duplicate key value is (ApplicationSelection). But when trying to insert just Values (...) it works ok. How do I get it right?

    Read the article

  • Retrieve all records in a table with nHibernate

    - by brainimus
    I need to retrieve all the records in a table with nHibernate. If I had the key for all the records in the table I could loop and use nHibernate's Get method (this seems inefficient though) but I don't have the keys. I could also use FindAll but this requires criteria or a stored procedure. How can I get all the records from the table?

    Read the article

  • Mapping many-to-many association table with extra column(s)

    - by user635524
    My database contains 3 tables: User and Service entities have many-to-many relationship and are joined with the SERVICE_USER table as follows: USERS - SERVICE_USER - SERVICES SERVICE_USER table contains additional BLOCKED column. What is the best way to perform such a mapping? These are my Entity classes @Entity @Table(name = "USERS") public class User implements java.io.Serializable { private String userid; private String email; @Id @Column(name = "USERID", unique = true, nullable = false,) public String getUserid() { return this.userid; } .... some get/set methods } @Entity @Table(name = "SERVICES") public class CmsService implements java.io.Serializable { private String serviceCode; @Id @Column(name = "SERVICE_CODE", unique = true, nullable = false, length = 100) public String getServiceCode() { return this.serviceCode; } .... some additional fields and get/set methods } I followed this example http://giannigar.wordpress.com/2009/09/04/m ... using-jpa/ Here is some test code: User user = new User(); user.setEmail("e2"); user.setUserid("ui2"); user.setPassword("p2"); CmsService service= new CmsService("cd2","name2"); List<UserService> userServiceList = new ArrayList<UserService>(); UserService userService = new UserService(); userService.setService(service); userService.setUser(user); userService.setBlocked(true); service.getUserServices().add(userService); userDAO.save(user); The problem is that hibernate persists User object and UserService one. No success with the CmsService object I tried to use EAGER fetch - no progress Is it possible to achieve the behaviour I'm expecting with the mapping provided above? Maybe there is some more elegant way of mapping many to many join table with additional column?

    Read the article

  • SQL Query, return value from table with no join

    - by jdenomme19
    I'm hoping for an idea on the best way to approach what I'm trying to do. I have a table with a list of transactions. Each transactions has a PostDate in DateTime format. I have another table holding the fiscal period values. This table has the following columns; FiscalYear, FiscalMonth, StartDate, EndDate. I'm trying to write a query that will return all values from my transactions table, along with the FiscalYear and FiscalMonth of the PostDate. So I guess I'm just trying to return the FiscalYear and FiscalMonth values when the PostDate falls between the StartDate and EndDate. I've tried using a Subbuery, but I have little experience with them and kept returning an error message that the subquery was returning more than 1 value. Help would be appreciated SELECT Transactions.PostDate, Transactions.TranKey, Transactions.CustKey, (SELECT FiscalPeriod.FiscPer FROM FiscalPeriod WHERE (Transactions.PostDate > CONVERT(Datetime, FiscalPeriod.StartDate, 102)) AND (Transactions.PostDate < CONVERT(DATETIME, FiscalPeriod.EndDate, 102))) AS FisPer FROM Transactions

    Read the article

  • Opening the Table from the Database

    - by Gopal
    Am new to MySQL 5.1 In MySQL Where i can i find the Database & Table.... I was attached one database in MYSQL through odbc connectivity, How can i get that table values from the attached database. And also i want to create a table from the database..

    Read the article

  • SQL Server: Find Values that don't exist in a table

    - by MacAnthony
    I have a list or set of values that I would like to know which ones do not currently exist in a table. I know I can find out which ones do exist with: SELECT * FROM Table WHERE column1 IN (x,x,x,x,x) The set is the values I am checking against. Is there a way to find out which values in that set do not exist in column1? Basically, I'm looking for the inverse of the sql statement above. This is for a report, so all I need is the values that don't exist to be returned back. I have and could do this with a left join and putting the values in another table, but the values I check are always different and was hoping to find a solution that didn't involve clearing a table and inserting data first. Trying to find a better solution for me if one exists.

    Read the article

  • Find Field In Access Table

    - by user3535895
    I need to connect to a local table in Access and find a an entry in the name field then find the id of that name. I know how to connect to access and create the connection there, but actually manipulating the table I am lost. I can use this to connect to access, but how would I access the table and find the field I am looking for? The data structure of the table I want to connect to is: name text, address text, id autonumber. System.Collections.ArrayList outside = new System.Collections.ArrayList(); System.Data.OleDb.OleDbConnection olecon = new System.Data.OleDb.OleDbConnection"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path); olecon.Open();

    Read the article

  • ul/li to table (with good styling)

    - by user584018
    I have ONLY one <UL> and under that we have group of <LI> <ul> <li>1<li> <li>2<li> <li>3</li> <li>4<li> </ul> now I wanted to show them as TABLE, please help me with CSS, how can we show as a TABLE for above UL/LI in below table format, 2 LI set in one TR (two TD) and so on.... <html> <table border="1"> <thead> <th>col1</th><th>col1</th> </thead> <tr><td>1</td><td>2</td></tr> <tr><td>3</td><td>4</td></tr> </table> </html>

    Read the article

  • The table '#sql-5f8_9c' is full

    - by gansodesoya
    hello, im trying to delete a foreign key with the following syntax (5.0.45-community-nt): alter table [table] drop foreign key [fk_name] but I'm getting the folling error: The table '#sql-5f8_9c' is full – 99543 ms any ideas? thanks!

    Read the article

  • SQL inner join from field defined table?

    - by Wolftousen
    I have a, currently, a total of 6 tables that are part of this question. The primary table, tableA, contains columns that all the entries in the other 5 tables have in common. The other 5 tables have columns which define the entry in tableA in more detail. For example: TableA ID|Name|Volumn|Weight|Description 0 |T1 |0.4 |0.1 |Random text 1 |R1 |5.3 |25 |Random text TableB ID|Color|Shape 0 |Blue |Sphere TableC ID|Direction|Velocity 1 |North |3.4 (column names are just examples don't take them for what they mean...) The ID field in Table A is unique to all other tables (i.e. TableB will have 0, but TableC will not, nor any other Tables). What I would like to do is select all the fields from TableA and the corresponding (according to ID field) detail Table (TableB-F). What I have currently done and not tested is added a field to TableA so it looks like this: TableA ID|Name|Volumn|Weight|Description|Table 0 |T1 |0.4 |0.1 |Random text|TableB 1 |R1 |5.3 |25 |Random text|TableC I have a few questions about this: 1.Is it proper to do such a thing to TableA, as foreign keys wont work in this situation since they all need to link to different tables? 2.If this is proper, would the SQL query look like this (ID would be input by the user)? SELECT * FROM TableA AS a INNER JOIN a.Table AS t ON a.ID = ID; 3.Is there a better way to do this? Thanks for the help.

    Read the article

  • How to Use Multi Spinner to Store Each Table from Database

    - by stephenborey
    Dear Sir, I'm having problem in the method how to add each of the database table to many spinners. The data from one table must use one spinner to store. In my form has 3 spinner which require data from 3 table in database. Please show me some sample or the familiar one, because I have just started in this program. Thank You in Advance!

    Read the article

  • Index a mysql table of 3 integer fields

    - by Doori Bar
    I have a mysql table of 3 integer fields. None of the fields have a unique value - but the three of them combined are unique. When I query this table, I only search by the first field. Which approach is recommended for indexing such table? Having a multiple-field primary key on the 3 fields, or setting an index on the first field, which is not unique? Thanks, Doori Bar

    Read the article

  • update entire table with pdo

    - by MephDaddy
    I am working on a simple gaming ladder script. I am having little to no luck trying to find an effective way to reset my ladder information while leaving my table id and name fields intact. I am trying to get create a loop to update my entire table, similar to the way I draw my table. Shown below. ...... //Start displaying ladder with with team with most wins at the top echo "<TABLE border=1 width=500 align=center><TR>"; foreach($db->query('SELECT * FROM test ORDER BY win DESC , name ASC') as $row) { echo "<TR><TD>" . $row['name'] . "</TD><TD>" . $row['win'] . "</TD><TD>"; echo $row['loss'] . "</TD><TD>" . $row['battles'] . "</TD><TD>"; echo $row['score'] . "</TD></TR>"; } ...... I currently have a table with 6 fields(id,name,win,loss,battles,score). I want to reset the values of win,loss,battles, and score back to 0. While leaving id and name alone. Effective reseting my ladder for a new season to begin. The only way I have been able to complete this is to find out how many rows there are and run a for loop. It seems vary inefficient. Was hoping I could get some better insight as to how to go about this.

    Read the article

  • db2 stored procedure. locking / releasing table

    I use a stored procedure to read/update/return certain fields in a journaled as400 table. I want to lock the table first and then release it after the record is updated. I tried tons of stuff, but releasing table is a problem. SP defines and opens cursor, selects record into variables and updates the record. I tried 'begin atomic', then lock table in exclusive mode and then when it's over, it doesn't release. Is there any statement i missing or do i need to compile it with certain parameters? I use a simple create procedure statement in AS400 navigator's sql panel to compile it. Will very appreciate some help with example. Thanks.

    Read the article

  • Catch/Raise event on table data update C#

    - by Incognito
    Hi, I have 24/7 service which keeps setup (configuration data) for charging, routing and etc in the Sql Server. Once it is started it loads the data from table using Linq2SQL and use the data through all the application. And we need a solution to update the setup data in the table without restarting the application. So I am interested is it possible to catch/determine that the table was updated so I can refresh the setup data in the application. I mean is it possible to have events which will raise when there is any delete, update or insert on the table. Thank you.

    Read the article

  • Query to get data from a main table

    - by Thu Thuy
    I have an Information table with 3 colums tableName/FieldName/Value and its data like this: TableName|FieldName | Value Films |DateSortie |NULL Films |Duree |NULL Films |CodeLangue |NULL Films |Documentaire |NULL Could you show me a SQL statement to put data into the Value Field, please! Note that I also have table Films and its fields like data in FieldName field of the Information table Thanks in advance TNT

    Read the article

  • Javascript dynamic table memory usage

    - by Dan
    I use a dynamic table: <html> <body> <button id="button">Build table</button> <div id="container"> <script type="text/javascript"> window.onload=function(){ var table = null; var row = "<tr><td>111111111111111111111111111111111111111111111111111111</td>" + "<td>222222222222222222222222222222222222222222222222222222</td>" + "<td>333333333333333333333333333333333333333333333333333333</td></tr>"; var data = null; for (var i = 0; i < 2000; i++){ data += row; } var obj = document.getElementById("button"); obj.onclick=function buildTable(){ document.getElementById("container").innerHTML = "<div><table><tbody>" + data + "</tbody></table></div>"; }; }; </script> </body> </html> Using chromes task manager, each time new data is loaded the memory usage increases considerably and doesn't go down, so after some time the app consumes a lot of memory and requires the browser to be closed. Is there any change in the code I can use to solve this or is it a browser side problem?

    Read the article

  • Table Design for (Currently Viewing Videos)?

    - by Surya sasidhar
    hi, I am doing a project on video portal, in that i am trying to place for currently viewing videos. People who r currently viewing that video. For this i have design the table like this table:(columns) Sno,videoid,sessionid,userid,createddate these are the columns but it is not sufficient i think if possible can u help me how can i design the table. how can we perfectly represent the currently viewing videos. Please help me thank you

    Read the article

  • SQL update a table with a foreign key

    - by drousseau
    I have a categories table, which one of the fields serves as the foreign key for a sub-categories table. One field that serves as part of the primary key for each table is the language id. I need to update these in both tables. Basically, wherever the language id = x in both tables, I need to set it to y. When I try to do an update on either table, I get a 'The UPDATE statement conflicted with the REFERENCE constraint..' which refers to the foreign key constraint. How can I update the language field on both of these tables?

    Read the article

  • MySql query and table optimisation

    - by Cheeky
    Hi everyone. I am trying to run the following simple query on a table with 500K records. SELECT COUNT(*) AS impressionCount FROM impression WHERE 0 = 0 AND impressionObjectId1 = 'C69A54B8-B828-E2E4-2319A93011DF4120' AND impressionObjectId2 = '1'; This query is taking 10 seconds to run. I have tried creating individual indexes for the impressionObjectId1 and impressionObjectId2 columns, as well as a composite index using both. The composite worked well for a while, but now it is also slow. Here is my table structure: DROP TABLE IF EXISTS `impression`; CREATE TABLE `impression` ( `impressionId` varchar(50) NOT NULL, `impressionObjectId1` varchar(50) NOT NULL, `impressionObjectId2` varchar(50) default NULL, `impressionStampDate` datetime NOT NULL, PRIMARY KEY (`impressionId`), KEY `IX_object` (`impressionObjectId1`,`impressionObjectId2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC COMMENT='InnoDB free: 191488 kB'; Any advice would be greatly appreciated. Thanks EDIT: When adding an EXPLAIN, this is the output: 1, 'SIMPLE', 'impression', 'ref', 'IX_object', 'IX_object', '105', 'const,const', 304499, 'Using where; Using index'

    Read the article

< Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >