Search Results

Search found 7391 results on 296 pages for 'record locking'.

Page 31/296 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • assigning a specific record in a ResultSet to a variable

    - by kilhra
    Hi I want to retrieve a set of records from a database, do a rs.next() and then assign the result of this to a variable to pass to a method that will use this record, in the same way that I would without assigning it to a variable and passing it to a method is there any way to do this? I'm using JAVA (1.5)

    Read the article

  • how to remove repeated record's from results linq to sql

    - by Sadegh
    hi, i want to remove repeated record's from results but distinct don't do this for me! why??? var results = (from words in _Xplorium.Words join wordFiles in _Xplorium.WordFiles on words.WordId equals wordFiles.WordId join files in _Xplorium.Files on wordFiles.FileId equals files.FileId join urls in _Xplorium.Urls on files.UrlId equals urls.UrlId where files.Title.Contains(query) || files.Description.Contains(query) orderby wordFiles.Count descending select new SearchResultItem() { Title = files.Title, Url = urls.Address, Count = wordFiles.Count, CrawledOn = files.CrawledOn, Description = files.Description, Lenght = files.Lenght, UniqueKey = words.WordId + "-" + files.FileId + "-" + urls.UrlId }).Distinct();

    Read the article

  • Select most recent record in sub child

    - by Omar
    I have the following tables/columns: Parent: ParentID Child: ChildID ParentID SubChild: SubChildID ChildID Date Parent has 1 to Many relationship with Child Child has 1 to Many relationship with SubChild For every Parent, I need to get the SubChild with the most recent Date value. How can I do this using SQL. I've tried using MAX(Date), but I can't seem to figure out how to join Parent and Child successfully. The ideal result set would contain all the Parents joined with all the SubChild columns of the latest record. Note: using MS SQL 2005+

    Read the article

  • Order by Domain Extension Name using CodeIgniter Active Record Class

    - by allan
    $extension = “SUBSTRING_INDEX(domain_name, ‘.’, -1)”; $this->db->order_by($extension, “asc”); It says: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘asc LIMIT 50’ at line 44 But its working when I didn’t used the $this-db-order_by Active Record Class such as this one: $this-db-query(“SELECT * FROM domain ORDER BY SUBSTRING_INDEX(domain_name, ‘.’, -1)”); Anyone please help me. Thanks.

    Read the article

  • SQL clone record with a unique index

    - by Milhous
    Is there a clean way of cloning a record in SQL that has an index(auto increment). I want to clone all the fields except the index. I currently have to enumerate every field, and use that in an insert select, and I would rather not explicitly list all of the fields, as they may change over time.

    Read the article

  • how can I select data from MySQL based on date (unix time record)

    - by bn
    I have a record of data with unix time date in it i want to select the row based on the date/month/year only (not with time) currently Im using something like this select * from tablename where date > '$today' and date < '$tomorow' LIMIT 1; how ever this is not that accurate if the $today and $tomorrow have different time (but same date) is there any better way to do this?

    Read the article

  • Confusing of TTimeSpan usage in Delphi 2010

    - by stanleyxu2005
    Hi All, I tried the new Record type TTimeSpan in Delphi 2010. But I encourage a very strange problem. assert(TTimeSpan.FromMilliseconds(5000).Milliseconds == 5000); This assertion does not pass. The value of 'TTimeSpan.FromMilliseconds(5000).Milliseconds' is always 0. I really cannot explain.

    Read the article

  • Howoto get id of new record after model.save

    - by tonymarschall
    I have a model with the following db structure: mysql> describe units; +------------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+----------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(128) | NO | | NULL | | | created_at | datetime | NO | | NULL | | | updated_at | datetime | NO | | NULL | | +------------+----------+------+-----+---------+----------------+ 7 rows in set (0.00 sec) After creating a new record an saving i can not get the id of the record. 1.9.3p194 :001 > unit = Unit.new(:name => 'test') => #<Unit id: nil, name: "test", created_at: nil, updated_at: nil> 1.9.3p194 :002 > unit.save (0.2ms) BEGIN SQL (0.3ms) INSERT INTO `units` (`created_at`, `name`, `updated_at`) VALUES ('2012-08-31 23:48:12', 'test', '2012-08-31 23:48:12') (144.6ms) COMMIT => true 1.9.3p194 :003 > unit.inspect => "#<Unit id: nil, name: \"test\", created_at: \"2012-08-31 23:48:12\", updated_at: \"2012-08-31 23:48:12\">" # unit.rb class Unit < ActiveRecord::Base attr_accessible :name end # migration class CreateUnits < ActiveRecord::Migration def change create_table :units do |t| t.string :name, :null => false t.timestamps end end end Tried this with other models and have the same result (no id). Data is definitily saved and i can get data with Unit.last Another try with Foo.id = nil # /var/www# rails g model Foo name:string invoke active_record create db/migrate/20120904030554_create_foos.rb create app/models/foo.rb invoke test_unit create test/unit/foo_test.rb create test/fixtures/foos.yml # /var/www# rake db:migrate == CreateFoos: migrating ===================================================== -- create_table(:foos) -> 0.3451s == CreateFoos: migrated (0.3452s) ============================================ # /var/www# rails c Loading development environment (Rails 3.2.8) 1.9.3p194 :001 > foo = Foo.new(:name => 'bar') => #<Foo id: nil, name: "bar", created_at: nil, updated_at: nil> 1.9.3p194 :002 > foo.save (0.2ms) BEGIN SQL (0.4ms) INSERT INTO `foos` (`created_at`, `name`, `updated_at`) VALUES ('2012-09-04 03:06:26', 'bar', '2012-09-04 03:06:26') (103.2ms) COMMIT => true 1.9.3p194 :003 > foo.inspect => "#<Foo id: nil, name: \"bar\", created_at: \"2012-09-04 03:06:26\", updated_at: \"2012-09-04 03:06:26\">" 1.9.3p194 :004 > Foo.last Foo Load (0.5ms) SELECT `foos`.* FROM `foos` ORDER BY `foos`.`id` DESC LIMIT 1 => #<Foo id: 1, name: "bar", created_at: "2012-09-04 03:06:26", updated_at: "2012-09-04 03:06:26">

    Read the article

  • Automatically update or delete record(s) after x time in coldfusion

    - by Nich
    Hi, I've searched all over the net for this. Hope that someone's got something. How would a record in a database be updated automatically after x time n coldfusion? I know how to manually do it by writing an sql that performs an action to all records older than x time based on the timestamp. How would this be done automatically? Kind Regards, Nich

    Read the article

  • retrieving the record which has only one value

    - by ashwani66476
    Hello All, Please suggest me a query, which retrieves only those record which has the single row in table. For Example table1. name age aaa 20 bbb 10 ccc 20 ddd 30 If I run "select distinct age from table1. result will be age 20 10 30 But I need a query, which give the result like name age bbb 10 ddd 30 Thanks....

    Read the article

  • Use subform record set as domain argument in DAvg()

    - by harto
    Is it possible to use a subform's 'current' record set as the domain argument to DAvg() (etc.)? Basically, I have a subform that displays a subset of records from a query. I would like to run DAvg() over this subset. This is how I've gotten around it: =DAvg([FieldToAvg], [SubformQuery], "ChildField=Forms.MasterForm.MasterField And FieldToAvg > 0") but what I actually want is something like: =DAvg([FieldToAvg], [SubformCurrentlyDisplayedData], "FieldToAvg > 0") Is this possible in Access 2007?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >