Add/change the columns of data type (scripting)

Hello

I am writing a script to add default columns and their values in tables. So far, for me, it is possible to add columns to an existing table in the model.

Then, I want to add value to the data type. I discovered there is a method called getDataType(). So far, I have not found the "setter; for this property.

Like other scripts, I started by creating a table with columns, and then using the API to read the values.

A simplified version of my code:

get the columns of table

myTab var = model.getTableSet () .getByName ("T_POSITIONS");

colArray = myTab.getElementsCollection () .toArray ();

loop through columns

for (i = 0; i < colArray.length; i ++) {}

the type of var data = colArray [i] .getDataType ();

model.getAppView () .log (colArray [i] + "a datatype" + dataType);

colArray [i] .setDataType ("VARCHAR2 (1)");

}

An error occurs when I want to run this script: could not find setDataType function in the object ID.

I can't find the right method to add/change the datatype property.

Any information would be appreciated.

Hi Bart,.

Here's what's in the column in the XML file:


FDB11R21
EMPLOYEES
FIRST_NAME

2015-01-13 12:45:08 UTC
First name of the employee. A not null column.
HR_870
true
false
1
LOGDT024
20 BYTE
false

20 BYTES

If you need set the size in "20 BYTE" or "20 CHAR".

Philippe

Tags: Database

