Search Results

Search found 26115 results on 1045 pages for 'table alias'.

Page 77/1045 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • table column accepting "0" as a member Id

    - by user682417
    I have two tables one is members table with columns member id , member first name, member last name. I have another table guest passes with columns guest pass id and member id and issue date . I have a list view that will displays guest passes details (I.e) like member name and issue date and I have two text boxes those are for entering member name and issue date . member name text box is auto complete text box that working fine.... but the problem is when I am entering the name that is not in member table at this time it will accept and displays a blank field in list view in member name column and member id is stored as "0" in guest pass table ...... I don't want to display the member name empty blank and I don t want to store "0" in guest pass table and this is the insert statement sql2 = @"INSERT INTO guestpasses(member_Id,guestPass_IssueDate)"; sql2 += " VALUES("; sql2 += "'" + tbCGuestPassesMemberId.Text + "'"; sql2 += ",'" + tbIssueDate.Text + "'"; guestpassmemberId = memberid is there any validation that need to be done can any one suggestions on this pls... and this is the auto complete text box statement sql = @"SELECT member_Id FROM members WHERE concat(member_Firstname,'',member_Lastname) ='" + tbMemberName.Text+"'"; if (dt != null) { if (dt.Rows.Count > 0) { tbCGuestPassesMemberId.Text = Convert.ToInt32(dt.Rows[0] ["member_Id"]).ToString(); } } can any one help me on this ... is there any type of validation with sql query pls help me .....

    Read the article

  • Scroll immediately to row in table before view shows

    - by cannyboy
    A view with a table gets pushed onto the screen and I want it to scroll to a certain row in the table before the screen actually displays. I use this code within the final viewcontroller. NSIndexPath *scrollToPath = [NSIndexPath indexPathForRow:5 inSection:0]; [theTable scrollToRowAtIndexPath:scrollToPath atScrollPosition:UITableViewScrollPositionTop animated:NO]; When I put it in viewDiDAppear method, then it briefly flashes from the intial position of the table (at the top) to the row I want. I don't want it to show the initial position. If I put it in viewDidLoad or viewWillAppear then it crashes with a NSRangeException, presumably because the table isn't set up yet. How would I get it to scroll without showing the initial position?

    Read the article

  • 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

  • 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

  • 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

  • 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

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >