Search Results

Search found 6630 results on 266 pages for 'cname record'.

Page 16/266 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Sending one record from cursor to another function Postgres

    - by PylonsN00b
    FYI: I am completely new to using cursors... So I have one function that is a cursor: CREATE FUNCTION get_all_product_promos(refcursor, cursor_object_id integer) RETURNS refcursor AS ' BEGIN OPEN $1 FOR SELECT * FROM promos prom1 JOIN promo_objects ON (prom1.promo_id = promo_objects.promotion_id) WHERE prom1.active = true AND now() BETWEEN prom1.start_date AND prom1.end_date AND promo_objects.object_id = cursor_object_id UNION SELECT prom2.promo_id FROM promos prom2 JOIN promo_buy_objects ON (prom2.promo_id = promo_buy_objects.promo_id) LEFT JOIN promo_get_objects ON prom2.promo_id = promo_get_objects.promo_id WHERE (prom2.buy_quantity IS NOT NULL OR prom2.buy_quantity > 0) AND prom2.active = true AND now() BETWEEN prom2.start_date AND prom2.end_date AND promo_buy_objects.object_id = cursor_object_id; RETURN $1; END; ' LANGUAGE plpgsql; SO then in another function I call it and need to process it: ... --Get the promotions from the cursor SELECT get_all_product_promos('promo_cursor', this_object_id) updated := FALSE; IF FOUND THEN --Then loop through your results LOOP FETCH promo_cursor into this_promotion --Preform comparison logic -this is necessary as this logic is used in other contexts from other functions SELECT * INTO best_promo_results FROM get_best_product_promos(this_promotion, this_object_id, get_free_promotion, get_free_promotion_value, current_promotion_value, current_promotion); ... SO the idea here is to select from the cursor, loop using fetch (next is assumed correct?) and put the record fetched into this_promotion. Then send the record in this_promotion to another function. I can't figure out what to declare the type of this_promotion in get_best_product_promos. Here is what I have: CREATE OR REPLACE FUNCTION get_best_product_promos(this_promotion record, this_object_id integer, get_free_promotion integer, get_free_promotion_value numeric(10,2), current_promotion_value numeric(10,2), current_promotion integer) RETURNS... It tells me: ERROR: plpgsql functions cannot take type record OK first I tried: CREATE OR REPLACE FUNCTION get_best_product_promos(this_promotion get_all_product_promos, this_object_id integer, get_free_promotion integer, get_free_promotion_value numeric(10,2), current_promotion_value numeric(10,2), current_promotion integer) RETURNS... Because I saw some syntax in the Postgres docs showed a function being created w/ a input parameter that had a type 'tablename' this works, but it has to be a tablename not a function :( I know I am so close, I was told to use cursors to pass records around. So I studied up. Please help.

    Read the article

  • PowerPoint record slide show function accessible through Interop with C#

    - by dwperrin
    I am currently trying to write an addin for PowerPoint that whenever any PowerPoint document is opened and then run in show mode that the feature to record narration audio and slide timings is automatically activated. However I cannot seem to find that option in the PowerPoint interop object The manual in application way to use this feature in Powerpoint 2007 is under the "Slide Show" tab of the ribbon called "Record Narration". I have found under that I can set under Microsoft.Office.Interop.PowerPoint.SlideShowSettings.AdvancedSettings to RehearseNewTimings but this does not record narration audio. Does anyone know if this is even possible? Or if I am completely on the wrong track here. Thanks in advance for any repsonse

    Read the article

  • Inserting the record into Database through JPA

    - by vinay123
    In my code I am using JSF - Front end , EJB-Middile Tier and JPA connect to DB.Calling the EJB using the Webservices.Using MySQL as DAtabase. I have created the Voter table in which I need to insert the record. I ma passing the values from the JSF to EJB, it is working.I have created JPA controller class (which automatcally generates the persistence code based on the data base classes) Ex: getting the entity manager etc., em = getEntityManager(); em.getTransaction().begin(); em.persist(voter); em.getTransaction().commit(); I have created the named query also: @NamedQuery(name = "Voter.insertRecord", query = "INSERT INTO Voter v values v.voterID = :voterID,v.password = :password,v.partSSN = :partSSN, v.address = :address, v.zipCode = :zipCode,v.ssn = :ssn, v.vFirstName = :vFirstName,v.vLastName = :vLastName,v.dob = :dob"), But still not able to insert the record? Can anyone help me in inserting the record into the Data base through JPA.(Persistence object)?

    Read the article

  • mysql first record retrieval

    - by Sammy
    While very easy to do in Perl or PHP, I cannot figure how to use mysql only to extract the first unique occurence of a record. For example, given the following table: Name Date Time Sale John 2010-09-12 10:22:22 500 Bill 2010-08-12 09:22:37 2000 John 2010-09-13 10:22:22 500 Sue 2010-09-01 09:07:21 1000 Bill 2010-07-25 11:23:23 2000 Sue 2010-06-24 13:23:45 1000 I would like to extract the first record for each individual in asc time order. After sorting the table is ascending time order, I need to extract the first unique record by name. So the output would be : Name Date Time Sale John 2010-09-12 10:22:22 500 Bill 2010-07-25 11:23:23 2000 Sue 2010-06-24 13:23:45 1000 Is this doable in an easy fashion with mySQL? Thanks, Sammy

    Read the article

  • How to check a SQL database table to see if a record exists

    - by Anthony
    I have a SQL database that creates a record for every document uploaded by the user to the server. I want to check this table before a user uploads a document to ensure they don't upload a file with name that already exists. I know how to make the connection and make the SqlCommand to query the table for an existing record. But I don't know how to check the record count from the sqlCommand I made. Does that make sense? Using myConnectionCheck As New SqlConnection(myConnectionStringCheck) Dim myCommandCheck As New SqlCommand() myCommandCheck.Connection = myConnectionCheck myCommandCheck.CommandText = "SELECT * FROM Req_Docs WHERE Doc_Name =" & DocName myConnectionCheck.Open() myCommandCheck.ExecuteNonQuery() End Using Thanks in advance, Anthony

    Read the article

  • Access: Reading deleted record buffer

    - by Michael Itzoe
    According to the Access (2003) documentation, when you delete a record, it's placed in a buffer, then the BeforeDeleteConfirm event is raised, then the AfterConfirmDelete ad Delete events. In my table if a record is deleted, I need to add one of its field values (a quantity value) to a field in another table. I tried setting the quantity to a private variable in the Current event, but as soon as I delete click delete, it looks like the Current event fires again and resets my variable. How can I access the value of a field in a deleted record?

    Read the article

  • Inserting the record into Data Base through JPA

    - by vinay123
    In my code I am using JSF - Front end , EJB-Middile Tier and JPA connect to DB.Calling the EJB using the Webservices.Using MySQL as DAtabase. I have created the Voter table in which I need to insert the record. I ma passing the values from the JSF to EJB, it is working.I have created JPA controller class (which automatcally generates the persistence code based on the data base classes) Ex: getting the entity manager etc., em = getEntityManager(); em.getTransaction().begin(); em.persist(voter); em.getTransaction().commit(); I have created the named query also: @NamedQuery(name = "Voter.insertRecord", query = "INSERT INTO Voter v values v.voterID = :voterID,v.password = :password,v.partSSN = :partSSN,v.address = :address, v.zipCode = :zipCode,v.ssn = :ssn, v.vFirstName = :vFirstName,v.vLastName = :vLastName,v.dob = :dob"),But still not able to insert the record? Can anyone help me in inserting the record into the Data base through JPA.(Persistence object)?

    Read the article

  • Html combo box to database record Id

    - by LanguaFlash
    I'm fairly sure there has to be a simple solution to my problem, but I am a new web developer and can't quite figure it out. On my page I have a combo box whose values are filled from my database. When the user submits the form, how to I go about converting those values back to the record numbers in the database? Up to now I have been just doing a sort of reversed lookup in my database to try to get the record's ID. This has quite a few obvious flaws and I am sure that there has to be a better way. I am used to MS Forms combo boxes where the record data and ID are never separated. But in the case of a web form, I have no way to do multiple columns in the combo box like I am used to. Thanks! Jeff

    Read the article

  • Delphi -> Delphi prism, how to use array of records?

    - by Pierre
    Hi there. I'm learning Delphi Prism, and i don't find how to write the following code with it : type TRapportItem = record Label : String; Value : Int16; AnomalieComment : String; end; type TRapportCategorie = record Label : String; CategoriesItems : Array of TRapportItem; end; type TRapportContent = record Categories : array of TRapportCategorie; end; Then, somewhere, i try to put items in the array : rapport.Categories[i].Label:=l.Item(i).InnerText; But it doesn't work.. Can someone enlight me? Thanks!

    Read the article

  • How to get the position of a record in a table (SQL Server)

    - by Peter Siegmann
    Following problem: I need to get the position of a record in the table. Let's say I have five record in the table: Name: john doe, ID: 1 Name: jane doe, ID: 2 Name: Frankie Boy, ID: 4 Name: Johnny, ID: 9 Now, "Frankie Boy" is in the third position in the table. But How to get this information from the SQL server? I could count IDs, but they are not reliable, Frankie has the ID 4, but is in the third position because the record with the ID '3' was deleted. Is there a way? I am aware of ROW_RANK but it would be costly, because I need to select basically the whole set first before I can rank row_rank them. I am using MS SQL Server 2008 R2.

    Read the article

  • How to delete refClass record in Doctrine?

    - by terrani
    Hi all! I have many-to-many relations with the following tables. post tag post_tag I created three classes with Doctrine, so I have the following classes as well. BasePost BaseTag BasePostTag in the setUp() method, I defined relations. I like to delete tag record when I delete post record. So I simply put cascade as descirbed on Doctrine document. $this->hasMany("Tag as Tags",array( 'refClass' => 'PostTag', 'local'=>'object_id', 'foreign'=>'tag_id', 'cascade'=> array('delete') )); it works without a problem. My questions is, how do I delete a record from post_tag table? Do I need to create a query myself?

    Read the article

  • Duplicate LINQ to SQL entity / record?

    - by GONeale
    Hi guys, What would be considered the best practice in duplicating [cloning] a LINQ to SQL entity resulting in a new record in the database? The context is that I wish to make a duplicate function for records in a grid of an admin. website and after trying a few things and the obvious, read data, alter ID=0, change name, submitChanges(), and hitting an exception, lol. I thought I might stop and ask an expert. I wish to start with first reading the record, altering the name by prefixing with "Copy Of " and then saving as a new record.

    Read the article

  • How to record when user follows external links without slowing user down

    - by taw
    I want to track when user clicks external links for analytics purposes. The simplest solution is to replace all external links with links to special record-and-redirect controller, but that would slow the user unnecessarily. The second idea would be to override click event and within in $.post a message to record controller, then let the main event handler happen, which will usually be either click (open link in same tab) or middle click (open in new tab) - good either way, and the user won't have to wait for wait for my server to record it, it's fire-and-forget. (I don't care if users without Javascript don't get tracked) Is that a reasonable way to go? Or what else would be the best way to track all external link clicks?

    Read the article

  • Animated record deletion with jquery like mootools example

    - by twitter
    I was reading around and saw this example from David Walsh about how to animate record deletion with mootools. Does the exact same effect exist in jquery? This is his mootools code. window.addEvent('domready',function() { $$('a.delete').each(function(el) { el.addEvent('click',function(e) { e.stop(); var parent = el.getParent('div'); var request = new Request({ url: 'mootools-record-delete.php', link: 'chain', method: 'get', data: { 'delete': parent.get('id').replace('record-',''), ajax: 1 }, onRequest: function() { new Fx.Tween(parent,{ duration:300 }).start('background-color', '#fb6c6c'); }, onSuccess: function() { new Fx.Slide(parent,{ duration:300, onComplete: function() { parent.dispose(); } }).slideOut(); } }).send(); }); }); });

    Read the article

  • how to get id of the saved record in rails

    - by railsnew
    I am doing this from the console but i'd like to do this in my code too. Basically I am trying to add a record to the table and then get the id back. >> @record = Physician.create(:pname => "someone2") => #<Physician id: nil, pname: "someone2", pgroup: nil, created_at: nil, updated_at: nil, userid: nil, storeid: nil, licexpdate: nil, address: nil> >> @record.save => false >>

    Read the article

  • Duplicate a database record with linq

    - by holz
    Is there a way to duplicate a db record with linq to sql in c#? Id [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, [Foo] [nvarchar](255) NOT NULL, [Bar] [numeric](28,12) NOT NULL, ... Given the table above, I would like to duplicate a record (but give it a different id), in a way that new fields added to the DB and the Linq dbml file at a later date will still get duplicated with out having to change that code that duplicates the record. ie I don't want to write newRecord.Foo = currentRecord.Foo; for all of the fields on the table.

    Read the article

  • How to get id of the saved record in Ruby on Rails

    - by railsnew
    I am doing this from the console but I'd like to do this in my code too. Basically I am trying to add a record to the table and then get the id back. >> @record = Physician.create(:pname => "someone2") => #<Physician id: nil, pname: "someone2", pgroup: nil, created_at: nil, updated_at: nil, userid: nil, storeid: nil, licexpdate: nil, address: nil> >> @record.save => false >>

    Read the article

  • SP: Random Records, Fave Record, Plus Known Record, NO repetition.

    - by Munklefish
    Hi, Thanks to help from a lot of you guys ive been given the following code which works great. However ive realised ive missed an important bit of info out of the question and so have reposted here (with updated code) to clarify. The following code gets 5 random records from a table plus a further single record based on the users favourite as identified in a second table: CREATE PROCEDURE web.getRandomCharities ( @tmp_ID bigint --members ID ) AS BEGIN WITH q AS ( SELECT TOP 5 * FROM TBL_CHARITIES WHERE cha_Active = 'TRUE' AND cha_Key != '1' ORDER BY NEWID() ) SELECT * FROM q UNION ALL SELECT TOP 1 * FROM ( SELECT * FROM TBL_CHARITIES WHERE TBL_CHARITIES.cha_Key IN ( SELECT members_Favourite FROM TBL_MEMBERS WHERE members_Id = @tmp_ID ) EXCEPT SELECT * FROM q ) tc END However, i realised i also need to include the record where "cha_Key == '1'" if it isnt the same as the record returned in the second SELECT statement in the code shown above. HOpe that makes sense? THANKS!!!

    Read the article

  • Delphi - change text color based on current record value

    - by Welliam
    using db controls connected to a FireBird database. and I have a simple dblabel I want to change text color based on current value for current record The user navigate using the dbnavigator and I wrote code in the navigator button click. but there is a problem the code always read the previous record value not the current one so the color is wrong !! for example: procedure <navigator button click>; begin if table1.FieldByName('field1').AsString = 'val1' then <dblabel.textcolor> := red else <dblabel.textcolor> := green; end; but as I said the value is one record behind. why is that and what is the best approach to change label text color ? Thanks

    Read the article

  • custom MAIL server -> Proxy Server -> Gmail Server

    - by Eugene
    So I have some custom VPS which route emails via MX record in DNS. And I need to setup gmail interface via Google Apps - this step and previous are clear. But how can I insert some middle layer, to check emails messages for special words/etc., so something like spam assasin proxy, but custom product. The question is: How could i setup proxy mail from my server = to proxy server(or application) = to gmail servers? Thank you, for any help!

    Read the article

  • How to record screencast on Linux with mouse clicks and key hits shown

    - by zalun
    Basically I'm looking for an application. I know it's slightly off topic, but I'm looking for it to record a series of tutorials for a program I wrote. It's important to show the actions like mouse click, mouse right click, and all what's coming out from the keyboard. In the similar way to this video http://www.flickr.com/photos/jannis/3246408003/ which is made using OSX and ScreenFlick http://www.araelium.com/screenflick/ Is there such an option? Thanks

    Read the article

  • Record must end with an empty line - missing changetype (LDIF)

    - by user21463
    I tried putting the following LDIF file in Apache Directory Studio, but it complained that the record must end with an empty line. Do you know why? dn: CN=mitoken-SerialNumber,CN=Schema,CN=Configuration,DC=myorg,DC=com changetype: ntdsSchemaAdd lDAPDisplayName: mitokenSerialNumber adminDisplayName: mitoken-SerialNumber description: Token serial number attributeSyntax: 2.5.5.12 oMSyntax: 64 isMemberOfPartialAttributeSet: FALSE isSingleValued: TRUE searchFlags: 0 objectClass: attributeSchema attributeID: 1.2.840.113556.1.8000.2554.56278.0.46625.19000.45599.15687267.6686356.2.1 schemaIDGUID:: 3U7SiIq9SByhs/i1Z6fEsw==

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >