Search Results

Search found 436 results on 18 pages for 'insertion'.

Page 3/18 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Image insertion from SQL info

    - by user528057
    What does 'howard.jpg' do in the sql statement below & how do I insert the image into my android app? CREATE TABLE IF NOT EXISTS employee ( _id INTEGER PRIMARY KEY AUTOINCREMENT, firstName VARCHAR(50), lastName VARCHAR(50), title VARCHAR(50), department VARCHAR(50), managerId INTEGER, city VARCHAR(50), officePhone VARCHAR(30), cellPhone VARCHAR(30), email VARCHAR(30), picture VARCHAR(200)) INSERT INTO employee VALUES(1,'Ryan','Howard','Vice President, North East', 'Management', NULL, 'Scranton','570-999-8888','570-999-8887','[email protected]','howard.jpg')

    Read the article

  • MS Word Macro - Numeric field insertion with automatic calculation at end of page

    - by Will
    Hi, I am trying to duplicate a feature that exists in Multimate (Ashton Tate) word processor. Yes, the one that hasnt been supported for 20 years! If I can duplicate this one feature I can get all the users off MM and onto Word. The documents they create are billing documents. they consist of a descriptive paragraph of any length on the left side of the page, and a billing amount at the end of the paragraph over on the right hand side, like this (excuse the imperfect formatting).... +-----------------whole page--------------------+ |                                                                    | |    pppp-para 1-pppppppppp                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    pppppppppppppppppppp      $$$$$  | |                                                                    |  |                                                                    |  |    pppp-para 2-pppppppppp                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    pppppppppppppppppppp      $$$$$  | |                                                                    |  |                                                                    |  |                             etc                                  | +-----------------------------------------------------+ some of these bills can be a few hundred pages and have a dozen or so paragraphs on each page, which is why none of the users will leave MM until this efficient little feature can be duplicated. The thing that MM does really easily is that there is a function key that they can press at any time that will - - jump the cursor from the paragraph they are writing over to the right hand side - create a numeric field - allow them to enter a number into the numeric field - return them to the left hand side to start a new paragraph What MM also does is automatically total the numeric fields on each page and create a subtotal in the page footer. it also creates a total for the entire document and puts this in the footer of the last page. I would like to duplicate this feature in word with a macro, but have no idea where to start. Any suggestions or code would be great, thanks, will.

    Read the article

  • URL Navigation and SQL Insertion After RadioButtonList Selection

    - by SidC
    Good Morning, I have a radiobuttonlist in my ASP.NET webforms application that is used as a voting tool. The concept is as follows: Users will vote for the blurb in the contentplaceholder using the radiobuttonlist. My list item values are 1 through 3 and my list item text is something like low, medium and high. Questions: 1. I want to save and accumulate votes for a given blurb. The blurb ID is referenced in a meta tag on the content page. How do I reference the meta tag in my SQL insert statement? 2. When the radiobuttonlist is used, can it cause the next content page to be loaded after the SQL insert is done? That is, I don't necessarily want the user to make the radiobuttonlist selection, then have to click a separate button to cast vote and move to next page. I want all that done in the radiobuttonlist. Is this possible? Thanks, Sid

    Read the article

  • Comma-separated value insertion In SQL Server 2005

    - by Asim Sajjad
    How can I insert values from a comma-separated input parameter with a stored procedure? For example: exec StoredProcedure Name 17,'127,204,110,198',7,'162,170,163,170' you can see that I have two comma-separated value lists in the parameter list. Both will have the same number of values: if the first has 5 comma-separated values, then the second one also has 5 comma-separated values. 127 and 162 are related 204 and 170 are related ...and same for the others. How can I insert these two values? One comma-separated value is inserted, but how do I insert two?

    Read the article

  • jQuery ajax post dynamic url insertion

    - by Kirill
    $.ajax({ type: "POST", url: "OMFG.php", data: info, success: function(){ }}); is what I'm using atm as a test and it works fine. I need to get the url from the link I'm clicking, so I do: var url = $(this).attr("href"); which works fine if I alert it out(the link includes http://samedomain.com/etc.php), but the ajax function doesn't post if I insert it into the ajax code: $.ajax({ type: "POST", url: url, data: info, success: function(){ }}); Please help, as I'm screwed without this working.

    Read the article

  • Observing an NSMutableArray for insertion/removal

    - by Adam Ernst
    A class has a property (and instance var) of type NSMutableArray with synthesized accessors (via @property). If you observe this array using: [myObj addObserver:self forKeyPath:@"theArray" options:0 context:NULL]; And then insert an object in the array like this: [[myObj theArray] addObject:[NSString string]]; An observeValueForKeyPath... notification is not sent. However, the following does send the proper notification: [[myObj mutableArrayValueForKey:@"theArray"] addObject:[NSString string]]; This is because mutableArrayValueForKey returns a proxy object that takes care of notifying observers. But shouldn't the synthesized accessors automatically return such a proxy object? What's the proper way to work around this--should I write a custom accessor that just invokes [super mutableArrayValueForKey...]?

    Read the article

  • Does std::multiset guarntee insertion order?

    - by Naveen
    I have a std::multiset which stores elements of class A. I have provided my own implementation of operator< for this class. My question is if I insert two equivalent objects into this multiset is their order guaranteed? For example, first I insert a object a1 into the set and then I insert an equivalent object a2 into this set. Can I expect the a1 to come before a2 when I iterate through the set? If no, is there any way to achieve this using multiset?

    Read the article

  • Grails batch insertion

    - by Srinath
    Hi, My requirement needs to insert thousands of records and when inserting each new record it was taking more time to finish the job. Could any one please suggest how to use batches in grails ? thanks in advance, sri

    Read the article

  • Modify MySQL INSERT statement to omit the insertion of certain rows

    - by dave
    I'm trying to expand a little on a statement that I received help with last week. As you can see, I'm setting up a temporary table and inserting rows of student data from a recently administered test for a few dozen schools. When the rows are inserted, they are sorted by the score (totpct_stu, high to low) and the row_number is added, with 1 representing the highest score, etc. I've learned that there were some problems at school #9999 in SMITH's class (every student made a perfect score and they were the only students in the district to do so). So, I do not want to import SMITH's class. As you can see, I DELETED SMITH's class, but this messed up the row numbering for the remainder of student at the school (e.g., high score row_number is now 20, not 1). How can I modify the INSERT statement so as to not insert this class? Thanks! DROP TEMPORARY TABLE IF EXISTS avgpct ; CREATE TEMPORARY TABLE avgpct_1 ( sch_code VARCHAR(3), schabbrev VARCHAR(75), teachername VARCHAR(75), totpct_stu DECIMAL(5,1), row_number SMALLINT, dummy VARCHAR(75) ); -- ---------------------------------------- INSERT INTO avgpct SELECT sch_code , schabbrev , teachername , totpct_stu , @num := IF( @GROUP = schabbrev, @num + 1, 1 ) AS row_number , @GROUP := schabbrev AS dummy FROM sci_rpt WHERE grade = '05' AND totpct_stu >= 1 -- has a valid score ORDER BY sch_code, totpct_stu DESC ; -- --------------------------------------- -- select * from avgpct ; -- --------------------------------------- DELETE FROM avgpct_1 WHERE sch_code = '9999' AND teachername = 'SMITH' ;

    Read the article

  • Linq to SQL EntitySet Records causing duplicate insertion

    - by Savvas Sopiadis
    In a WPF application i'm using Linq to SQL in a multi tier application. (This is an archailogy photo filing application), so every excavation has its corresponding Pictures, thus a one-to-many relationship. This relationship is correctly created by SQLMetal (which i'm using to create the POCOs). So here is the situation i 'm having trouble with: Saving changes (either of new or altered objects) is done through UnitOfWork() pattern this way: using (IUnitOfWork unitOfWork = UnitOfWork.Begin()) { //if this is a new record if (SelectedExcavation.excavation.ExcavationId == 0) { IsNewRecord = true; excavService.Add(SelectedExcavation.excavation); } //send the actual changes to the dbms unitOfWork.Commit(); } Everything works fine! BUTTTT!!! Whenever a record gets updated which has (already at least one ) corresponding Picture Record: 1) a new Excavation Record is inserted 2) the current Excavation Record gets updated 3) the previous Picture Record gets its Id changed to the newly created ExcavationId What is going on under the hood? Does Linq to SQL not handle such simple update scenarios? Thanks in advance

    Read the article

  • list or container O(1)-ish insertion/deletion performance, with array semantics

    - by Chris Kaminski
    I'm looking for a collection that offers list semantics, but also allows array semantics. Say I have a list with the following items: apple orange carrot pear then my container array would: container[0] == apple container[1] == orangle container[2] == carrot Then say I delete the orange element: container[0] == apple container[1] == carrot I don't particularly care if sort order is maintained, I'd just like the array values to function as accelerators to the list items, and I want to collapse gaps in the array without having to do an explicit resizing.

    Read the article

  • Queue-like data structure with fast search and insertion

    - by Max
    I need a datastructure with the following properties: It contains integer numbers, no duplicates. After it reaches the maximal size the first element is removed. So if the capacity is 3, then this is how it would look when putting in it sequential numbers: {}, {1}, {1, 2}, {1, 2, 3}, {2, 3, 4}, {3, 4, 5} etc. Only two operations are needed: inserting a number into this container (INSERT) and checking if the number is already in the container (EXISTS). The number of EXISTS operations is expected to be approximately 2 * number of INSERT operations. I need these operations to be as fast as possible. What would be the fastest data structure or combination of data structures for this scenario?

    Read the article

  • Sqlite iPhone data insertion problem

    - by Asad Khan
    Hi I have a function which basically tries to insert some data returned from a REST call. - (void)syncLocalDatabase{ NSString *file = [[NSBundle mainBundle] pathForResource:@"pickuplines" ofType:@"db"]; NSMutableString *query = [[NSMutableString alloc] initWithFormat:@""]; sqlite3 *database = NULL; char *errorMsg = NULL; if (sqlite3_open([file UTF8String], &database) == SQLITE_OK) { for(PickUpLine *pickupline in pickUpLines){ [query appendFormat:@"INSERT INTO pickuplines VALUES(%d,%d,%d,'%@','YES')", pickupline.line_id, pickupline.thumbsUps, pickupline.thumbsDowns, [pickupline.line stringByReplacingOccurrencesOfString:@"'" withString:@"`"]]; NSLog(query); int result = sqlite3_exec(database, [query UTF8String], NULL, NULL, &errorMsg); if (result!=SQLITE_OK) { printf("\n%s",errorMsg); sqlite3_free(errorMsg); } //sqlite3_step([query UTF8String]); [query setString:@""]; }//end for }//end if [query release]; sqlite3_close(database); } everything seems fine query string in log statement is also fine but the data does not gets inserted. Where as a counterpart of this function for select statement works well. Here is the counter part - (void)loadLinesFromDatabase{ NSString *file = [[NSBundle mainBundle] pathForResource:@"pickuplines" ofType:@"db"]; sqlite3 *database = NULL; if (sqlite3_open([file UTF8String], &database) == SQLITE_OK) { sqlite3_exec(database, "SELECT * FROM pickuplines", MyCallback, linesFromDatabase, NULL); } sqlite3_close(database); } I have implemented callback & it works fine. I am a little new to Sqlite can someone please point out what am I doing wrong. Thanx

    Read the article

  • Overloading stream insertion without violating information hiding?

    - by Chris
    I'm using yaml-cpp for a project. I want to overload the << and >> operators for some classes, but I'm having an issue grappling with how to "properly" do this. Take the Note class, for example. It's fairly boring: class Note { public: // constructors Note( void ); ~Note( void ); // public accessor methods void number( const unsigned long& number ) { _number = number; } unsigned long number( void ) const { return _number; } void author( const unsigned long& author ) { _author = author; } unsigned long author( void ) const { return _author; } void subject( const std::string& subject ) { _subject = subject; } std::string subject( void ) const { return _subject; } void body( const std::string& body ) { _body = body; } std::string body( void ) const { return _body; } private: unsigned long _number; unsigned long _author; std::string _subject; std::string _body; }; The << operator is easy sauce. In the .h: YAML::Emitter& operator << ( YAML::Emitter& out, const Note& v ); And in the .cpp: YAML::Emitter& operator << ( YAML::Emitter& out, const Note& v ) { out << v.number() << v.author() << v.subject() << v.body(); return out; } No sweat. Then I go to declare the >> operator. In the .h: void operator >> ( const YAML::Node& node, Note& note ); But in the .cpp I get: void operator >> ( const YAML::Node& node, Note& note ) { node[0] >> ? node[1] >> ? node[2] >> ? node[3] >> ? return; } If I write things like node[0] >> v._number; then I would need to change the CV-qualifier to make all of the Note fields public (which defeats everything I was taught (by professors, books, and experience))) about data hiding. I feel like doing node[0] >> temp0; v.number( temp0 ); all over the place is not only tedious, error-prone, and ugly, but rather wasteful (what with the extra copies). Then I got wise: I attempted to move these two operators into the Note class itself, and declare them as friends, but the compiler (GCC 4.4) didn't like that: src/note.h:44: error: ‘YAML::Emitter& Note::operator<<(YAML::Emitter&, const Note&)’ must take exactly one argument src/note.h:45: error: ‘void Note::operator(const YAML::Node&, Note&)’ must take exactly one argument Question: How do I "properly" overload the >> operator for a class Without violating the information hiding principle? Without excessive copying?

    Read the article

  • Insertion failed error in MySQL.

    - by theband
    while($row=mysql_fetch_array($result2)){ //return $row['ProjectID']; $sql="INSERT INTO `tycodashboard` (ProjectID,DesignationID,ReqcompID,IntOrgID,FinishedTimeID,ProjectStatusID,PhaseID ) VALUES('{$row['ProjectID']}','$pm,'$req','$initiating,'$initiating','$ftime,'$ProjectStatus,'$Phase)"; $result=mysql_query($sql); if(!$result){ if(mysql_errno() == ER_DUP_ENTRY){ throw new Exception("INSERT FAILED.\n\nThe database already contains a Project with the Project Name \"$ldesc\", please pick another."); }else{ throw new Exception("INSERT FAILED.\n\n".mysql_error()); } } }//exits INSERT FAILED. 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 '3','2,'2','2,'2,'3)' at line 2

    Read the article

  • Handling duplicate insertion

    - by Francis
    So I've got this piece of code which, logically should work but Entity Framework is behaving unexpectedly. Here: foreach (SomeClass someobject in allObjects) { Supplier supplier = new Supplier(); supplier.primary_key = someobject.id; supplier.name = someobject.displayname; try { sm.Add(supplier); ro.Created++; } catch (Exception ex) { ro.Error++; } } Here's what I have in sm.Add() public Supplier Add(Supplier supplier) { try { _ctx.AddToSupplier(supplier); _ctx.SaveChanges(); return supplier; } catch (Exception ex) { throw; } } I can have records in allObjects that have the same id. My piece of code needs to support this and just move on to the next and try to insert it, which I think should work. If this happens, an exception is throw, saying that records with dupe PKs cannot be inserted (of course). The exception mentions the value of the PK, for example 1000. All is well, a new supplier is passed to sm.Add() containing a PK that's never been used before. (1001) Weirdly though, when doing SaveChanges(), EF will whine about not being able to insert records with dupe PKs. The exception still mentions 1000 even though supplier contains 10001 in primary_key. I feel this is me not using _ctx properly. Do I need to call something else to sync it ?

    Read the article

  • Database insertion not happening

    - by Pramod Setlur
    int i=0; ContentValues values = null; for ( SortedMap.Entry<Integer, String> entry : mapDefect.entrySet() ) { if( i++ < count ) continue; if( i < arrlst.size() ) { values = new ContentValues(); Log.d("MAP", "Id :"+entry.getKey()+"Des :"+entry.getValue()+"Co :"+ arrlst.get(i)); values.put( MARKER_COORD, arrlst.get( i ) ); values.put( MARKER_ID, entry.getKey() ); values.put( DEFECT_DESCRIPTION, entry.getValue() ); values.put( IMAGE_ID_F, imageID + 1 ); Log.d( "Err", "in insertNewDefectsDescription" ); long rowId = db.insert( TABLE_DEFECTS, null, values ); long rowId1 = rowId; i++; } } So, I want to access the arraylist only after the count variable, which is why the:- if(i++<count) continue; But, when I insert a break point at the 'insert' line, it is not working. The line is not executing at all, and hence the data is not being inserted into the database. What has gone wrong?? The 'values' are null.

    Read the article

  • NHibernate.MappingException on table insertion.

    - by Suja
    The table structure is : The controller action to insert a row to table is public bool CreateInstnParts(string data) { IDictionary myInstnParts = DeserializeData(data); try { HSInstructionPart objInstnPartBO = new HSInstructionPart(); using (ISession session = Document.OpenSession()) { using (ITransaction transaction = session.BeginTransaction()) { objInstnPartBO.DocumentId = Convert.ToInt32(myInstnParts["documentId"]); objInstnPartBO.InstructionId = Convert.ToInt32(myInstnParts["instructionId"]); objInstnPartBO.PartListId = Convert.ToInt32(myInstnParts["part"]); objInstnPartBO.PartQuantity = Convert.ToInt32(myInstnParts["quantity"]); objInstnPartBO.IncPick = Convert.ToBoolean(myInstnParts["incpick"]); objInstnPartBO.IsTracked = Convert.ToBoolean(myInstnParts["istracked"]); objInstnPartBO.UpdatedBy = User.Identity.Name; objInstnPartBO.UpdatedAt = DateTime.Now; session.Save(objInstnPartBO); transaction.Commit(); } return true; } } catch (Exception ex) { Console.Write(ex.Message); return false; } } This is throwing an exception NHibernate.MappingException was caught Message="No persister for: Hexsolve.Data.BusinessObjects.HSInstructionPart" Source="NHibernate" StackTrace: at NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String entityName) at NHibernate.Impl.SessionImpl.GetEntityPersister(String entityName, Object obj) at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess) at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event) at NHibernate.Event.Default.DefaultSaveEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event) at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event) at NHibernate.Event.Default.DefaultSaveEventListener.PerformSaveOrUpdate(SaveOrUpdateEvent event) at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event) at NHibernate.Impl.SessionImpl.FireSave(SaveOrUpdateEvent event) at NHibernate.Impl.SessionImpl.Save(Object obj) at HexsolveMVC.Controllers.InstructionController.CreateInstnParts(String data) in F:\Project\HexsolveMVC\Controllers\InstructionController.cs:line 1342 InnerException: Can anyone help me solve this??

    Read the article

  • Does std::multiset guarantee insertion order?

    - by Naveen
    I have a std::multiset which stores elements of class A. I have provided my own implementation of operator< for this class. My question is if I insert two equivalent objects into this multiset is their order guaranteed? For example, first I insert a object a1 into the set and then I insert an equivalent object a2 into this set. Can I expect the a1 to come before a2 when I iterate through the set? If no, is there any way to achieve this using multiset?

    Read the article

  • C++ bughunt - High-score insertion in a vector crashes the program

    - by Francisco P.
    Hello, everyone! I have a game I'm working on. My players are stored in a vector, and, at the end of the game, the game crashes when trying to insert the high-scores in the correct positions. Here's what I have (please ignore the portuguese comments, the code is pretty straightforward :P): //TOTAL_HIGHSCORES is the max. number of hiscores that i'm willing to store. This is set as 10. bool Game::updateHiScores() { bool stopIterating; bool scoresChanged = false; //Se ainda nao existirem TOTAL_HISCORES melhores pontuacoes ou se a pontuacao for melhor que uma das existentes for (size_t i = 0; i < players.size(); ++i) { //&& !(players[i].isAI()) if (players[i].getScoreValue() > 0 && (hiScores.size() < TOTAL_HISCORES || hiScores.back() < players[i].getScore())) { scoresChanged = true; if(hiScores.empty() || hiScores.back() >= players[i].getScore()) hiScores.push_back(players[i].getScore()); else { //Ciclo que encontra e insere a pontuacao no lugar desejado stopIterating = false; for(vector<Score>::iterator it = hiScores.begin(); it < hiScores.end() && !(stopIterating); ++it) { if(*it <= players[i].getScore()) { //E inserida na posicao 'it' o Score correspondente hiScores.insert(it, players[i].getScore()); //Verifica se o comprimento do vector esta dentro do desejado, se nao estiver, este e rectificado if (hiScores.size() > TOTAL_HISCORES) hiScores.pop_back(); stopIterating = true; } } } } } if (scoresChanged) sort(hiScores.begin(), hiScores.end(), higher); return scoresChanged; } What am I doing wrong here? Thanks for your time, fellas.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >