Search Results

Search found 10177 results on 408 pages for 'thumbs db'.

Page 232/408 | < Previous Page | 228 229 230 231 232 233 234 235 236 237 238 239  | Next Page >

  • insertion in the same row for all activities

    - by Utman Alami
    i am here to ask for help again, i created one database for all activities, the problem i have is that the insertion in every activity comes in with new row, but that's not what i want, what i am looking for is in the same row in each activity insert the columns that contains. i already looked for solution here, they are speaking about static reference but i don't know how to do it! so, is there any ideas ? static DBAdapter db = new DBAdapter();

    Read the article

  • Generate Delete Statement From Foreign Key Relationships in SQL 2008 ?

    - by Element
    Is it possible via script/tool to generate a delete statement based on the tables fk relations. i.e. I have the table: DelMe(ID) and there are 30 tables with fk references to its ID that I need to delete first, is there some tool/script that I can run that will generate the 30 delete statements based on the FK relations for me ? (btw I know about cascade delete on the relations, I can't use it in this existing db) I'm using Microsoft SQL Server 2008

    Read the article

  • Most efficient way to move a few SQL Server tables to SQLite?

    - by wom
    I have a fairly large SQL Server database; I'd like to pull 4 tables out and dump them directly into an sqlite.db for remote querying (via nightly batch). I was about to write a script to step through(most likely on a unix host kicked off via cron); but there should be a simpler method to export the tables directly (SQLite not an option in the included DTS Import/Export wizard) What would the most efficient method of dumping the SQL Server tables to SQLite via batch be?

    Read the article

  • NullPointerException while trying to bind at SimpleCursorAdapter

    - by hrskrs
    I have asked a question before where i found my mistake. However now i am facing with another problem. I have checked all the similar errors asked on StackOverflow but without success.Any help is appriciated. The idea here is that i am getting image names from DB so depending on those names images from Drawable folder will be shown in a listView together with a description but im getting an error of NullPointException at setViewValue. Here is the code snippet: private void populateListView() { ListView customListView = (ListView)findViewById(R.id.lvCustom); Cursor cursor = DBhelper.getAllimages(); startManagingCursor(cursor); String[] from = { DBhelper.COLUMN_PIC_URL, DBhelper.COLUMN_PIC_DESC}; int[] to = {R.id.ivImg, R.id.tvTitle}; SimpleCursorAdapter cursorAdapter = new SimpleCursorAdapter(this, R.layout.custom_listview_row, cursor, from, to, 0); cursorAdapter.setViewBinder(new ViewBinder() { @Override public boolean setViewValue(View view, Cursor cursor, int columnIndex) { ImageView imageImageView = (ImageView)findViewById(R.id.ivImg); String[] imgNames = new String[cursor.getCount()]; int[] imgResourceIds = new int[cursor.getCount()]; for(int i=0; i<cursor.getCount(); i++){ imgNames[i] = cursor.getString(cursor.getColumnIndex(DBhelper.COLUMN_PIC_URL)); imgResourceIds[i] = getResources().getIdentifier(imgNames[i], "drawable", getPackageName()); imageImageView.setImageResource(imgResourceIds[i]); cursor.moveToNext(); } return true; } }); customListView.setAdapter(cursorAdapter); } Here is the Error from LogCat: I have tried to log the output of imgNames[i] where it returns the url pic from the DB correctly and imgResourceIds[i] where it return the image resource id correctly also(it does not return NULL but something like: 295731). But it stops at imageImageView.setImageResource(imgResourceIds[i]); To see from where that NullPointerException is coming, i commented out imageImageView.setImageResource(imgResourceIds[i]);. This time imageNames(those with a TAG) and imgResourceIds(those system printed out) came correctly but doubled, when i removed cursor.MoveToNext() last row were doubled. Here is the screen shot of that: I have tried all the suggestions on stack about gettin a NullException but without success. Any idea where i am doing mistake?

    Read the article

  • Confused about distinct/aggregate queries with (N)Hibernate

    - by nw
    I'm not sure how to approach queries that don't map 1:1 to my persistent entities - in other words, distinct and aggregate queries. For example, I need to retrieve a distinct list of property values for populating a drop-down list. Should I write a class and a mapping for the "entities" that are returned by this query? Or should I just use the native DB provider and work with native data sets instead?

    Read the article

  • limiting a query to a specific item

    - by Dev-Ria
    I have a db with thousands of domains and data. I want to list only 100 rows of each domain. i can't use LIMIT 100 cause that only limits 100 records but I want dom1 to list 100 dom2 to list 100 dom3 to list 100 all in one query. This is what I have so far. SELECT domain COUNT(Key) AS DomCount FROM table_domain GROUP BY user,location ORDER BY domain,DomCount DESC Could I use a CASE?

    Read the article

  • Java / MySQL - How to access connection from another class?

    - by Alex
    I'm just getting my head around java (and OOP for that matter), the only thing I am familiar with is MySQL. I need to keep the DB connection open throughout the duration of the application, as well as a server socket. I'm not even sure if they both need separate classes, but here's what I have so far: http://pastebin.com/qzMFFTrY (it wouldn't all go in a code tag) The variable I need is con for line 86.

    Read the article

  • Find query that caused update

    - by MadMax
    We have been having problems with ghost updates in our DB (SQL Server 2005) fields are changeing and we cannot find the routine that is updating. Is there a way using an update trigger (Or any other way) to tell what caused the update?

    Read the article

  • Download a file+

    - by Martin
    Hi, First PHP project and I'm stuck! I wish to allow users to click a button or a link and download a file. However, my PHP must first perform some tasks, choose the right file, record the download event in a db etc. This I can do, but how do I then send the file as a response to the user's click? Thanks for any help.

    Read the article

  • .NET & Worflow, SqlTrackingQuery.GetWorkflows() on wire correct - presented object not

    - by UKShots
    With windows workflow when using the tracking service, the SqlTrackingQuery.GetWorkflows() method returns correctly the workflow type and assembly version on the wire from the DB query - but when one comes to query the returned SqlTrackingWorkflowInstance object it's WorkflowType.AssemblyQualifiedName property is returned as the current assembly version of the workflow type (i.e. it looks to matching on FQ type name only and not version). Anyone know how to get to the actual returned data (other than either a custom query or hook)?

    Read the article

  • Check mysql_query results if DELETE query worked?

    - by Camran
    I have a DELETE query which deletes a record from a mysql db. is there any way to make sure if the delete was performed or not? I mean, for a query to FIND stuff you do $res=mysql_query($var); $nr=mysql_num_rows($res); and you get nr of rows returned. Is there any similiar method for deletion of records? Thanks

    Read the article

  • Allow users to pull temporary data then delete table data (headers remain)?

    - by JM4
    I don't know the best way to title this question but am trying to accomplish the following goal: When a client logs into their profile, they are presented with a link to download data from an existing database in CSV format. The process works, however, I would like for this data to be 'fresh' each time they click the link so my plan was - once a user has clicked the link and downloaded the CSV file, the database table would 'erase' all of its data and start fresh (be empty) until the next set of data populated it. My EXISTING CSV creation code: <?php $host = 'localhost'; $user = 'username'; $pass = 'password'; $db = 'database'; $table = 'tablename'; $file = 'export'; $link = mysql_connect($host, $user, $pass) or die("Can not connect." . mysql_error()); mysql_select_db($db) or die("Can not connect."); $result = mysql_query("SHOW COLUMNS FROM ".$table.""); $i = 0; if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $csv_output .= $row['Field'].", "; $i++; } } $csv_output .= "\n"; $values = mysql_query("SELECT * FROM ".$table.""); while ($rowr = mysql_fetch_row($values)) { for ($j=0;$j<$i;$j++) { $csv_output .= '"'.$rowr[$j].'",'; } $csv_output .= "\n"; } $filename = $file."_".date("Y-m-d",time()); header("Content-type: application/vnd.ms-excel"); header("Content-disposition: csv" . date("Y-m-d") . ".csv"); header( "Content-disposition: filename=".$filename.".csv"); print $csv_output; exit; ?> any ideas?

    Read the article

  • mysql_query() returns returns true, but mysql_num_rows() and mysql_fetch_array() give "not a valid r

    - by zlance4012
    Here is the code in question: -----From index.php----- require_once('includes/DbConnector.php'); // Create an object (instance) of the DbConnector $connector = new DbConnector(); // Execute the query to retrieve articles $query1 = "SELECT id, title FROM articles ORDER BY id DESC LIMIT 0,5"; $result = $connector-query($query1); echo "vardump1:"; var_dump($result); echo "\n"; /(!line 17!)/ echo "Number of rows in the result of the query:".mysql_num_rows($result)."\n"; // Get an array containing the results. // Loop for each item in that array while ($row = $connector-fetchArray($result)){ echo ' '; echo $row['title']; echo ' '; -----end index.php----- -----included DbConnector.php----- $settings = SystemComponent::getSettings(); // Get the main settings from the array we just loaded $host = $settings['dbhost']; $db = $settings['dbname']; $user = $settings['dbusername']; $pass = $settings['dbpassword']; // Connect to the database $this-link = mysql_connect($host, $user, $pass); mysql_select_db($db); register_shutdown_function(array(&$this, 'close')); } //end constructor //* Function: query, Purpose: Execute a database query * function query($query) { echo "Query Statement: ".$query."\n"; $this-theQuery = $query; return mysql_query($query, $this-link) or die(mysql_error()); } //* Function: fetchArray, Purpose: Get array of query results * function fetchArray($result) { echo "<|"; var_dump($result); echo "| \n"; /(!line 50!)/$res= mysql_fetch_array($result) or die(mysql_error()); echo $res['id']."-".$res['title']."-".$res['imagelink']."-".$res['text']; return $res; } -----end DbConnector.php----- -----Output----- Query Statement: SELECT id, title FROM articles ORDER BY id DESC LIMIT 0,5 vardump1:bool(true) PHP Error Message Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /path to/index.php on line 17 Number of rows in the result of the query: <|bool(true) | PHP Error Message Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /path to/DbConnector.php on line 50

    Read the article

  • MySQL Can't Handle Parameters for Stored Procedures

    - by Takkun
    I'm trying to make a stored procedure but it doesn't seem to be recognizing the parameters I've given it. Procedure create procedure test_pro(IN searchTable VARCHAR(55)) begin select * from searchTable limit 10; end // Trying to execute mysql> call test_pro('exampleTable'); ERROR 1146 (42S02): Table 'db.searchTable' doesn't exist It isn't replacing the searchTable with the parameter that is passed in.

    Read the article

  • Check value existance while performing a UPDATE query

    - by nimo
    Hi, I need to perform a simple update query where the update should only be done, if there is no value with updating value (item_name). For example, DB table [item_types] item_id(PK) | item_name Assuming there exist item_id with 6, My attempt is UPDATE item_types as k SET k.item_name = 'item_1' WHERE NOT EXISTS (SELECT * FROM item_types as a WHERE a.item_name = 'item_1') AND k.item_id = '6' But this gives me error "You can't specify target table 'k' for update in FROM clause" Could you please explain the error here and how can I achieve this ? Thank you

    Read the article

  • Multiple reference in SQL

    - by AGarofoli
    Hi! I'm working on a db but i'm kinda new to this so i've bumped into a problem today. I've got some tables: OFFICE, ROOM, EMPLOYEE and DOCUMENT. Document must specify the sender, which can be a single employee, an entire room or an entire office so it must have a reference to the primary keys of those tables. Should I do a "parallel" table for handle it (for example i've done one for handle the multiple recipients documents) or there is another way? Thank you

    Read the article

< Previous Page | 228 229 230 231 232 233 234 235 236 237 238 239  | Next Page >