Search Results

Search found 26283 results on 1052 pages for 'temporary table'.

Page 51/1052 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Create automatically table that is composed by its primery key and 2 other foreign keys

    - by user210481
    I have table A with a primary id, a table B with a primary key id also and another table C with a primary key id and rows Aid and Bid where Aid and Bid are foreign keys of C and the primary keys of A and B respectively. One way of populating these DB would be populating table A, table B and table C separately. I would like to know if there is a more clever way of doing it, where I could populate A first and at the same time I populate B, I can indicate that an entry in C should be also created. Any idea and suggestion on how to populate them is welcome. I'm trying to take advantage of the foreign keys structure Thanks

    Read the article

  • user table with javaDB and Hibernate from within grails

    - by Ralf
    let's see if I can ask this in an understandable way... I started with grails and created a domain class called user. As far as I understand, Hibernate is used to map this domain class to the database. This works pretty fine with hsqldb. Now I tried to switch to javaDB and get an error message because the table is called "user" (which seems to be a reserved word for javaDB). So a statement like create table user ... will result in an error message. create table "user" ... works, but Hibernate seems not put put the table name in quotes. How can I configure Hibernate to use quotes in order to make it work with my table name? PS: yes, I know, I could map the domain class to another table name... :-)

    Read the article

  • How to embed html table into the bpdy of email

    - by Michael Mao
    Hi all: I am sending info to target email via PHP native mail() method right now. Everything else works fine but the table part troubles me the most. See sample output : Dear Michael Mao : Thank you for purchasing flight tickets with us, here is your receipt : Your tickets will be delivered by mail to the following address : Street Address 1 : sdfsdafsadf sdf Street Address 2 : N/A City : Sydney State : nsw Postcode : 2 Country : Australia Credit Card Number : *************1234 Your purchase details are recorded as : <table><tr><th class="delete">del?</th><th class="from_city">from</th><th class="to_city">to</th><th class="quantity">qty</th><th class="price">unit price</th><th class="price">total price</th></tr><tr class="evenrow" id="Sydney-Lima"><td><input name="isDeleting" type="checkbox"></td><td>Sydney</td><td>Lima</td><td>1</td><td>1030.00</td><td>1030</td></tr><tr class="oddrow" id="Sydney-Perth"><td><input name="isDeleting" type="checkbox"></td><td>Sydney</td><td>Perth</td><td>3</td><td>340.00</td><td>1020</td></tr><tr class="totalprice"><td colspan="5">Grand Total Price</td><td id="grandtotal">2050</td></tr></table> The source of table is directly taken from a webpage, exactly as the same. However, Gmail, Hotmail and most of other emails will ignore to render this as a table. So I am wondering, without using Outlook or other email sending agent software, how could I craft a embedded table for the PHP mail() method to send? Current code snippet corresponds to table generation : $purchaseinfo = $_POST["purchaseinfo"]; //if html tags are not to be filtered in the body of email $stringBuilder .= "<table>" .stripslashes($purchaseinfo) ."</table>"; //must send json response back to caller ajax request if(mail($email, 'Your purchase information on www.hardlyworldtravel.com', $emailbody, $headers)) echo json_encode(array("feedback"=>"successful")); else echo json_encode(array("feedback"=>"error")); Any hints and suggestions are welcomed, thanks a lot in advance.

    Read the article

  • user table with javaDB and hybernate from within grails

    - by Ralf
    let's see if I can ask this in an understandable way... I started with grails and created a domain class called user. As far as I understand, hybernate is used to map this domain class to the database. This works pretty fine with hsqldb. Now I tried to switch to javaDB and get an error message because the table is called "user" (which seems to be a reserverd word for javaDB). So a statement like create table user ... will result in an error message. create table "user" ... works, but hybernate seems not put put the table name in quotes. How can I configure hybernate to use quotes in order to make it work with my table name? PS: yes, I know, I could map the domain class to another table name... :-)

    Read the article

  • SQL: select random row from table where the ID of the row isn't in another table?

    - by johnrl
    I've been looking at fast ways to select a random row from a table and have found the following site: http://74.125.77.132/search?q=cache:http://jan.kneschke.de/projects/mysql/order-by-rand/&hl=en&strip=1 What I want to do is to select a random url from my table 'urls' that I DON'T have in my other table 'urlinfo'.The query I am using now selects a random url from 'urls' but I need it modified to only return a random url that is NOT in the 'urlinfo' table. Heres the query: SELECT url FROM urls JOIN (SELECT CEIL(RAND() * (SELECT MAX(urlid) FROM urls ) ) AS urlid ) AS r2 USING(urlid); And the two tables: CREATE TABLE urls ( urlid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, url VARCHAR(255) NOT NULL, ) ENGINE=INNODB; CREATE TABLE urlinfo ( urlid INT NOT NULL PRIMARY KEY, urlinfo VARCHAR(10000), FOREIGN KEY (urlid) REFERENCES urls (urlid) ) ENGINE=INNODB;

    Read the article

  • NHibernate mapping one table on two classes with where selection

    - by Rene Schulte
    We would like to map a single table on two classes with NHibernate. The mapping has to be dynamically depending on the value of a column. Here's a simple example to make it a bit clearer: We have a table called Person with the columns id, Name and Sex. The data from this table should be mapped either on the class Male or on the class Female depending on the value of the column Sex. In Pseudocode: create instance of Male with data from table Person where Person.Sex = 'm'; create instance of Female with data from table Person where Person.Sex = 'f'; The benefit is we have strongly typed domain models and can later avoid switch statements. Is this possible with NHibernate or do we have to map the Person table into a flat Person class first? Then afterwards we would have to use a custom factory method that takes a flat Person instance and returns a Female or Male instance. Would be good if NHibernate (or another library) can handle this.

    Read the article

  • MySQL: Copy a field to another table

    - by harpax
    I have a table posts that could look like this: id | title | body | created | .. ------------------------------------------- I would like to use the boolean search feature that is offered by a MyISAM Table, but the posts table is InnoDB. So I created another table 'post_contents' that looks like this: post_id | body -------------------- That table is already filled with some contents and I can use the boolean search. However, I need to move the title field in the post_contents table as well and then copy the existing title-data to the new field. I know about the INSERT .. SELECT syntax, but I don't seem to be able to create the correct query.

    Read the article

  • Select from table and function

    - by David Oneill
    I have a function that returns a table. The returned table contains (among other things) a store_id. I can get the store_id for a particular transaction_id and city_id as follows: select store_id from table(f_get_store(city_id, transaction_id)); I have another table that contains a list of transactions (which includes transaction_id and city_id). I want a query that returns store_id, city_id, transaction_id for every entry in the transaction table. My first guess was: select f_get_store(city_id, transaction_id), city_id, transaction_id from table; (simplified away the unimportant details) However, this yields an "ORA-00932: inconsistent datatypes" error. How do I need to structure this query? (I'm using Oracle)

    Read the article

  • parentNode.parentNode.rowindex to delete a row in a dynamic table

    - by billy85
    I am creating my rows dynamically when the user clicks on "Ajouter". <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script> function getXhr(){ var xhr = null; if(window.XMLHttpRequest) // Firefox and others xhr = new XMLHttpRequest(); else if(window.ActiveXObject){ // Internet Explorer try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } } else { // XMLHttpRequest not supported by your browser alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); xhr = false; } return xhr } /** * method called when the user clicks on the button */ function go(){ var xhr = getXhr() // We defined what we gonna do with the response xhr.onreadystatechange = function(){ // We do somthing once the server's response is OK if(xhr.readyState == 4 && xhr.status == 200){ //alert(xhr.responseText); var body = document.getElementsByTagName("body")[0]; // Retrieve <table> ID and create a <tbody> element var tbl = document.getElementById("table"); var tblBody = document.createElement("tbody"); var row = document.createElement("tr"); // Create <td> elements and a text node, make the text // node the contents of the <td>, and put the <td> at // the end of the table row var cell_1 = document.createElement("td"); var cell_2 = document.createElement("td"); var cell_3 = document.createElement("td"); var cell_4 = document.createElement("td"); // Create the first cell which is a text zone var cell1=document.createElement("input"); cell1.type="text"; cell1.name="fname"; cell1.size="20"; cell1.maxlength="50"; cell_1.appendChild(cell1); // Create the second cell which is a text area var cell2=document.createElement("textarea"); cell2.name="fdescription"; cell2.rows="2"; cell2.cols="30"; cell_2.appendChild(cell2); var cell3 = document.createElement("div"); cell3.innerHTML=xhr.responseText; cell_3.appendChild(cell3); // Create the fourth cell which is a href var cell4 = document.createElement("a"); cell4.appendChild(document.createTextNode("[Delete]")); cell4.setAttribute("href","javascrit:deleteRow();"); cell_4.appendChild(cell4); // add cells to the row row.appendChild(cell_1); row.appendChild(cell_2); row.appendChild(cell_3); row.appendChild(cell_4); // add the row to the end of the table body tblBody.appendChild(row); // put the <tbody> in the <table> tbl.appendChild(tblBody); // appends <table> into <body> body.appendChild(tbl); // sets the border attribute of tbl to 2; tbl.setAttribute("border", "1"); } } xhr.open("GET","fstatus.php",true); xhr.send(null); } </head> <body > <h1> Create an Item </h1> <form method="post"> <table align="center" border = "2" cellspacing ="0" cellpadding="3" id="table"> <tr><td><b>Functionality Name:</b></td> <td><b>Description:</b></td> <td><b>Status:</b></td> <td><input type="button" Name= "Ajouter" Value="Ajouter" onclick="go()"></td></tr> </table> </form> </body> </html> Now, I would like to use the href [Delete] to delete one particular row. I wrote this: <script type="text/javascript"> function deleteRow(r){ var i=r.parentNode.parentNode.rowIndex; document.getElementById('table').deleteRow(i); } </script> When I change the first code like this: cell4.setAttribute("href","javascrit:deleteRow(this);"); I got an error: The page cannot be displayed. I am redirected to a new pagewhich can not be displayed. How could I delete my row by using the function deleteRow(r)? table is the id of my table Thanks. Billy85

    Read the article

  • EF4 CTP5 Code First approach ignores Table attributes

    - by Justin
    I'm using EF4 CTP5 code first approach but am having trouble getting it to work. I have a class called "Company" and a database table called "CompanyTable". I want to map the Company class to the CompanyTable table, so have code like this: [Table(Name = "CompanyTable")] public class Company { [Key] [Column(Name = "CompanyIdNumber", DbType = "int")] public int CompanyNumber { get; set; } [Column(Name = "CompanyName", DbType = "varchar")] public string CompanyName { get; set; } } I then call it like so: var db = new Users(); var companies = (from c in db.Companies select c).ToList(); However it errors out: Invalid object name 'dbo.Companies'. It's obviously not respecting the Table attribute on the class, even though it says here that Table attribute is supported. Also it's pluralizing the name it's searching for (Companies instead of Company.) How do I map the class to the table name?

    Read the article

  • Need help with SQL table structure transformation

    - by Arnis L.
    I need to perform update/insert simultaneously changing structure of incoming data. Think about Shops that have defined work time for each day of the week. Hopefully, this might explain better what I'm trying to achieve: worktimeOrigin table: columns: shop_id day val data: 123 | "monday" | "9:00 AM - 18:00" 123 | "tuesday" | "9:00 AM - 18:00" 123 | "wednesday" | "9:00 AM - 18:00" shop table: columns: id worktimeDestination.id worktimeDestination table: columns: id monday tuesday wednesday My aim: I would like to insert data from worktimeOrigin table into worktimeDestination and specify appropriate worktimeDestination for shop. shop table data: 123 1 (updated) worktimeDestination table data: 1 | "9:00 AM - 18:00" | "9:00 AM - 18:00" | "9:00 AM - 18:00" (inserted) Any ideas how to do that?

    Read the article

  • How to embed html table into the body of email

    - by Michael Mao
    Hi all: I am sending info to target email via PHP native mail() method right now. Everything else works fine but the table part troubles me the most. See sample output : Dear Michael Mao : Thank you for purchasing flight tickets with us, here is your receipt : Your tickets will be delivered by mail to the following address : Street Address 1 : sdfsdafsadf sdf Street Address 2 : N/A City : Sydney State : nsw Postcode : 2 Country : Australia Credit Card Number : *************1234 Your purchase details are recorded as : <table><tr><th class="delete">del?</th><th class="from_city">from</th><th class="to_city">to</th><th class="quantity">qty</th><th class="price">unit price</th><th class="price">total price</th></tr><tr class="evenrow" id="Sydney-Lima"><td><input name="isDeleting" type="checkbox"></td><td>Sydney</td><td>Lima</td><td>1</td><td>1030.00</td><td>1030</td></tr><tr class="oddrow" id="Sydney-Perth"><td><input name="isDeleting" type="checkbox"></td><td>Sydney</td><td>Perth</td><td>3</td><td>340.00</td><td>1020</td></tr><tr class="totalprice"><td colspan="5">Grand Total Price</td><td id="grandtotal">2050</td></tr></table> The source of table is directly taken from a webpage, exactly as the same. However, Gmail, Hotmail and most of other emails will ignore to render this as a table. So I am wondering, without using Outlook or other email sending agent software, how could I craft a embedded table for the PHP mail() method to send? Current code snippet corresponds to table generation : $purchaseinfo = $_POST["purchaseinfo"]; //if html tags are not to be filtered in the body of email $stringBuilder .= "<table>" .stripslashes($purchaseinfo) ."</table>"; //must send json response back to caller ajax request if(mail($email, 'Your purchase information on www.hardlyworldtravel.com', $emailbody, $headers)) echo json_encode(array("feedback"=>"successful")); else echo json_encode(array("feedback"=>"error")); Any hints and suggestions are welcomed, thanks a lot in advance.

    Read the article

  • Combine query results from one table with the defaults from another

    - by pulegium
    This is a dumbed down version of the real table data, so may look bit silly. Table 1 (users): id INT username TEXT favourite_food TEXT food_pref_id INT Table 2 (food_preferences): id INT food_type TEXT The logic is as follows: Let's say I have this in my food preference table: 1, 'VEGETARIAN' and this in the users table: 1, 'John', NULL, 1 2, 'Pete', 'Curry', 1 In which case John defaults to be a vegetarian, but Pete should show up as a person who enjoys curry. Question, is there any way to combine the query into one select statement, so that it would get the default from the preferences table if the favourite_food column is NULL? I can obviously do this in application logic, but would be nice just to offload this to SQL, if possible. DB is SQLite3...

    Read the article

  • JQuery invert table selection

    - by Lars Tackmann
    I have page part like this <div id="inbox"> <h1>Headline</h1> <p>First paragraph</p> <table> <tbody> <tr> <td>table stuff</td> </tr> </tbody> </table> <p>Second paragraph</p> </div> I want to assign a handler to everything within the #inbox div that is not a part (a child) of the table. I tried to do something like $('#inbox:not(:has(table))').click(function(){ alert('hello inbox'); }); But that does not work, so how do I invert the selection of the table inside the #inbox ?

    Read the article

  • Split table and insert with identity link

    - by The King
    Hi.. I have 3 tables similar to the sctructure below CREATE TABLE [dbo].[EmpBasic]( [EmpID] [int] IDENTITY(1,1) NOT NULL Primary Key, [Name] [varchar](50), [Address] [varchar](50) ) CREATE TABLE [dbo].[EmpProject]( [EmpID] [int] NOT NULL primary key, // referencing column with EmpBasic [EmpProject] [varchar](50) ) CREATE TABLE [dbo].[EmpFull_Temp]( [ObjectID] [int] IDENTITY(1,1) NOT NULL Primary Key, [T1Name] [varchar](50) , [T1Address] [varchar](50) , [T1EmpProject] [varchar](50) ) The EmpFull_Temp table has the records with a dummy object ID column... I want to populate the first 2 tables with the records in this table... But with EmpID as a reference between the first 2 tables. I tried this in a stored procedure... Create Table #IDSS (EmpID bigint, objID bigint) Insert into EmpBasic output Inserted.EmpID, EmpFull_Temp.ObjectID into #IDSS Select T1Name, T1Address from EmpFull_Temp Where ObjectID < 106 Insert into EmpProject Select A.EmpID, B.T1EmpProject from #IDSS as A, EmpFull_Temp as B Where A.ObjID = B.ObjectID But it says.. The multi-part identifier "EmpFull_Temp.ObjectID" could not be bound. Could you please help me in achieving this...

    Read the article

  • Dynamic table in Asp.Net

    - by Sivakumar
    Hi guys here I've created d dynamic table and how can i set d properties of the table like height, width and etc? Pls help me.. Thanks... code private void GenerateTable(int rowsCount) { Table table = new Table(); for (int i = 0; i < rowsCount; i++) { TableRow row = new TableRow(); TableCell cell = new TableCell(); TextBox tb1 = new TextBox(); DropDownList drp1 = new DropDownList(); tb1.ID= "dname"+i;drp1.ID = "relation" + i; cell.Controls.Add(tb1); cell.Controls.Add(drp1); row.Cells.Add(cell);table.Rows.Add(row); } rowsCount++; ViewState["RowsCount"] = rowsCount; }

    Read the article

  • update table in gtk

    - by ali
    I have window that contains a table on screen, now I want to attach a widget to that table I use gtk_table_attach(GTK_TABLE(table), label, ...) the function is correct and it runs without any error but table does not respond to that line I mean there is no change on my table, I think I need something to tell that table update it self but how? note= that line is inside a callback of a signal and I am sure that signal runs note2= I do not want to destroy window for that note3= I use gtk+ and pygtk note4= I am sure I attach that widget to a correct position ( it is free)

    Read the article

  • How to Map a table with another lookup table using JPA?

    - by Sameer Malhotra
    Hi, I have two tables: 1) Application(int appid, int statusid, String appname, String appcity with getter and Setter methods) 2) App_Status(int statusid,String statusDescription with setter and getter methods) I want to map Application table with App_Status so that I don't have to query separately App_Status table in order to get the statusDescription. One thing I have to careful is that no matter what (Insert,update or delete) to the Application table the App_Status table should be unaffected means its a read only table which is maintained by the DBA internally and used only for lookup table. I am using JPA annotations so please suggest how to handle this.

    Read the article

  • join 03 table in the database codeIgniter

    - by python
    with my table. person_id serial NOT NULL, firstname character varying(30) NOT NULL, lastname character varying(30), email character varying(50), username character varying(20) NOT NULL, "password" character varying(100) NOT NULL, gender character varying(10), dob date, accesslevel smallint NOT NULL, company_id integer NOT NULL,//Reference to table company position_id integer NOT NULL,//Reference to table position company_id serial NOT NULL, company_name character varying(80) NOT NULL, description character varying(255), address character varying(100) NOT NULL, In my controller ........................ // load data $persons = $this->person_model->get_paged_list(10,0); // generate table data $this->load->library('table'); $this->table->set_empty("&nbsp;"); $this->table->set_heading('No', 'FirstName', 'LastName','E-mail','Company''Gender', 'Date of Birth', 'Actions'); foreach ($persons as $person){ $this->table->add_row(++$i, $person->firstname, $person->lastname, $person->email, $person->company_name, //HOW CAN I GOT THE POSITION TITLE ?, strtoupper($person->gender)=='M'? 'Male':'Female', date('d-m-Y',strtotime($person->dob)), } My model <?php class Person_Model extends Model { private $person= 'person'; function Person(){ parent::Model(); } function list_all(){ $this->db->order_by('person_id','asc'); return $this->db->get($person); } function count_all(){ return $this->db->count_all($this->person); } function get_paged_list($limit = 0, $offset = 0) { $this->db->limit($limit, $offset); $this->db->select("person.*, company.company_name as company"); $this->db->from('person'); $this->db->join('company','person.company_id = company.company_id','left'); //MY QUESTION:? CAN I JOIN MORE WITH TABLE POSITION? $query = $this->db->get(); return $query->result(); } function get_by_id($id){ $this->db->where('person_id', $id); return $this->db->get($this->person); } function save($person){ $this->db->insert($this->person, $person); return $this->db->insert_id(); } function update($id, $person){ $this->db->where('person_id', $id); $this->db->update($this->person, $person); } function delete($id){ $this->db->where('person_id', $id); $this->db->delete($this->person); } } ?>

    Read the article

  • Truncating a table referenced by a foreign key

    - by born to hula
    Hey, We have two tables in a SQL Server 2005 database, A and B.There is a service which truncates table A every day. Recently, a foreign key constraint was added to table B, referencing table A. As a result, it isn't possible truncating table A anymore, even if table B is empty. Is there any workaround to get the same result as truncating table A? I've already tried the approach below but the identity wasn't reset. DBCC CHECKIDENT (TABLENAME, RESEED, 0) PS. before anyone points this as a duplicate, the different thing here is that I'm not allowed to drop constraints, nor creating any.

    Read the article

  • read contents of a sql table into a data grid view

    - by syedsaleemss
    Im using c# .net windows application form. i have created a database named "resources" in SQL server 2005. In that i have a table named "resourcetable" which has two columns. now i need to read the data in the table into a datagridview. I can do this by using the connection string and querry by giving the table name. But my problem is i have a button and if i click on that button, an open dialog box should open and i should be able to select a database amomng many databases and in that selected database i have to select one table amomg many tables. i.e select a table ofa particular database. and the contents of that table are to be displayed in a datagridview.

    Read the article

  • SQL Server Express: Failed to add primary key after creating a database table

    - by Syd
    Scenario: I have created a database table. And when I tried to add a primary key (using the SQL Server Management Studiio) to the table, it failed with an error message "Saving changes is not permitted. The changes you have made requrie the following tables to be dropped and re-created. You have either made changes to a table that can't be recreated or enabled the option Prevent savign changes that require the table to be re-created." The environment is Windows 7. I have earlier installed it on a Windows XP SP2 and it worked. And yes, my table is empty (freshly created). My current workaround is to run the "Drop and Create" script. The other alternative is to create the primary key before I save the table. Is this a bug or a limitation with the Express version?

    Read the article

  • MySQL Join a Table if Exists Question

    - by swhitlow
    I have a DB which has a table called "config". This table could possibly have a "config_cstm" table that is related by the id to the config table. I was wondering - is there a way to dynamically check for the existence of this table in one simple select statement? In other words, something like: "select * from config (IF EXISTS config_cstm THEN LEFT OUTER JOIN config_cstm ON config.id = config_cstm.id_c" I know how I would go about checking for the existence of an existing table in PHP. I was wanting to do this all in one MySQL statement though. Any suggestions? Thanks!

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >