Search Results

Search found 12215 results on 489 pages for 'identity column'.

Page 127/489 | < Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >

  • AWK If/ElseConditional Problem

    - by neversaint
    I have a data that looks like this: foo foo scaffold_7 1 4845 6422 4845 bar bar scaffold_7 -1 14689 16310 16310 What I want to do is to process the above lines where I just want to print column 1,2,3, 7 and one more column after 7th. But with condition when printing column 7 onwards. Below is my awk script: awk '{ if ($4=="+") { {end=$6-$5}{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $7 "\t" end+$7} } else {end=$6-$5}{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $7-end "\t" $7} }' But why it doesn't achieve the desired result like this? foo foo scaffold_7 1 4845 6422 bar bar scaffold_7 -1 14689 16310 Note that the arithmetic (e.g. $7-end or end+$7) is a must. So we can't just swap column from input file. Furthermore this AWK will be inside a bash script.

    Read the article

  • SSRS csv export

    - by Lijo
    Hi Team, I am working on SSRS 2005. I have a column that has a comm to be displayed. I write it in the header; but the SP returns without comma for the column header. When I export the report to csv, the column names are taking the name of the text box with is not having comma. Is there a way to display comma in the header when exported to csv? Thanks Lijo

    Read the article

  • Table Design For SystemSettings, Best Model

    - by Chris L
    Someone suggested moving a table full of settings, where each column is a setting name(or type) and the rows are the customers & their respective settings for each setting. ID | IsAdmin | ImagePath ------------------------------ 12 | 1          | \path\to\images 34 | 0          | \path\to\images The downside to this is every time we want a new setting name(or type) we alter the table(via sql) and add the new (column)setting name/type. Then update the rows(so that each customer now has a value for that setting). The new table design proposal. The proposal is to have a column for setting name and another column for setting. ID | SettingName | SettingValue ---------------------------- 12 | IsAdmin        | 1 12 | ImagePath   | \path\to\images 34 | IsAdmin        | 0 34 | ImagePath   | \path\to\images The point they made was that adding a new setting was as easy as a simple insert statement to the row, no added column. But something doesn't feel right about the second design, it looks bad, but I can't come up with any arguments against it. Am I wrong?

    Read the article

  • Hibernate one-to-one mapping

    - by Andrey Yaskulsky
    I have one-to-one hibernate mapping between class Student and class Points: @Entity @Table(name = "Users") public class Student implements IUser { @Id @Column(name = "id") private int id; @Column(name = "name") private String name; @Column(name = "password") private String password; @OneToOne(fetch = FetchType.EAGER, mappedBy = "student") private Points points; @Column(name = "type") private int type = getType(); //gets and sets... @Entity @Table(name = "Points") public class Points { @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "student")) @Id @GeneratedValue(generator = "generator") @Column(name = "id", unique = true, nullable = false) private int Id; @OneToOne @PrimaryKeyJoinColumn private Student student; //gets and sets And then i do: Student student = new Student(); student.setId(1); student.setName("Andrew"); student.setPassword("Password"); Points points = new Points(); points.setPoints(0.99); student.setPoints(points); points.setStudent(student); Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); session.save(student); session.getTransaction().commit(); And hibernate saves student in the table but not saves corresponding points. Is it OK? Should i save points separately?

    Read the article

  • Datatype query on datetime and tinyint

    - by sarah
    Hi , I have Mysql column type has datetime what should be the corresponding datatype in entity bean class for the same column ,as well for tinyint what would be the corresponding datatype in entity bean class for the same column ?

    Read the article

  • parsing issue with comma separated csv file

    - by Andrei
    I am trying to extract 4th column from csv file (comma separated, and skipping first 2 header lines) using this command, awk 'NR <2 {next}{FS =","}{print $4}' filename.csv | more However, it doesn't work because the first column cantains comma, thus 4th column is not really 4th. Below is an example of a row: "sdfsdfsd, sfsdf", 454,fgdfg, I_want_this_column,sdfgdg

    Read the article

  • Open Id XRDS Discovery

    - by Asciant
    I am working with Open Id, just playing around making a class to interact / auth Open Id's on my site (in PHP). I know there are a few other Libraries (like RPX), but I want to use my own (its good to keep help better understand the protocol and whether its right for me). The question I have relates to the Open Id discovery sequence. Basically I have reached the point where I am looking at using the XRDS doc to get the local identity (openid.identity) from the claimed identity (openid.claimed_id). My question is, do I have to make a cURL request to get the XRDS Location (X-XRDS-location) and then make another cURL request to get the actual XRDS doc?? It seems like with a DUMB request I only make one cURL request and get the Open Id Server, but have to make two to use the XRDS Smart method. Just doesn't seem right, can anyone else give me some info.

    Read the article

  • User sumbitted top 5 and sort by popularity

    - by Bundy
    Hi, Database setup (MySQL) table: top_fives id, uid, first, second, third, fourth, fifth, creation_date 1, 1, cheese, eggs, ham, bacon, ketchup, 2010-03-17 2, 2, mayonaise, cheese, ketchup, eggs, bacon, 2010-03-17 Users can submit their top 5 of a certain subject. Now I would like a summary of the top fives ordered by popularity. Each column has it's own point value. column 'first' is rewarded 5 points, 'second' four points, 'third' three points, and so on... So, in my example it should be something like this: 1 Cheese (9 points = 5 + 4 -> 1 time in 'first' column and 1 time in 'second' column) 2 Eggs (6 points) 3 Mayonaise (5 points) 4 Ketchup (4 points) 5 Bacon (3 points) 6 Ham (3 points) What would be the easiest solution (PHP) for this kind of situation? Thanks in advance

    Read the article

  • creating executable jar file for my java application

    - by Manu
    public class createExcel { public void write() throws IOException, WriteException { WorkbookSettings wbSettings = new WorkbookSettings(); wbSettings.setLocale(new Locale("en", "EN")); WritableWorkbook workbook1 =Workbook.createWorkbook(new File(file), wbSettings); workbook1.createSheet("Niru ", 0); WritableSheet excelSheet = workbook1.getSheet(0); createLabel(excelSheet); createContent(excelSheet,list); workbook1.write(); workbook1.close(); } public void createLabel(WritableSheet sheet)throws WriteException { WritableFont times10pt = new WritableFont(WritableFont.createFont("D:\font\trebuct"),8); // Define the cell format times = new WritableCellFormat(times10pt); // Lets automatically wrap the cells times.setWrap(false); WritableFont times10ptBoldUnderline = new WritableFont( WritableFont.createFont("D:\font\trebuct"), 9, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE); timesBoldUnderline = new WritableCellFormat(times10ptBoldUnderline); sheet.setColumnView(0,15); sheet.setColumnView(1,13); // Write a few headers addCaption(sheet, 0, 0, "Business Date"); addCaption(sheet, 1, 0, "Dealer ID"); } private void createContent(WritableSheet sheet, ArrayList list) throws WriteException,RowsExceededException { // Write a few number for (int i = 1; i < 11; i++) { for(int j=0;j<11;j++){ // First column addNumber(sheet, i, j,1); // Second column addNumber(sheet, 1, i, i * i); } } } private void addCaption(WritableSheet sheet, int column, int row, String s) throws RowsExceededException, WriteException { Label label; label = new Label(column, row, s, timesBoldUnderline); sheet.addCell(label); } private void addNumber(WritableSheet sheet, int row,int column, Integer integer) throws WriteException, RowsExceededException { Number number; number = new Number(column,row, integer, times); sheet.addCell(number); } public static void main(String[] args) { JButton myButton0 = new JButton("Advice_Report"); JButton myButton1 = new JButton("Position_Report"); JPanel bottomPanel = new JPanel(); bottomPanel.add(myButton0); bottomPanel.add(myButton1); myButton0.addActionListener(this); myButton1.addActionListener(this); createExcel obj=new createExcel(); obj.setOutputFile("c;\\temp\\swings\\jack.xls"); try{ obj.write(); }catch(Exception e){} } and so on. it working fine. i have jxl.jar and ojdbc14.jar files(need this jar file for Excelsheet creation and DB connection )and createExcel.class(.class file) file. how to make this code as executable jar file.

    Read the article

  • Mapping self-table one-to-many using non-PK clolumns

    - by Harel Moshe
    Hey, i have a legacy DB to which a Person object is mapped, having a collection of family-members, like this: class Person { ... string Id; /* 9-digits string */ IList<Person> Family; ... } The PERSON table seems like: Id: CHAR(9), PK FamilyId: INT, NOT NULL and several other non-relevant columns. I'm trying to map the Family collection to the PERSON table using the FamilyId column, which is not the PK as mentioned above. So, i actually have a one-to-many which is self-table-referential. I'm getting an error saying 'Cast is not valid' when my mapping looks like this: ... <set name="Family" table="Person" lazy="false"> <key column="FamilyId" /> <one-to-many class="Person" /> </set> ... because obviously, the join NHibernate is trying to make is between the PK column, Id, and the 'secondary' column, FamilyId, instead of joining the FamilyId column to itself. Any ideas please?

    Read the article

  • generate unix timestamp from last time

    - by Nazmin
    hi guys, suppose i have one column in mysql database which is stated last time one equipment is up in h:i:s format (ex: 00:05:11) or 1d21h, means that the equipment is on since 5 min before, what is the best method i can convert this to unix timestamp, say if using php script how? or direct convert last unix timestamp using mysql function query. actually, i want to calculate for start time for this equipment uptime in unix timestamp where i have one column in mysql startcapture that will be deducted with last column to get start time. so starttime = startcapture - last (this last time that has to convert to unix timestamp based on now() - h:i:s ). but the problem is sometimes the format change from h:i:s to ex: 1d22h, if h:i:s means the equipment is up since ex: 00:05:11 min before and if 1d22h means the equipment already up 1 day 22 hours before. so the main things here is to convert last column to appropriate unix timestamp. please help guys, asap.

    Read the article

  • Problem in creating different types of columns in a Winforms gridview

    - by Royson
    My windows form application has a grid view control with filename as a default column. User should create a column of following types Text, Number, Currency, Combo Box, Check Box, Radio Button ,Date time type (should display DateTimePicker control) and Hyper Link type. After that i want to pass all rows to next screen for further processing. We can create a column of these types in a grid view but how can i store it in a data table so that i can pass it to next screen. Or should i create a column in a data table and then assign data table to grid view by gridview.DataSource = dt; but can we create a these types of columns in a data table.

    Read the article

  • Skip some row in jsf dataTable

    - by Marc
    How to skip some rows to be displayed using dataTable: <h:dataTable cellspacing="0" id="dogs" value="#{dogBean.dogs}" var="dog" rendered="#{dogBeans.dogs != null}"> <h:column id="nameColumn"> <h:outputText value="#{dog.name}"/> </h:column> <h:column id="breedColumn"> <h:outputText value="#{dog.breed}"/> </h:column> </h:dataTable> I want to display all dogs, but those how have an age greater than 10. dog.age 10. I'm using Seam.

    Read the article

  • Need to sort using Obout Grid ?

    - by Anand
    By default when clicking the each column header it will automatically sorted. but I have placed a image in header column by clicking that image the column has to be sorted by priority level such as 0,1,2,.....the problem if i take datafield as priority the image disappears. I want use the datafield priority and sort according the image by priority. If anyone has suggestion please reply me asap.\ Thank you

    Read the article

  • Why do multiline cells in my CSV file appear with a question mark at the end of each line in Excel?

    - by Chris Lindsay
    I'm currently working on a project where we'd like to allow a user to export their data to CSV. Some of the data we present has multiple values for a single cell, and so we use the standard CSV method of putting each value on its own line: Column A, Column B, Column C Value A, "Value B1 Value B2", Value C Most of the time this works fine, but some people are reporting seeing a small question mark in a box character appear at the end of each line when they load the file in Excel. Why is this happening?

    Read the article

  • Field specific errors for ETL

    - by AaronLS
    I am creating a ETL process in MS SQL Server and I would like to have errors specific to a particular column of a particular row. For example, the data is initially loaded from excel files into a table(we'll call the Initial table) where all columns are varchar(2000) and then I stage the data to another table(the DataTypedTable) that contains more specific data types (datetime,int, etc.) or more tightly constrained varchar lengths. I need to be able to create error messages for a specific field such as: "Jan. 13th" is not a valid date format for the submission date. Please use a format of MM/DD/YYYY These error messages would need to be stored in some way such that later in the process a automated process can create reports with the error messages such that each message references a specific row and field(someone will need to go back and correct the data in the source system and resubmit the excel file). So ideally it would be inserted into a Failures tables of some sort and contain the primary key of the failed row, the column name, and the error message. Question: So I am wondering if this can be accomplished with SSIS, or some open source tool like Talend, and if so, what would be your general approach? Or what hand coded approach you would take? Couple approaches I've thought of using SQL(up until no I have done ETL by hand in SQL procs, but I want to consider other approaches. Possible C# even.): Use a cursor to read through the Initial table, and for each row insert a blank record with only the primary key into the DataTyped table, then use a single update statement for each column, such that if that update fails I can insert a very specific error message specific to that column in the error messages table. Insert all the data as is into the DataTyped table, but have duplicate columns like SubmissionDate and SubmissionDateOld. After the initial insert the *Old columns have data, the rest are blank, and I have a single update for each column that sets the SubmissionDate based on the SubmissionDateOld. In addition to suggesting an approach, I'd like to know if you are using that approach or something similar already in the work you do.

    Read the article

  • How to create a PeopleEditor ?

    - by Gaby
    Hi, I am building a windows application that upload documents to sharepoint document library and modify its column. My problem is that i'm uploading a file to document libary that has a people editor column. To solve my problem I want to pop up a windows form containing a people editor so users can pick the users or groups to fill in the column. How can i create a people editor like the one in sharepoint?

    Read the article

  • How to define index by several columns in hibernate entity?

    - by foobar
    Morning. I need to add indexing in hibernate entity. As I know it is possible to do using @Index annotation to specify index for separate column but I need an index for several fields of entity. I've googled and found jboss annotation @Table, that allows to do this (by specification). But (I don't know why) this functionality doesn't work. May be jboss version is lower than necessary, or maybe I don't understant how to use this annotation, but... complex index is not created. Why index may not be created? jboss version 4.2.3.GA Entity example: package somepackage; import org.hibernate.annotations.Index; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity @org.hibernate.annotations.Table(appliesTo = House.TABLE_NAME, indexes = { @Index(name = "IDX_XDN_DFN", columnNames = {House.XDN, House.DFN} ) } ) public class House { public final static String TABLE_NAME = "house"; public final static String XDN = "xdn"; public final static String DFN = "dfn"; @Id @GeneratedValue private long Id; @Column(name = XDN) private long xdn; @Column(name = DFN) private long dfn; @Column private String address; public long getId() { return Id; } public void setId(long id) { this.Id = id; } public long getXdn() { return xdn; } public void setXdn(long xdn) { this.xdn = xdn; } public long getDfn() { return dfn; } public void setDfn(long dfn) { this.dfn = dfn; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } } When jboss/hibernate tries to create table "house" it throws following exception: Reason: org.hibernate.AnnotationException: @org.hibernate.annotations.Table references an unknown table: house

    Read the article

  • t:commandSortHeader not being styled

    - by JBristow
    I've got the following JSF: <t:column styleClass="cb-status-column"> <f:facet name="header"> <t:commandSortHeader columnName="externalStatus" styleClass="cb-status-column"> Status </t:commandSortHeader> </f:facet> <h:outputText value="#{tx.externalStatus}" title="#{tx.externalStatus}"/> </t:column> Unfortunately, it renders like this: <th> <a href="#" onclick="return oamSubmitForm('transactionsTableForm','cb-activity-table:j_id131');" id="cb-activity-table:j_id131"> Status </a> </th> How do I get it to look like this: <th class="cb-status-column"> <a href="#" onclick="return oamSubmitForm('transactionsTableForm','cb-activity-table:j_id131');" id="cb-activity-table:j_id131"> Status </a> </th>

    Read the article

  • How do I Relate these 4 Tables

    - by Baddie
    Trying to setup a simple Thread/Poll table mapping. Here is what I have: Threads table ThreadID (Primary Key/Identity Column) Polls table PollID (Primary Key, FK for ThreadID for one-to-one relation) Question PollOptions table PollOptionID (Identity/Primary Key) Text PollID PollVotes table PollVoteID (Primary Key/Identity) PollOptionID I'm not sure if this is a proper relationship. It seems wrong but I'm not sure whats wrong with it. A Thread can have 0 or 1 Poll. A Poll can have 2 or more PollOptions. A PollOption can have 0 or many PollVotes. I'm going to be using Entity Framework and before I generate the code for it (VS 2010, .NET 4) I want to make sure I have the proper relationship mapping.

    Read the article

  • java.util.Map with HtmlDataTable

    - by gerry
    Hi, I'm developing an application on GlassFish v3 which uses Suns-RI of JavaEE6 and JSF2.0, etc. And the bad thing is, that no changes/switches away from Suns RI can be made (to use MyFaces or something like that). Now, the problem is, that I want to build HtmlDatatable by hand ( in Java code). The datatable should represent a java.util.Map where the first column should display the key and the second the values of the map. I've build successfully a PanelGrid from a java.util.List and used every time the "setExpressionValue" methods of UIComponent to bind the UI to the underlying List. But now, this doesn't work with the Map. Here is a snippet of my code: public HtmlDataTable getEntityDetailsDataTable() { ... Application app = FacesContext.getCurrentInstance().getApplication(); HtmlDataTable component = (HtmlDataTable)app.createComponent(HtmlDataTable.COMPONENT_TYPE); component.setValueExpression("value", ExpressionUtil.createValueExpression("#{entityTree.entity."+fieldName+".entrySet()}", Map.class)); component.setVar("param"); UIColumn column = new UIColumn(); UIOutput label1 = DynamicHtmlComponentCreator.createHtmlOutputText("#{param[key]}", String.class); column.getChildren().add(label1); UIOutput label2 = DynamicHtmlComponentCreator.createHtmlOutputText("#{param[value]}", String.class); column.getChildren().add(label2); component.getChildren().add(column); ... return component; } component.getChildren().add(column); ... return component; } So, further the problem is, that this code only prints out the content of the Map, on another page I need the values displayed in HtmlInputText elements and the whole map updated if the user clicks a i.e. "Save" button. So, further the problem is, that this code only prints out the content of the Map, on another page I need the values displayed in HtmlInputText elements and the whole map updated if the user clicks a i.e. "Save" button. If there is a workaround, to represent the Map as to Lists...please help me, because for this (map as 2 lists) I've no idea how the underlying map/database model can be updated again. Hopefully, someone can help me....

    Read the article

  • deadlock because of foreign key?

    - by George2
    Hello everyone, I am using SQL Server 2008 Enterprise. I met with deadlock in the following store procedure, but because of my fault, I did not record the deadlock graph. But now I can not reproduce deadlock issue. I want to have a postmortem to find the root cause of deadlock to avoid deadlock in the future. The deadlock happens on delete statement. For the delete statement, Param1 is a column of table FooTable, Param1 is a foreign key of another table (refers to another primary key clustered index column of the other table). There is no index on Param1 itself for table FooTable. FooTable has another column which is used as clustered primary key, but not Param1 column. Here is my guess why there is deadlock, and I want to let people review whether my analysis is correct? Since Param1 column has no index, there will be a table scan, and will acquire table level lock, because of foreign key, the delete operation will also need to check master table (e.g. to acquire lock on master table); Some operation on master table acquires master table lock, but want to acquire lock on FooTable; (1) and (2) cause cycle lock which makes deadlock happen. My analysis correct? Any reproduce scenario? create PROCEDURE [dbo].[FooProc] ( @Param1 int ,@Param2 int ,@Param3 int ) AS DELETE FooTable WHERE Param1 = @Param1 INSERT INTO FooTable ( Param1 ,Param2 ,Param3 ) VALUES ( @Param1 ,@Param2 ,@Param3 ) DECLARE @ID bigint SET @ID = ISNULL(@@Identity,-1) IF @ID > 0 BEGIN SELECT IdentityStr FROM FooTable WHERE ID = @ID END thanks in advance, George

    Read the article

  • dynamic html table

    - by coder247
    hello... I've to create a dynamic html table using the values configured in a table. I've a row number,column number and value fields in table. if the values are 1,5 and HELLO correspondingly, then i've to disply this HELLO in row 1 and column 5. The table structure is like the following. row column value 1 5 value1 2 8 value2 Any ideas pls...

    Read the article

  • Spaces while using "Print" in VBA

    - by Josh
    For some reason I am getting a lot of spaces in front of each value while trying to print to a flat text file. 'append headers Cells(start_row - 2, 1).Select For i = 1 To ActiveCell.SpecialCells(xlLastCell).Column If ActiveCell.Offset(0, 1).Column = ActiveCell.SpecialCells(xlLastCell).Column Then Print #finalCSV, Cells(start_row - 2, i) & "\n", Else Print #finalCSV, Cells(start_row - 2, i) & ",", End If Next i Example output: DC Capacity:hi, Resistive Capacity:lo, Resistive Capacity:hi, Reactive Capacity:lo, Is there any way to get rid of these spaces?

    Read the article

< Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >