How to encrypt column of some tables on oracle734/oracle817 ?

How to encrypt column of some tables on oracle734/oracle817 ?

Unless you are very good writing C ... upgrade to a version of the product supported during the current millennium.

Similar Messages

  • How to encrypt column of some table with the single method  on oracle7/814?

    How to encrypt column of some table with the single method on oracle7/814?

    How to encrypt column of some table with the single method on oracle7/814?

  • How to encrypt column of some table with the single method ?

    How to encrypt column of some table with the single method ?

    How to encrypt column of some table with the single
    method ?How to encrypt column of some table with the single
    method ?
    using dbms_crypto package
    Assumption: TE is a user in oracle 10g
    we have a table need encrypt a column, this column SYSDBA can not look at, it's credit card number.
    tha table is
    SQL> desc TE.temp_sales
    Name Null? Type
    CUST_CREDIT_ID NOT NULL NUMBER
    CARD_TYPE VARCHAR2(10)
    CARD_NUMBER NUMBER
    EXPIRY_DATE DATE
    CUST_ID NUMBER
    1. grant execute on dbms_crypto to te;
    2. Create a table with a encrypted columns
    SQL> CREATE TABLE te.customer_credit_info(
    2 cust_credit_id number
    3      CONSTRAINT pk_te_cust_cred PRIMARY KEY
    4      USING INDEX TABLESPACE indx
    5      enable validate,
    6 card_type varchar2(10)
    7      constraint te_cust_cred_type_chk check ( upper(card_type) in ('DINERS','AMEX','VISA','MC') ),
    8 card_number blob,
    9 expiry_date date,
    10 cust_id number
    11      constraint fk_te_cust_credit_to_cust references te.customer(cust_id) deferrable
    12 )
    13 storage (initial 50k next 50k pctincrease 0 minextents 1 maxextents 50)
    14 tablespace userdata_Lm;
    Table created.
    SQL> CREATE SEQUENCE te.customers_cred_info_id
    2 START WITH 1
    3 INCREMENT BY 1
    4 NOCACHE
    5 NOCYCLE;
    Sequence created.
    Note: Credit card number is blob data type. It will be encrypted.
    3. Loading data encrypt the credit card number
    truncate table TE.customer_credit_info;
    DECLARE
    input_string VARCHAR2(16) := '';
    raw_input RAW(128) := UTL_RAW.CAST_TO_RAW(CONVERT(input_string,'AL32UTF8','US7ASCII'));
    key_string VARCHAR2(8) := 'AsDf!2#4';
    raw_key RAW(128) := UTL_RAW.CAST_TO_RAW(CONVERT(key_string,'AL32UTF8','US7ASCII'));
    encrypted_raw RAW(2048);
    encrypted_string VARCHAR2(2048);
    BEGIN
    for cred_record in (select upper(CREDIT_CARD) as CREDIT_CARD,
    CREDIT_CARD_EXP_DATE,
    to_char(CREDIT_CARD_NUMBER) as CREDIT_CARD_NUMBER,
    CUST_ID
    from TE.temp_sales) loop
    dbms_output.put_line('type:' || cred_record.credit_card || 'exp_date:' || cred_record.CREDIT_CARD_EXP_DATE);
    dbms_output.put_line('number:' || cred_record.CREDIT_CARD_NUMBER);
    input_string := cred_record.CREDIT_CARD_NUMBER;
    raw_input := UTL_RAW.CAST_TO_RAW(CONVERT(input_string,'AL32UTF8','US7ASCII'));
    dbms_output.put_line('> Input String: ' || CONVERT(UTL_RAW.CAST_TO_VARCHAR2(raw_input),'US7ASCII','AL32UTF8'));
    encrypted_raw := dbms_crypto.Encrypt(
    src => raw_input,
    typ => DBMS_CRYPTO.DES_CBC_PKCS5,
    key => raw_key);
    encrypted_string := rawtohex(UTL_RAW.CAST_TO_RAW(encrypted_raw)) ;
    dbms_output.put_line('> Encrypted hex value : ' || encrypted_string );
    insert into TE.customer_credit_info values
    (TE.customers_cred_info_id.nextval,
    cred_record.credit_card,
    encrypted_raw,
    cred_record.CREDIT_CARD_EXP_DATE,
    cred_record.CUST_ID);
    end loop;
    commit;
    end;
    4. Check credit card number script
    DECLARE
    input_string VARCHAR2(16) := '';
    raw_input RAW(128) := UTL_RAW.CAST_TO_RAW(CONVERT(input_string,'AL32UTF8','US7ASCII'));
    key_string VARCHAR2(8) := 'AsDf!2#4';
    raw_key RAW(128) := UTL_RAW.CAST_TO_RAW(CONVERT(key_string,'AL32UTF8','US7ASCII'));
    encrypted_raw RAW(2048);
    encrypted_string VARCHAR2(2048);
    decrypted_raw RAW(2048);
    decrypted_string VARCHAR2(2048);
    cursor cursor_cust_cred is select CUST_CREDIT_ID, CARD_TYPE, CARD_NUMBER, EXPIRY_DATE, CUST_ID
    from TE.customer_credit_info order by CUST_CREDIT_ID;
    v_id customer_credit_info.CUST_CREDIT_ID%type;
    v_type customer_credit_info.CARD_TYPE%type;
    v_EXPIRY_DATE customer_credit_info.EXPIRY_DATE%type;
    v_CUST_ID customer_credit_info.CUST_ID%type;
    BEGIN
    dbms_output.put_line('ID Type Number Expiry_date cust_id');
    dbms_output.put_line('-----------------------------------------------------');
    open cursor_cust_cred;
    loop
         fetch cursor_cust_cred into v_id, v_type, encrypted_raw, v_expiry_date, v_cust_id;
    exit when cursor_cust_cred%notfound;
    decrypted_raw := dbms_crypto.Decrypt(
    src => encrypted_raw,
    typ => DBMS_CRYPTO.DES_CBC_PKCS5,
    key => raw_key);
    decrypted_string := CONVERT(UTL_RAW.CAST_TO_VARCHAR2(decrypted_raw),'US7ASCII','AL32UTF8');
    dbms_output.put_line(V_ID ||' ' ||
    V_TYPE ||' ' ||
    decrypted_string || ' ' ||
    v_EXPIRY_DATE || ' ' ||
    v_CUST_ID);
    end loop;
    close cursor_cust_cred;
    commit;
    end;
    /

  • How to make column headers in table in PDF report appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp

    Hi my name is vishal
    For past 10 days i have been breaking my head on how to make column headers in table appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp.
    Given below is my code in c# on how i export datas from different tables in sql server to PDF report using iTextSharp:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.Diagnostics;
    using System.IO;
    namespace DRRS_CSharp
    public partial class frmPDF : Form
    public frmPDF()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(6);
    table.TotalWidth =530f;
    table.LockedWidth = true;
    PdfPCell cell = new PdfPCell(new Phrase("Institute/Hospital:AIIMS,NEW DELHI", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK)));
    cell.Colspan = 6;
    cell.HorizontalAlignment = 0;
    table.AddCell(cell);
    Paragraph para=new Paragraph("DCS Clinical Record-Assigned Dialyzer",FontFactory.GetFont("Arial",16,iTextSharp.text.Font.BOLD,BaseColor.BLACK));
    para.Alignment = Element.ALIGN_CENTER;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(105f, 105f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select d.dialyserID,r.errorCode,r.dialysis_date,pn.patient_first_name,pn.patient_last_name,d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.Technician_first_name,t.Technician_last_name from dialyser d,patient_name pn,reprocessor r,Techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=0 and d.closed_status=0 and pn.status=1 and r.errorCode<106 and r.reprocessor_id in (Select max(reprocessor_id) from reprocessor where dialyzer_id=d.dialyserID) order by pn.patient_first_name,pn.patient_last_name", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("Reprocessing Date");
    table.AddCell("Patient Name");
    table.AddCell("Dialyzer(Manufacturer,Size)");
    table.AddCell("No.of Reuse");
    table.AddCell("Verification");
    table.AddCell("DialyzerID");
    while (dr.Read())
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString() +"_"+ dr[4].ToString());
    table.AddCell(dr[5].ToString() + "-" + dr[6].ToString());
    table.AddCell("@count".ToString());
    table.AddCell(dr[12].ToString() + "-" + dr[13].ToString());
    table.AddCell(dr[0].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    System.Diagnostics.Process.Start("AssignedDialyzer.pdf");
    if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.Yes)
    var writer2 = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    else if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.No)
    this.Close();
    The above code executes well with no problem at all!
    As you can see the file to which i create and save and open my pdf report is
    AssignedDialyzer.pdf.
    The column headers of table in pdf report from c# windows forms using iTextSharp are
    "Reprocessing Date","Patient Name","Dialyzer(Manufacturer,Size)","No.of Reuse","Verification" and
    "DialyzerID".
    However the problem i am facing is after execution and opening of document is my
    column headers in table in pdf report from
    c# and datas in it all appear in bold.
    I have browsed through net regarding to solve this problem but with no success.
    What i want is my pdf report from c# should be similar to following format which i was able to accomplish in vb6,adodb with MS access using iTextSharp.:
    Given below is report which i have achieved from vb6,adodb with MS access using iTextSharp
    I know that there has to be another way to solve my problem.I have browsed many articles in net regarding exporting sql datas to above format but with no success!
    Is there is any another way to solve to my problem on exporting sql datas from c# windows forms using iTextSharp to above format given in the picture/image above?!
    If so Then Can anyone tell me what modifications must i do in my c# code given above so that my pdf report from c# windows forms using iTextSharp will look similar to image/picture(pdf report) which i was able to accomplish from
    vb6,adodb with ms access using iTextSharp?
    I have approached Sound Forge.Net for help but with no success.
    I hope anyone/someone truly understands what i am trying to ask!
    I know i have to do lot of modifications in my c# code to achieve this level of perfection but i dont know how to do it.
    Can anyone help me please! Any help/guidance in solving this problem would be greatly appreciated.
    I hope i get a reply in terms of solving this problem.
    vishal

    Hi,
    About iTextSharp component issue , I think this case is off-topic in here.
    I suggest you consulting to compenent provider.
    http://sourceforge.net/projects/itextsharp/
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to rename column name of table?

    Hello...
    How to rename column name of table?
    The column have data.
    Thanks.
    Martonio.

    The following should work in 9i release 2 and above.
    SQL> create table mytable(col1 varchar2(2),
      2  col2 date);
    Table created.
    SQL> insert into mytable values('t1',sysdate);
    1 row created.
    SQL> select * from mytable;
    CO COL2
    t1 30-NOV-04
    1 row selected.
    SQL> desc mytable
    Name                                      Null?    Type
    COL1                                               VARCHAR2(2)
    COL2                                               DATE
    SQL> alter table mytable rename column col2 to mydate;
    Table altered.
    SQL> desc mytable
    Name                                      Null?    Type
    COL1                                               VARCHAR2(2)
    MYDATE                                             DATE
    SQL> select * from mytable;
    CO MYDATE
    t1 30-NOV-04
    1 row selected.
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.2.0.3.0 - Productionhttp://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/wnsql.htm#972698

  • How to select columns in a table by their column id and not the column name

    Hello,
    How do you select columns from a table based on their column_id.
    I have create a view
    but other than Select * , i cant now select one just one column from it
    the view as follow:
    create view count_student as
    select a.acode "acode",aname "Activity Name",count(ae.acode) "Number of student joined"
    from aenrol ae, activity a
    where a.acode= ae.acode
    group by a.acode,aname;

    The issue is that you have decided to use quoted column names. A pretty horrible idea (mostly for the reasons that you are now finding).
    Re-create the view and get rid of the silly double quotes.

  • How to make columns in a table dynamic

    Hi,
    I want to make the columns of a table dynamic.
    At design time I dont know how many columns will be required.
    Rows are made dynamic by using the bean concept.
    Please help me in this reference(columns).
    Thanks
    Pooja

    Hi, i don't know how you create the rows dynamically but
    have you tried to use a forEach?
    <af:table ...>
    <af:forEach items="..." var="...">
    <af:column headerText="...">
    <af:outputText value="..."/>
    </af:column>
    </af:forEach>
    </af:table>
    here there is an example of a dynamic panelList:
    <af:panelList rows="3" maxColumns="6">
    <af:forEach items="#{bindings.ContratosView1.rangeSet}" var="li">
    <af:commandLink text="#{li.Codigo}" action="Edit"/>
    </af:forEach>
    </af:panelList>

  • How to: Count columns in a table?

    Quite simple question actually. How do I count the number of columns in a table using SQL?

    For AdventureWorks2012 tables & views:
    SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COUNT(COLUMN_NAME ) ColCount
    FROM INFORMATION_SCHEMA.COLUMNS
    GROUP BY TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
    ORDER BY TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
    TABLE_SCHEMA TABLE_NAME ColCount
    dbo AWBuildVersion 4
    dbo DatabaseLog 8
    dbo ErrorLog 9
    HumanResources Department 4
    HumanResources Employee 16
    HumanResources EmployeeDepartmentHistory 6
    HumanResources EmployeePayHistory 5
    HumanResources JobCandidate 4
    HumanResources Shift 5
    HumanResources vEmployee 18
    HumanResources vEmployeeDepartment 10
    HumanResources vEmployeeDepartmentHistory 11
    HumanResources vJobCandidate 16
    HumanResources vJobCandidateEducation 13
    HumanResources vJobCandidateEmployment 11
    Person Address 9
    Person AddressType 4
    Person BusinessEntity 3
    Person BusinessEntityAddress 5
    Person BusinessEntityContact 5
    Person ContactType 3
    Person CountryRegion 3
    Person EmailAddress 5
    Person Password 5
    Person Person 13
    Person PersonPhone 4
    Person PhoneNumberType 3
    Person StateProvince 8
    Person vAdditionalContactInfo 17
    Person vStateProvinceCountryRegion 7
    Production BillOfMaterials 9
    Production Culture 3
    Production Document 14
    Production Illustration 3
    Production Location 5
    Production Product 25
    Production ProductCategory 4
    Production ProductCostHistory 5
    Production ProductDescription 4
    Production ProductDocument 3
    Production ProductInventory 7
    Production ProductListPriceHistory 5
    Production ProductModel 6
    Production ProductModelIllustration 3
    Production ProductModelProductDescriptionCulture 4
    Production ProductPhoto 6
    Production ProductProductPhoto 4
    Production ProductReview 8
    Production ProductSubcategory 5
    Production ScrapReason 3
    Production TransactionHistory 9
    Production TransactionHistoryArchive 9
    Production UnitMeasure 3
    Production vProductAndDescription 5
    Production vProductModelCatalogDescription 25
    Production vProductModelInstructions 11
    Production WorkOrder 10
    Production WorkOrderRouting 12
    Purchasing ProductVendor 11
    Purchasing PurchaseOrderDetail 11
    Purchasing PurchaseOrderHeader 13
    Purchasing ShipMethod 6
    Purchasing Vendor 8
    Purchasing vVendorWithAddresses 9
    Purchasing vVendorWithContacts 12
    Sales CountryRegionCurrency 3
    Sales CreditCard 6
    Sales Currency 3
    Sales CurrencyRate 7
    Sales Customer 7
    Sales PersonCreditCard 3
    Sales SalesOrderDetail 11
    Sales SalesOrderHeader 26
    Sales SalesOrderHeaderSalesReason 3
    Sales SalesPerson 9
    Sales SalesPersonQuotaHistory 5
    Sales SalesReason 4
    Sales SalesTaxRate 7
    Sales SalesTerritory 10
    Sales SalesTerritoryHistory 6
    Sales ShoppingCartItem 6
    Sales SpecialOffer 11
    Kalman Toth Database & OLAP Architect
    sqlusa.com
    Paperback / Kindle: Pass SQL Exam 70-461 & Job Interview: Programming SQL Server 2012

  • How to find columns in a table ?

    Hi
    I want a sql query to find a columns in specfic table
    all i hav in hand is the name of the table and a value which i know is in the columns but dont know which column
    for example i know there is table named student with 15 columns and a value of a column is 'ABC' but i dont have the name of the column
    how to find the table using SQL query
    Thanks in Advance
    Bala

    SELECT column_name,
      table_name
       FROM user_tab_cols
      WHERE table_name IN ('<yourtablenamehere>')
    AND extractvalue(dbms_xmlgen.getxmltype('select ''Found'' col from '|| table_name ||' where rownum=1 and ' || CASE WHEN data_type IN
          ( SELECT DISTINCT data_type FROM user_tab_cols WHERE data_type NOT LIKE 'TIME%' AND data_type != 'DATE' )
        THEN column_name ELSE 'to_char('||column_name||',''DD-MM-YYYY HH24:MI:ss'')'  END
      ||' = ''<yourcolumnvaluetobefound>'' '),'//COL')='Found';Fill <yourtablenamehere> and <yourcolumnvaluetobefound> in the above query and get the result.
    Ravi Kumar

  • How to get column names in table maintenance dialog?

    I created a new Z table and created a maintanance dialog so that I can maintain the table through sm30. i don't see columns names on maintenance screen, just a "+" sign for each column! Could someone please tell me how to display column name?
    Thanks.
    Mithun

    Hello Mithun
    The column texts are taken from the field descriptions of the data elements used in your z-table. A "+" sign usually indicates that none of the field descriptions of the data element has been maintained.
    Regards
      Uwe

  • How to add column to compressed table

    Hi gurus,
    Can any one help me how to add a column to compressed tables
    Thanks in advance

    The only difference is if added column has default value. In that case:
    SQL> create table tbl(id number,val varchar2(10))
      2  /
    Table created.
    SQL> insert into tbl
      2  select level,lpad('X',10,'X')
      3  from dual
      4  connect by level <= 100000
      5  /
    100000 rows created.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       3145728
    SQL> alter table tbl move compress
      2  /
    Table altered.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       2097152
    SQL> alter table tbl add name varchar2(5) default 'NONE'
      2  /
    alter table tbl add name varchar2(5) default 'NONE'
    ERROR at line 1:
    ORA-39726: unsupported add/drop column operation on compressed tables
    SQL> alter table tbl add name varchar2(5)
      2  /
    Table altered.
    SQL> update tbl set name = 'NONE'
      2  /
    100000 rows updated.
    SQL> commit
      2  /
    Commit complete.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       7340032
    SQL> select compression from user_tables where table_name = 'TBL'
      2  /
    COMPRESS
    ENABLED
    SQL> alter table tbl move compress
      2  /
    Table altered.
    SQL> select bytes
      2  from user_segments
      3  where segment_name = 'TBL'
      4  /
         BYTES
       2097152
    SQL> SY.

  • How i add Columns to my table ?

    Guys, im not being able to add my columns to the table, can anyone help me ?
    Thanks!
    TableView<String> tv = new TableView<>();
      tv.setVisible(true);
           TableColumn firstNameCol = new TableColumn();
           TableColumn lastNameCol = new TableColumn();
           TableColumn emailCol = new TableColumn();
           tv.getColumns().add(0,firstNameCol);

    Woah! Thanks man! it works greatly but.... Theres just 1 more issue!! i read all the javaDoc and asked help to a friend but we were unable to find a solution, also, im using the "Introduction to javaFX 2 book".
    Im sorry to keep troubling you guys, but it seems javaFX isnt taking off here, and i sometimes think im one of the first in Brasil to starting learning it.
    They teach java in my College, but i think javaFX is a way better "swing/interface" than the one in java. Anyway , the problem im having is : I need get the data from a db , no problem with that, but how can i insert that data? I tried several solutions but none worked.
    Can you help me one more time :D ? Please!!
    thanks a lot guys
    Anyway, heres what the classes are :
    Main Class :
    package voosparaweb;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    * @author André Vinícius Lopes
    public class Voos {
        public static void main(String args[])
         VoosParaWeb v1 = new VoosParaWeb();
         v1.main(args);
         //The Code Below doesnt  work
         v1.testingDataSetTable("1","13:00","Roma");
    }voosParaWeb Class
    package voosparaweb;
    import javafx.application.Application;
    import javafx.collections.ObservableList;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.GridPane;
    import javafx.stage.Stage;
    * @author André
    public class VoosParaWeb extends Application {
      public TableView<Data> t1 = new TableView<Data>();
      public static void main(String[] args) {
        launch(args);
      @Override
      public void start(Stage primaryStage) {
        Group root = new Group();
        GridPane gp = new GridPane();
        root.getChildren().add(gp);
        Scene scene = new Scene(root, 640, 480);
        t1 = tvset();
        setDataTable();
        t1.setVisible(true);
        gp.add(t1, 1, 1);
         //The Code Below work
        // v1.testingDataSetTable("1","13:00","Roma");
        primaryStage.setTitle("Terminals Panel");
        primaryStage.setScene(scene);
        primaryStage.show();
      public TableView<Data> tvset()
        String Person;
        ObservableList<VoosParaWeb> data;
        TableView<Data> tv = new TableView<Data>();
        tv.setVisible(true);
        TableColumn<Data, String> idTc = new TableColumn<Data, String>("ID#");
        idTc.setCellValueFactory(new PropertyValueFactory("id"));
        TableColumn<Data, String> timeTc = new TableColumn<Data, String>("Time");
        timeTc.setCellValueFactory(new PropertyValueFactory("time"));
        TableColumn<Data, String> destinyTc = new TableColumn<Data, String>("Destiny");
        destinyTc.setCellValueFactory(new PropertyValueFactory("destiny"));
        TableColumn flightTc = new TableColumn("Flight");
        TableColumn counterTc = new TableColumn("Counter");
        TableColumn boardingTc = new TableColumn("Boarding");
        TableColumn gateTc = new TableColumn("Gate");
        TableColumn statusTc = new TableColumn("Status");
        tv.getColumns().add(idTc);
        tv.getColumns().add(timeTc);
        tv.getColumns().add(destinyTc);
        tv.getColumns().add(flightTc);
        tv.getColumns().add(counterTc);
        tv.getColumns().add(boardingTc);
        tv.getColumns().add(gateTc);
        tv.getColumns().add(statusTc);
        return tv;
      public void setDataTable()
        t1.getItems().add(new Data("1", "1:15", "Amsterdam"));
      public void testingDataSetTable(String i,String time,String dest)
        t1.getItems().add(new Data(i,time,dest));
        t1.setVisible(true);
      public static class Data {
        private String id;
        private String time;
        private String destiny;
        public Data()
        public Data(String id, String time, String destiny) {
          this.id = id;
          this.time = time;
          this.destiny = destiny;
        public String getId() {
          return id;
        public String getTime() {
          return time;
        public String getDestiny() {
          return destiny;
    }

  • How to set column widths in tables for selected table only, not globally throughout document?

    I've been utilizing the below script (thank you so much Ramkumar. P!) to set column widths throughout a sizable InDesign book with tables on every page and it is truly a time saver. At this point in time, I have three versions of it because there are different column widths throughout the book. Is it possible to augment the script to run only on a selected text frame (containing a table)? If so, would someone be kind enough to share the augmented script with me? I've been trying to figure out this seemingly simple change through trial and error with no success as yet. I realize this is a totally newbie request and I'm entirely at the mercy of the kindness of the Javascript gods that contribute within this forum. Seeing that in a different post related to this script, one such guru responded to a request as simple as "Where do I put the scripts in InDesign" gave me enough courage to ask for some help! Thank you in advance to anyone willing to provide a solution.
      var myDoc = app.activeDocument;
         var myWidths = [100, 100, 150, 150];
         for(var T=0; T < myDoc.textFrames.length; T++){
             for(var i=0; i < myDoc.textFrames[T].tables.length; i++){
                 for(var j=0; j < myWidths.length; j++){
                     myDoc.textFrames[T].tables[i].columns[j].width = myWidths[j];
         alert("Table width updated successfully...");

    Hello all
    I have the same problem in that I'm not a scripting person, but was able to get the above script working without problem, and it does set irregular table column widths perfectly, so thanks to Ramkumar. P for that.
    BUT, it changes the column width for ALL tables in the document, whereas I would like to just target the selected table.
    Any ideas as to how I might amend this script to achieve this?
    Thx, Christian

  • How to set column attributes in table control?

    I have the following requirement to build a table by using table control:
    if content of col 1 = 'Y', enable input for col 2 for that line only.
    if content of col 1 = 'N', disable input for col 2 for that line only.
    So the input attribute for col 2 in each line can be different.
    How can I achieve this?
    I have tried using loop at screen or loop at tablecontrol-cols into wa_cols statements,
    but these will change the entire column attributes to either on or off, and not on individual line.
    Instead of changing the COLUMN attributes, I think I should change the CELL attributes. 
    What is the syntax for that, is there something like tablecontrol-field?
    Thanks for any help in advance.

    I still not able to get the field attributes set on individual lines.
    These are my codes, can you help again.
    PROCESS BEFORE OUTPUT.
      MODULE pbo_0200.
      MODULE zitem_change_tc_attr.
      LOOP AT   lt_asset_item
           INTO ls_asset_item
           WITH CONTROL zitem
           CURSOR zitem-current_line.
        MODULE ZITEM_CHANGE_FIELD_ATTR.
        MODULE zitem_get_lines.
      ENDLOOP.
    MODULE zitem_change_field_attr OUTPUT.
    loop at screen.
      if ls_asset_item-replace_asset = 'X'.
         if screen-group1 EQ 'FR4'.        "these are the columns I want to turn input ON or OFF.
          screen-input = '1'.
          modify screen.
         endif.
      endif.
    endloop.
    Endmodule.
    At debug mode, the screen-input did change to '1'.  Can I check the return code of the MODIFY SCREEN statement?
    I tried to initialize the colums to be output only at screen definition, but it still doesn't help.
    I don't think I have to do anything at the PAI event.
    PROCESS AFTER INPUT.
    MODULE save_cursor_position.
      LOOP AT lt_asset_item.
       FIELD ls_asset_item-replace_asset
         MODULE get_replace_asset ON REQUEST.
        CHAIN.
         FIELD LS_ASSET_ITEM-REPLACE_ASSET.
         FIELD ls_asset_item-replace_cost.
          MODULE zitem_modify ON CHAIN-REQUEST.
        ENDCHAIN.
        FIELD ls_asset_item-mark
          MODULE zitem_mark ON REQUEST.
      ENDLOOP.
      MODULE zitem_user_command.
    Thanks again.

  • How to control column width in table?

    I have a table with four columns, and they are all with same width.
    But I want to make one of them wider.
    How should I do?
    public void loadTable(){
    Vector infoList = myObj.getInfoList();
    Info info;
    DefaultTableModel dtm = (DefaultTableModel)myPanel.tblList.getModel();
    String[] columnNames = {
    "wider column",
    "Column B",
    "Column C",
    "Column D"};
    dtm.setColumnIdentifiers(columnNames);
    for(int i=0;i< infoList.size();i++){
    // add stuff to "data"
    dtm.addRow(data);
    myPanel.tblList.setModel(dtm);
    myPanel.tblList.getColumnModel().getColumn(1).setWidth(100);
    I also tried setPreferedWidth(), not working for me either.
    What should I do?
    Thank you

    Try setting all the column widths. Define values for normal and width columns:
            DefaultTableColumnModel tcModel = (DefaultTableColumnModel) myTable.getColumnModel();
            Enumeration columnEnum = tcModel.getColumns();
            while (columnEnum.hasMoreElements()) {
                TableColumn column = (TableColumn) columnEnum.nextElement();
                if (column.getModelIndex()  != 1) {
                    column.setPreferredWidth(narrowWidth);
                } else {
                    column.setPreferredWidth(wideWidth);
    Cheers
    DB

Maybe you are looking for