Masking columns in a table

Hello,
I have requirement to mask some of the columns in the databaes table. Lets say table test1 has 5 columns and i need to mask 1 column so that the user will not be able to see it. how can i do this?
If i mask this columns, i should be able to unmask also later.

I assume that by "mask" you mean "obscure or occlude data by replacing it with a meaningless placeholder." I had a similar requirement where only certain roles where able to see an entire credit card number in the database. All others, regardless of means of connection (isql, web, application, etc) were limted to seeing the last four digits. The year/month of the expiration date was also limited to year. This was very strictly controlled.
The way to accomplish this was to provide a view on the table where the card_number and card_expiry were masked and only grant select on the view, not the underlying table. DBAs would obviously be able to see the entire columns' data, but that was an acceptable risk since they had access to all the other data anyway, implying trust at a much greater level than a handful of columns.
A hypothetical example might be (you can cut-n-paste all of the below to isql or equiv, although you might have to clean up line-breaks a little):
--get rid of the table, in case you've made changes:
drop table t_cust purge;
--create "customer" table:
CREATE TABLE T_CUST(
CUST_ID NUMBER NOT NULL,
CUST_NAME VARCHAR2(200) NOT NULL,
CARD_NBR VARCHAR2(15) NOT NULL,
CARD_EXPIRY DATE NOT NULL,
CONSTRAINT PK_CUST PRIMARY KEY(CUST_ID)
*yeah, I know you wouldn't put card info in the same table as customer, but this is an
--example not a 3NF logical data model, dangit.
--make sure nobody but owners and ubers can select from the base table:
REVOKE SELECT ON T_CUST FROM PUBLIC;
--create the "masked" view:
CREATE OR REPLACE VIEW V_CUST_SECURE AS
SELECT CUST_ID, CUST_NAME,
'###########'||SUBSTR(CARD_NBR,12,4) as CARD_NBR,
'##/'||to_char(CARD_EXPIRY,'YY') as CARD_EXPIRY
FROM T_CUST;
--let everyone see the masked version:
GRANT SELECT ON V_CUST_SECURE TO PUBLIC;
--insert some rows:
INSERT INTO T_CUST values(1,'John Doe','123456789011111',to_date('1/1/2008','MM/DD/YYYY'));
INSERT INTO T_CUST values(2,'John Doe','123456789012222',to_date('2/1/2008','MM/DD/YYYY'));
INSERT INTO T_CUST values(3,'John Doe','123456789013333',to_date('3/1/2008','MM/DD/YYYY'));
INSERT INTO T_CUST values(4,'John Doe','123456789014444',to_date('4/1/2008','MM/DD/YYYY'));
INSERT INTO T_CUST values(5,'John Doe','123456789015555',to_date('5/1/2008','MM/DD/YYYY'));
--see the un-masked version:
select * from T_CUST;
--see the masked version:
select * from V_CUST_SECURE;

Similar Messages

  • VPD column-masking: unexpected results using masked column in WHERE?

    Hi everyone..
    We are considering implementing VPD column-masking (to hide sensitive columns from unauthorized users), but I am concerned that queries will return incorrect results if an unauthorized user submits a query using a masked column in a WHERE clause - particularly in a JOIN operation.
    Our initial experiment confirms my concern:
    - We have a VPD policy on TABLE_X.COLUMN_Y:
    DBMS_RLS.ADD_POLICY(
    object_schema => 'xxxx',
    object_name => 'TABLE_X',
    policy_name => 'policy_x',
    function_schema => 'xxxx',
    policy_function => 'function_x',
    sec_relevant_cols =>'COLUMN_Y',
    sec_relevant_cols_opt => dbms_rls.ALL_ROWS)
    - The VPD function determines whether the user is authorized (1=1) or not (1=0)
    - COLUMN_Y contains various values, including NULL
    - when an "authorized" user submits the query "SELECT COUNT(*) FROM TABLE_X WHERE COLUMN_Y IS NULL", COUNT=correct number of rows containing NULL
    - when an "unauthorized" user submits the same query, COUNT=the total number of rows in the table -- presumably because the WHERE clause was modified to WHERE NULL=NULL
    In my opinion, the unauthorized user's query should return an error, because any other result is either wrong (i.e. COUNT=all rows, or returns a null result set) or something the user is not permitted to know (i.e. COUNT=correct number of rows)
    Am I missing some feature/setting of VPD that could let me force an error? I hope there is something out there, since I don't see any discussion or warnings about this pitfall.
    We are currently using Oracle 10.2.0.4 but upgrading to 11.1 soon.
    Thanks!
    Betty
    p.s. I originally incorrectly posted this question on the Technologies / Security forum.

    Thanks - yes, we have a function that checks whether the user id is authorized or not.
    The column-masking works, that is, authorized users can see the data; unauthorized users cannot. The issue is what happens when unauthorized users use the masked column in a WHERE predicate.

  • 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.

  • Dynamically Hiding Column in a Table View in VC Model

    How to dynamacally hide the columns in a table view in a VC model. Through the expression in Control Property, Form element/field or table view as a whole can be made hidden, however, the individual column can not seem to be hidden.
    I am using VC server version 700.8.0.1.
    Any help would be much appreciated.
    Kind Regards
    Sanjoy

    In this scenario, if the source is SAP BI, you can use the webapi commands. If not, you would have to have 2 separate tables in different layers and you can show and hide those layers or UI elements...

  • Unable to see a column of a table in portal for a particular User

    Hi,
    A particular user is unable to see a particular column of a table in the portal . The application is developed in Webdynpro ABAP. The table contains two columns. Both the columns contain text type fields. What appears to the user is that the left column has disappeared and the right hand column has shifted to the left.
    This is occuring for a particular user only. We have checked in our development and quality systems but we are unable to replicate the issue. Please help.
    Thanks and regards,
    Satya.

    Hi Vikas.
    You can use BAPI in LSMW to craete Material or You can use direct input method. Both methods as follows below:
    Using BAPI in LSMW:
    First maintain IDOC Inbound Processing steps by giving PORT and Partner Type and Partner Numberby clicking 'settings' icon in menu path in LSMW Screen.
    Adn then execute LSMW and maintain the values as below in the first step.
    BusinessObject Method(BAPI)
    Business Object       BUS1001006                      Standard material
    Method                     SAVEDATA                        Create and change materia
    Message Type         MATMAS_BAPI                   Create and change materia
    Basic Type               MATMAS_BAPI03               Create and Change Materia.
    For the selecting of views, you can maintain fields for all views(From Basic view to costing view) in your excel and populate with 'X' in respective fields for activating views.
    In the 6th step (Maintain field mapping and conversion rules). you can map those fields for views which you want to activate since we have all views are in the standard structure.
    Using Direct Input Method:
    Standard Batch/Direct Input
    Object                      0020                                             Material master
    Method                     0000
    Program Name          RMDATIND
    Program Type           D                                                  Direct Input
    For the selecting of views, you can maintain fields for all views(From Basic view to costing view) in your excel and populate with 'X' in respective fields for activating views.
    In the 6th step (Maintain field mapping and conversion rules). you can map those fields for views which you want to activate since we have all views are in the standard structure.

  • Specific Model not showing rows in a table in a column of a table

    Hello,
    Fairly simple issue here (I think):
    I have a table bound to a global model and its rows bound to "/items"
    I then have a column within that table which has a valuehelpfield that pops open a dialog with a table.
    This tables rows inside the dialog are bound to a temp model. Now I know this temp model has the correct data and format and I do not get a "no data" messages when I bind it's rows to the node on the temp model, and to double check that I tried binding it to an incorrect node and it did say "no data" and I tripple checked by getting the jsonstring of the model and it's exactly how it should be.
    Here is the code:
    oTable.addColumn(new sap.ui.table.Column({
                label: new sap.ui.commons.Label({
                    text: "Shop",
                    required: true
                width: "200px",
                template:  new sap.ui.commons.ValueHelpField({       
                value:"{shopdesc}",
                 valueHelpRequest: function(oEvent){   
                 var locModel = oTable.getModel();
                 var rowContextPath = oEvent.getSource().getBindingContext().getPath();
                 var oRowObj = oEvent.getSource().getBindingContext().getObject();
              var oDataOld = sap.ui.getCore().getModel().getData();
             var tempModel = new myJSONModel;
          tempModel.setData({
          shops: []
      sap.ui.getCore().setModel(tempModel, "tempModel");
             tempModel = sap.ui.getCore().getModel('tempModel');
                d = tempModel.getData();
                arr = d.shops;
              var shops = oDataOld.shops;
                 for (var i = 0; i < shops.length; i++) {
                     if (shops[i].area == oRowObj.area) {
                             arr.push(shops[i]);
                 var oValueHelpDialog = new sap.ui.commons.Dialog(
                            { modal: true,
                                title: "Select a Shop",
                                closed: function (oEvent) {
                                var oContext = oTableJobs.getContextByIndex(oTableJobs.getSelectedIndex());
                                if (oContext) {
                               var oSel = oContext.getModel().getProperty(oContext.getPath());
                             locModel.setProperty(rowContextPath + "/shop", oSel["shop"]);  
                             locModel.setProperty(rowContextPath + "/shopdesc", oSel["shopdesc"]); 
                 var oTableJobs = new sap.ui.table.Table({
                     visibleRowCount: 15,
                     firstVisibleRow: 1,
                     selectionMode: sap.ui.table.SelectionMode.Single,
                     width : "300px"
                 var oOkButton = new sap.ui.commons.Button({
                     text: "OK",
                     press: function (oEvent) {
                       oEvent.getSource().getParent().close();
                 oTableJobs.addColumn(new sap.ui.table.Column({
                     label: new sap.ui.commons.Label({text: "shop"}),
                     template: new sap.ui.commons.TextField().bindProperty("value", "shop"),
                     editable:false,
                     width: "100px"
                 oTableJobs.addColumn(new sap.ui.table.Column({
                     label: new sap.ui.commons.Label({text: "Shop Description"}),
                     template: new sap.ui.commons.TextField().bindProperty("value", "shopdesc"),
                     editable:false,
                     width: "300px"
                 var jsonString = tempModel.getJSON();
                 alert(jsonString);
                     oTableJobs.bindRows("tempModel>/shops");                                       
                     oValueHelpDialog.addButton(oOkButton);
                     oValueHelpDialog.addContent(oTableJobs);
                     oValueHelpDialog.open();               
            var oModel = sap.ui.getCore().getModel();
            oTable.setModel(oModel);
            oTable.bindRows("/items");
    Any help would be appreciated, I can't see what's wrong here, all seems fine to me! Thanks!

    HI Bob
    I briefly scan thru your code and spotted one common issue. When we are binding property, we need to include the model name. e.g.
    template: new sap.ui.commons.TextField().bindProperty("value", "shop"),
    should be
    template: new sap.ui.commons.TextField().bindProperty("value", "tempModel>shop"),
    -D

  • Creating a radio button group in a column of a table in Web Dynpro

    Hi,
    I want to put a radio button group in a column of a table in Webdynpro. I added a column to a web dynpro view and then inserted a tableCellEditor for that column.. But I cannot define it as Radio Button group. I want the user to be able to select 3 statuses using this group.
    Does anyone have a solution for this??
    Thanks in advance...
    Nakul

    Hi,
    You wont be able create three RB in one cell.
    Create as many column as the no of options is.Here it is 3.
    Create 4 attributes inside the node , option 1,option 2,option 3 and selectedoption.
    Map each RB s keytoSelect to option 1,2,3. Map all the RBs selectedKey atribute to selectedoption.
    Now selection for each row will be stored in the selected option.
    Regards
    Bharathwaj

  • BSP: How to create check box in a column of a Table View

    Hi All,
    I have a table view in Web IC scenario. my requirement is to display check box in one of the column of the table view.. so that i can select multiple lines from the table and do some calculations!.
    Anybody have any hint/clue
    Thanks in advance,
    sudeep v d.

    Hi,
    This can be achieved by using a Table iterator.
    Please check the standard examples for this.
    Thanks,
    Rashmi.

  • How to show current date in a column of dimension table in ssas

    Hi,
    I have 2 dimension tables (ALLWORK and YOURWORK) and 1 measure table (STATS). In ALLWORK dim table, I have 4 columns, one of them is END_DATE. Based on END_DATE and current date I want to create a named calculation field. To achieve this, I
    want to show the current date in 5th column (of ALLWORK dim table) as calculated member (as named calculation wont show me correct date).
    Problem is, I am not able to create the column in the dimension table. While creating the calculated member, I am not able to select the ALLWORK dimension table, it always selects MEASURE by default. Please help.
    thanks
    Tarique
    thanks and regards Tarique Aslam

    Hi Tarique,
    According to your description, you want to add a column to your dimension to show the current date, right?
    In data source view, we can add named calculation to your table. A named calculation is a SQL expression represented as a calculated column. This expression appears and behaves as a column in the table. A named calculation lets you extend the relational
    schema of existing tables or views in a data source view without modifying the tables or views in the underlying data source.
    Reference
    http://msdn.microsoft.com/en-in/library/ms174859.aspx
    http://devmau5.wordpress.com/2010/03/25/the-getdate-of-mdx/
    If I have anything misunderstand, please point it out.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to Insert Image in a Column of a table

    Hi
    I have read several documentations but still could not find any relevant one that can help me in inserting a image in a BLOB column of a table.I have read about DBMS_LOB but still not clear how to insert an image in the table.
    I followed following steps :
    create table Emp_Identity(Id Number,Photo BLOB);
    Insert Into Emp_Identity(1,'d:\vishal.bmp');
    Please tell me steps to be followed.
    Regards
    Vishal Chaudhry
    null

    I am using Developer 2000 Forms 6i as Front End (Oracle 8.1.6)
    My table structure is:
    SQL> desc test_lob
    Name Data Type
    ID NUMBER
    NAME VARCHAR2(100)
    PHOTO BLOB
    SOUND BINARY FILE LOB
    IS there any way to display the BFILE contents on the frontend.....?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by vishal chaudhry ([email protected]):
    Hi,
    I could actually insert an image in a BLOB type column from the backend(Sql plus) not directly but by using BFILE and see that image on the frontend (Forms 6i Developer 2000,Item type is Image as there is nothing like BLOB/BFILE in front end) using the following procedure :
    IS there any way I can insert an image directly in a BLOB column from the backend rather than using BFILE?
    CREATE OR REPLACE PROCEDURE loadLOBFromBFILE_proc IS
    Dest_loc BLOB;
    Src_loc BFILE := BFILENAME('SOUND_DIR', '123w.bmp');
    ** SOUND_DIR is a logical directory created by giving path of the server
    ** Create Directory SOUND_DIR as 'd:\u020\o816\ctx\test'
    ** d:\u020\o816\ctx is the physical path of the server \\pslndb\ctx$
    ** test is the dummy testing directory created on the server
    ** 123w.bmp is lying in the test directory
    Amount INTEGER ;
    BEGIN
    Amount := DBMS_LOB.GETLENGTH(Src_loc);
    SELECT photo INTO Dest_loc FROM test_lob
    WHERE ID = 1
    FOR UPDATE;
    /* Opening the source BFILE is mandatory: */
    DBMS_LOB.OPEN(Src_loc, DBMS_LOB.LOB_READONLY);
    /* Opening the LOB is optional: */
    DBMS_LOB.OPEN(Dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(Dest_loc, Src_loc, Amount);
    /* Closing the LOB is mandatory if you have opened it: */
    DBMS_LOB.CLOSE(Dest_loc);
    DBMS_LOB.CLOSE(Src_loc);
    COMMIT;
    END;
    <HR></BLOCKQUOTE>
    null

  • How to show icon in a column of a table?

    How to display an icon in a column of a table UI element and this icon is to be displayed based on values in the table row?

    I normally use a calculated attribute inside the table's data source node for this.
    Add an attribute "Icon", type=string, calculated=true, read-only=true, under the data source node.
    (If the data source node uses structure binding and does not allow to add an attribute, add a helper value node instead, cardinality=1:1, selection=1:1, and add the attribute to this node.)
    In the get-method for the calculated attribute, you get the node element corresponding to the table row as parameter. Depending on other attributes in this node element, select an icon URL and return it.
    If you put your icons inside the src/mimes/<component> folder, you can simply return the file name of the icon.
    Don't use a Button as table cell editor but rather an Image or LinkToAction.
    Armin

  • How to store España in database (in a column of a table)

    Could you please tell me how to store España in database (in a column of a table).
    regards

    Generally speaking you'll need a character set that can support the characters you require.
    Here is a link to the supported character sets in 10.2.x.x:
    [Character Sets|http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#i635016]

  • I am unable to sort multiple columns in a table created in Pages.

    I had been using Appleworks up until I installed Lion and have now switched to iWork. I created a table within a Pages document and am able to sort a single column (using the Table Inspector and choosing Sort from  Edit Rows and Columns) but the Sort option is grayed out when I attempt to sort multiple columns.
    In another post, someone talked about this being a problem if you have merged fields. I do not believe I have done this (to be honest I don't know the function of merging fields).
    This is very frustrating as I was easily able to sort these tables in Appleworks.

    Sharon Anderson wrote:
    Thanks for your quick response! I have been trying that but then found that Numbers would only let me print in landscape view so I had to paste the table back into Pages. Is there a way to print in portrat view (from Numbers?)
    Not so. In the lower left corner of the window, there's an icon that looks like a piece of paper. If you see this:
    you are in Sheet View, or normal, mode. If you see this:
    You are in Print View mode. Now you see the icons for portrait and landscape modes. Click your choice. Then arrange your content to fit the pages as you wish.
    Jerry

  • To check whether there is any size mismatch between columns of two tables

    Hi,
    Here i got two tables T and M where i am going to migrate data from T to M. But before migrating i need to check whether all the data in source table fits into destination table columns. The datatypes of all columns in source table T is of Varchar2 only as it is a temp table.
    Ex :- Table 'T' (Source table) with columns
    T_Lat Varchar2(50);
    T_Amt Varchar2(50);
    T_Cat Varchar2(50);
    T_Vat Varchar2(50);
    Now I have another table 'M'(Destination Table) with columns
    M_Lat Varchar2(50);
    M_Amt varchar2(25);
    M_Cat date;
    M_Vat number;
    Now my task is I have to do a prevalidation of the data in 'T' that whether all the data in those columns will suit for the destination table columns respectively (to check whether there is any size mismatch). This check should be done dynamically.
    For suppose, in T_Amt(source column of T table) if text is abt 50 characters, it cant fit M_Amt(destination column of M table). In this case it should throw an error indicating that destination column size is less for the source column.
    Note:- There is no unique mapping column for these two tables and there are about 400 columns in the source table to be validate
    I think it can be done using arrays or plsql tables.
    Can any one help in this regard.

    >
    Now my task is I have to do a prevalidation of the data in 'T' that whether all the data in those columns will suit for the destination table columns respectively (to check whether there is any size mismatch). This check should be done dynamically.
    >
    Just because the source table T_Amt column is defined as 50 doesn't mean any of the data is really that long. So the data itself needs to be checked. That is just what a simple query can do.
    See my answer in this thread Posted: Jul 25, 2012 1:14 PM
    Re: Help in Execute Immediate - Invalid relational Operator
    Here is the modified sample query and results for a query of a clone of the EMP table with some modified data
    select count(*) cnt,
           -- job column
           sum(case when job is null then 1 else 0 end) job_nul,
           sum(case when job = 'SALESMAN' then 1 else 0 end) job_salesman,
           min(length(job)) job_minlength, max(length(job)) job_maxlength,
           min(job) job_min, max(job) job_max,
           -- hiredate colulmn
           sum(case when hiredate is null then 1 else 0 end) hiredate_nul,
           min(hiredate) hiredate_min,
           max(hiredate) hiredate_max
            from emp1
    CNT JOB_NUL JOB_SALESMAN JOB_MINLENGTH JOB_MAXLENGTH JOB_MIN JOB_MAX  HIREDATE_NUL HIREDATE_MIN HIREDATE_MAX
    14    2       4            5             9             ANALYST SALESMAN 0            9/28/0001    12/3/9999With one query and ONE pass thru the table I was able to get the COUNTs, the MIN and MAX values for each column and the MIN and MAX lengths of the VARCHAR2 columns.
    There are 14 total records, 2 where JOB is null, 4 where the JOB is SALESMAN. The MIN length of the JOB data is 5 and the MAX is 9.
    Look at the date values. The results tell me I have some problem data.
    The length data tells me if I try to put the JOB data into another table I need to define the length as at least 9 or it won't fit.
    For your use case you might find that all of the data in the T_Lat column is shorter than 26 and will actually fit into the M_Lat target table column.

  • How to store data file name in one of the columns of staging table

    My requirement is to load data from .dat file to oracle staging table. I have done following steps:
    1. Created control file and stored in bin directory.
    2. Created data file and stored in bin directory.
    3. Registered a concurrent program with execution method as SQL*Loader.
    4. Added the concurrent program to request group.
    I am passing the file name as a parameter to concurrent program. When I am running the program, the data is getting loaded to the staging table correctly.
    Now I want to store the filename (which is passed as a parameter) in one of the columns of staging table. I tried different ways found through Google, but none of them worked. I am using the below control file:
    OPTIONS (SKIP = 1)
    LOAD DATA
    INFILE '&1'
    APPEND INTO TABLE XXCISCO_SO_INTF_STG_TB
    FIELDS TERMINATED BY ","
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    COUNTRY_NAME
    ,COUNTRY_CODE
    ,ORDER_CATEGORY
    ,ORDER_NUMBER
    ,RECORD_ID "XXCISCO_SO_INTF_STG_TB_S.NEXTVAL"
    ,FILE_NAME CONSTANT "&1"
    ,REQUEST_ID "fnd_global.conc_request_id"
    ,LAST_UPDATED_BY "FND_GLOBAL.USER_ID"
    ,LAST_UPDATE_DATE SYSDATE
    ,CREATED_BY "FND_GLOBAL.USER_ID"
    ,CREATION_DATE SYSDATE
    ,INTERFACE_STATUS CONSTANT "N"
    ,RECORD_STATUS CONSTANT "N"
    I want to store file name in the column FILE_NAME stated above. I tried with and without constant using "$1", "&1", ":$1", ":&1", &1, $1..... but none of them worked. Please suggest me the solution for this.
    Thanks,
    Abhay

    Pl post details of OS, database and EBS versions. There is no easy way to achieve this.
    Pl see previous threads on this topic
    SQL*Loader to insert data file name during load
    Sql Loader with new column
    HTH
    Srini

Maybe you are looking for

  • IPhoto change time and date does not work with Flickr

    Hello everyone, In my iPhoto librairies, I do change my photo date and time to set them we they were actually taken. Here, I'm refering especially to photos which are: * scanned photo * stiched photo The issue is: When I share these photo on Flickr,

  • How do you debug on the ITS?

    Hi, How do you debug an ITS application? I am trying to debug a web app, and I know the error is in the ABAP code. I would like to set a breakpoint in my ABAP code, so that when a certain action occurs from the client (web) side, I will jump to the A

  • How does RFC adapter with EO/EOIO work? Kindly help!

    Hi Experts,         How does a sender or receiver RFC adapter works when QOS is EO or EOIO (Async)? In other words, for EOIO, are the messages are queued? How does this queueing work? Does it use FIFO logic? where do we specify the max limit of messa

  • Print pdf

    My Macbook Air will no longer copy an on-line PDF to a file on m y computer.  It will no longer send a PDF to my printer.  I have the latest OS.

  • Why does my ipad flash when opening an app

    Just trying to figure out why my screen sometimes flashes when pulling up an app, And freezes from time to time anybody know what could be going?? So so appreciate it Thanks....