Similar Questions

  • function to change the names of data type members

    I was wondering if (TestStand 4.2) contains the ability to call all referrences to a Data Type member used in a sequence will be replaced by the new name if this member DataType is renamed in the MyTypes.ini file?

    The answer is no, and it's a difficult problem, if you speak code modules written in different programming languages different sources including files and always a problem semi-difficile if you're not because of the possibility of lookupstrings appearing in places unusual or used in an unusual way.

    However, there are 2 features that exist in TestStand 4.2 which should help with this.

    (1) search/replace in files - if the old name is quite unique, it should be easy, if it is not then maybe with a clever use of regular expressions in the search string, it should still be feasible.

    (Monitor 2) - this should help you find the places that need fixing or you might have missed to make 1) above.

    Hope this helps,

    -Doug

  • selection column of the table xml data type

    Hello.
    I tried the following example with xml as column name data type
    create table emp_detail( empno number,ename varchar2(32),empdetails sys.xmltype)
    
    Insert into EMP_DETAIL
       (EMPNO, ENAME, EMPDETAILS)
     Values
       (1, 'satya', XMLTYPE('<NAME>
      <FIRSTNAME>SATYA</FIRSTNAME>
      <LASTNAME>SREE</LASTNAME>
      <LOC>SECBAD</LOC>
    </NAME>
    '));
    Insert into EMP_DETAIL
       (EMPNO, ENAME, EMPDETAILS)
     Values
       (2, 'jo', XMLTYPE('<NAME>
      <FIRSTNAME>JO</FIRSTNAME>
      <LASTNAME>REDDY</LASTNAME>
      <LOC>MYPR</LOC>
    </NAME>
    '));
    So, after that I tried this query to retrieve the State of an attribute data.
    SELECT a.empdetails.extract('//NAME/text()').getStringVal() AS "Table Name"
    FROM   emp_detail a
    WHERE  a.empdetails.existsNode('/NAME')  = 1;
    But those who above indicates no record...
    Why?


    Thank you
    SQL>  SELECT a.empdetails.extract('//NAME/FIRSTNAME/text()').getStringVal() AS "first_name",
      2     a.empdetails.extract('//NAME/LASTNAME/text()').getStringVal() AS "last_name",
      3     a.empdetails.extract('//NAME/LOC/text()').getStringVal() AS "loc"
      4     FROM emp_detail a
      5    WHERE a.empdetails.existsNode('/NAME')  = 1;
    
    first_name           last_name            loc
    -------------------- -------------------- --------------------
    SATYA                SREE                 SECBAD
    JO                   REDDY                MYPR
    
  • How to transfer data from the column of CHAR type to column?

    I have a column with data type varchar2 contains data in format: dd/mm/yyyy hh24:mm:ss for example 24/11/2013-08:15:22

    I want to execute an update statement in order to put these data in a date column how?

    Note: I use Oracle DB 10 g

    Update

    Set = to_date (, "dd/mm/yyyy hh24:mi:ss");

  • Change the time and date of deposit when importing

    Hi everyone, when I import images in my project, automatically first change date and time with the current date and time in the finder. So each imported file have changed the time and date when I search in the finder under the "created" or "modified" column, is this normal?. There is no way to avoid this?

    Thanks in advance

    Yes, you can prevent this! Go to the preferences of first and go to the media section. Uncheck "Write XMP IDS to files on import". Boom, done. First will not add his small beacon of metadata files when you import them. This isn't a huge deal for most publishers except Adobe apps could create media Cache files more than necessary if you re - use clips in other projects. Don't forget, however, anything, if you change the metadata (in the project Panel or metadata) file, it'll still change changed data for the clips.

  • change the column size will has no

    Hi all

    I have a question on oracle 10g. I will modify one of the type of column of varchar table (100) to varchar (200).
    Initially I intend to modify the table in readonly mode, then change the column.

    But I hit the options not valid error and discovered that, in 10g, do not have this feature, so I intend to do online, but during off peak hours.
    So my question is when I change the column, if there is an insert/update / delete on the table, they would wait or they will fail?

    Please notify.

    >
    1 let say if the previous DML operation were engaged
    4 h I fire the alter column statement
    3. the DML from query, they will wait the "alter column' finished or they fail?

    When you perform the alter column, there will be a level lock table to prevent the update of the rite of the table?
    >
    Yes - but the table will lock only for a moment. Edit a VARCHAR2 column to expand it is only a change in data dictionary. No actual data is changed.

    The table should be locked to change the dictionary, and is then immediately unblocked. There will be no problem of performance. You need just one or two seconds, there where there is no DML or DDL going on for this table.

  • How can I change the columns in File-&gt; Open views program?

    I use El Capitan 10.11.3 on a MacBook Pro. I start with a clean system. I copied my files from my backup and reinstall my programs.

    This created a problem, seeking to resolve by changing the column headings in the views of program "file-> open.

    Whatever program I use, when I open a file, the window displays currently "Date added". It is of no use to me as the "Date added" to all my files is exactly the same - date, I have copied them on my own hard drive brilliant from my backup.

    In finder views, I can opt to display "update" instead of "added". So I order the files by date, whenever this is useful.

    However, whenever I try to open a file in a program, it is impossible to find things by date, because they all have the same "date added". I need to be able to see the "change date".

    I find anywhere that allows me to change this, either in the system preferences, or when opening a specific program. Don't I found clues to aid or the forum.

    Can someone tell me what I need to do?

    Thanks in advance.

    Mike

    Right click on the headers (if in list view) and select the headers you want to see.

    Alternatively, use the Arrangement to organize the desired date.

  • queues the IMAQ image data type

    I'm trying to run multiple queues in the same loop entering IMAQdx images from several cameras, and then save to AVI. After reading the site nor a little, I discovered that the reason why I get only the last image of each bucket, repeated on all frames in the AVI file, is that the IMAQ image data type stores only the memory location for the image, not the image itself data. However, I don't see a better solution for the queues of the actual image data. What conversion could be the fastest / are in charge of the processor the lowest?

    For each image you must initial Image space.

    You can use something like this:

    You need to add initialization camera (s) and AVI. You must add the multicamera feature. Stop recording is missing.

    !!! Don't forget to throw lines and Images!

  • A statement UPDATE changes the line if the update changes the column even value?

    HI -.

    I have a main classification and the corresponding audit table. I have a trigger. I created using the suggestion:http://www.runningoracle.com/product_info.php?products_id=211

    Now the problem that I am facing is that: if I run the same query (same value) update on the main table for n times (with the same data)... my audit table is updated with a new record every time. He is not able to determine that the value is the same.

    My goal is to load the audit table data if the value in a cell in the main table is really have changed.

    A statement UPDATE changes the line if the update changes the column even value?

    Best regards

    I have a main Table and the corresponding Audit Table. I have a trigger. I created using the suggestion:http://www.runningoracle.com/product_info.php?products_id=211

    Why?

    You try to resolve what made you what are the PROBLEM that select as the solution?

    Now the problem that I am facing is that: if I run the same query (same value) update on the main table for n times (with the same data)... my audit table is updated with a new record every time.

    Yes - it is EXACTLY what you say that you wanted to do and EXACTLY what the code does in this article.

    He is not able to determine that the value is the same.

    I think you mean that the code does NOT check if the value is the same. You can certainly change the code to do this check. But I have a question to start with your need for such a solution.

    My goal is to load the audit table data if the value in a cell in the main table is really have changed.

    OK - then modify the code to check EACH COLUMN and compare its NEW value to the OLD value and insert only the table of audit if SOME (or columns you care specifically) have changed.

    A statement UPDATE changes the line if the update changes the column even value?

    It depends on what you mean by 'change the line '. Of course to update a column with the SAME value does not change the resulting data value.

    But the physical structure of the line, the location of the pieces of line and information in the header block (YVERT, etc.) will change. And, as others have said Oracle doesn't know and doesn't care, so if the new value of a column is the same as the old value will create redo, undo and the rest.

    Start over and tell us what PROBLEM you're trying to solve. Then we can help you find the best way to solve it.

  • Full table scan without sweeping particular column (CLOB data type column)

    I want to select the online_bank table. This table with a column of type CLOB data. I want to select all the columns in the table, except the column type of clob data. but oracle full table, including the column analysis server type CLOB data when the query is run. It took a long time to complete the table. Please give me a solution of full table scan without analysis the CLOB data type column. How to avoid the time scanning CLOB data type column... ?

    878728 wrote:
    I want to select the online_bank table. This table with a column of type CLOB data. I want to select all the columns in the table, except the column type of clob data. but oracle full table, including the column analysis server type CLOB data when the query is run. It took a long time to complete the table. Please give me a solution of full table scan without analysis the CLOB data type column. How to avoid the time scanning CLOB data type column... ?

    We do not have your table.
    We do not have your data.
    Therefore, we have no answer to your apparent mystery.

  • Change the column header font size

    Hi all

    In the view of the table, I am able to change the size of the font of a column, but this does not affect the column header.
    This translates into having the data in a single font size and position of the original size.
    I tried to update the class column header in view.css (analytics\res\s_oracle10\b_mozilla_4):
    . {ColumnHdg}
    color: #3c3c3c;
    border-style: solid;
    border-color: #c9cbd3;
    border-width: 0 1px 1px 0;
    background-color: #cfe0f1;
    do-size: 8pt;
    make-weight: bold;
    vertical-align: bottom;
    padding: 1px 2px 2px 3px;
    text-align: left;
    }
    but this does not at all affect the size of the text.

    NB: I refresh and clear the cache of the browser every time I make a change in the CSS file.

    One knows what the problem is. ??

    Concerning
    Adil

    Hello
    To change the column heading, go to the properties of column-> data format-> next to the column name, you can see change format-> give the font size of the column header.
    Is that what you want?

    Kind regards
    Srikanth

  • Changed the name of data

    SUMIFS (data: $C, data: $B, $A2, given: $A, "> =" & B$ 1, data: $A, "<" & (EOMONTH(A1,0) will GET ($1.0 B) + 1))

    It's the formula that I used until I changed the names of "data Plan". The original names were:

    A1

    A6

    A12

    B1

    B6

    etc...

    I changed the plan of names...  I want to start all over again... The original formula still works?

    The original formula should still work as long as the new plan names are spelled the same in both tables.

    SG

  • Windows Media Player - change the columns that appear under 'Now Playing'

    I would like to change the columns displayed in the views now play and Windows Media Player play list.  The factory default is to show only the fields title and length.  It wouldn't be that big a deal this is something fairly simple to access the page layout options, hit choose columns and select the check boxes for the columns I want to show... but the title and duration are the only fields that it allows me to select from.  He still refuses to allow me to select anything else.  I know that there is a way to display more information, but for the life of me I don't remember how to do so that he can do.  Help?

    Hey,.

    I've recreated the scenario on my Windows Media Player. It shows all the info like length, side, title, album, artist to contribute. Appoint you.

    Scan SFC should be your friend.

    http://support.Microsoft.com/kb/929833/en-us

  • Dynamically change the Format of Date of Application

    Hi all

    I am looking for a possibility to change the format of date of Application in globalization attributes dynamically according to the user.

    Something likeAPEX_UTIL.SET_SESSION_TIME_ZONE but for the date format.

    Does anybody know how it works?

    In detail:

    I want dates in interactive reports display in a specific date format.

    If I put the following in the attributes of 'security' - call the virtual private database PL/SQL to define the security context:

    BEGIN

    If password = "MY_TEST_USER" then

    run immediately "alter session set nls_calendar =" English Hijrah "';"

    run immediately "alter session set nls_date_format =" DD-MM-YYYY "';"

    end if;

    END;

    Then, the dates are indicated correctly in reports interactive but not in the Action menu-> filter.

    If I put date_format = "DD-MM-YYYY" in the attributes of the globalization, it works very well in the interactive report filter.

    The problem is that I want to set this attribute only for some users.

    Thank's,

    Kirsten

    (APEX 4.0/APEX 4.2)

    Because you can use string syntax of substitution for the attributes of the globalization, for example, you could create an element of the AI_DATE_FORMAT application, reference & AI_DATE_FORMAT. and fill out the application element according to certain parameters in the code after the authentication of the authentication system (for example: get a parameter of an array of parameters user or somesuch).

  • How the little purple pink squares onto a PDF to add/change the text. Also how edit you fonts? This app is not easy to use. Read the instructions and they are lacking to say the least.

    I hate this app! I read the user guide, but it does not with the application. How/where are the small Pink/Purple to add/change the text boxes? How can we change phont and point?

    If you use Adobe Reader/Acrobat Reader, that you do not sense because it's none of those things.

    Edit a PDF file and the creation of form fields are made with Acrobat Standard or Acrobat Pro.

    Once the fields of the form are added, people with Adobe Reader can fill.

    Note that, even in Acrobat Pro, editing is very limited and frustrating because PDF is not made for editing.

Maybe you are looking for