Store Column-Name into variable

Hello from germany
I got stuck with following:
How is it possible to store the name of a column into a variable or is it possible to put an index "on" a column?
The reason for this: I need to fill and check a complete column!
Thanks for Your help!
Best regards
Marlon

Those sure are unrelated questions. Lets say we have a table like this:
SQL> CREATE TABLE t (
  2    a  number,
  3    b  varchar2(8),
  4    c  date );
Table created.You can get a column name like this:
SQL> set serveroutput on
SQL> DECLARE
  2    second_col   VARCHAR2 (30);
  3  BEGIN
  4    SELECT column_name
  5      INTO second_col
  6      FROM user_tab_columns
  7     WHERE table_name = 'T'
  8       AND column_id = 2;
  9    DBMS_OUTPUT.PUT_line(second_col);
10  END;
11  /
B
PL/SQL procedure successfully completed.
SQL> You can put an index on a column like this:
SQL> CREATE INDEX t_n1 ON t(b);
Index created.And you can add data to the table like this:
SQL> insert into t(a, b) values (4, 'asdf');
1 row created.
SQL> select * from t;
         A B        C
         4 asdf
SQL>

Similar Messages

  • Storing Column-Name into variable? Possible?

    Hello from germany
    I got stuck with following:
    How is it possible to store the name of a column into a variable or is it possible to put an index "on" a column?
    The reason for this: I need to fill and check a complete column!
    Thanks for Your help!
    Best regards
    Marlon

    Your question is not clear. Howver, this is what I guess you want to do.
    Example, Check that the Emplyee Number I enter is KING. Check and Print message accordingly.
    Here i user PL/SQL run in SQLPlus
    SET VERIFY OFF
    SET SERVEROUTPUT ON
    DECLARE
         EMP_NAME VARCHAR(30);
    BEGIN
         SELECT ENAME
         INTO EMP_NAME
         FROM EMP
         WHERE EMPNO = &EMP_NUMBER;
         IF EMP_NAME = 'KING'
         THEN
              DBMS_OUTPUT.PUT_LINE('The Emplyee Name is: '||EMP_Name);
         ELSIF EMP_NAME != 'KING'
         THEN
              DBMS_OUTPUT.PUT_LINE('The Emplyee is not KING but: '||EMP_Name);
         END IF;
    EXCEPTION
         WHEN NO_DATA_FOUND
         THEN
              DBMS_OUTPUT.PUT_LINE('The Employee Number Entered is Invalid');
    END;
    /

  • How to put the column name and variable value in the alert message.

    Dear,
    how can i put the column name and variable value in the alert message text. i want to display an alert which tell the user about the empty textboxes. that these textboxes must be filled.
    Regards:
    Muhammad Nadeem
    CHIMERA PVT. LTD.
    LAHORE
    [email protected]

    Hello,
    The name of the item that fires the current trigger is stored in the :SYSTEM.TRIGGER_ITEM system variable.
    The value contained in this item can be retrived with the Name_In() built-in
    value := Name_In( 'SYSTEM.TRIGGER_ITEM') ;
    LC$Msg := 'The item ' || :SYSTEM.TRIGGER_ITEM || ' must be entered' ;
    Set_Alert_Property('my_alert_box', ALERT_MESSAGE_TEXT, LC$Msg ) ;
    Ok := Show_Alert( 'my_alert_box' ) ;
    ...Francois

  • WRAP JTable Column Name into 2 lines

    I have a JTable with a long column Name. Can I wrap the Column Name into multiple (2) lines.

    baskaraninfo wrote:> set the following to a table column,<html><body>Employee<br>Name</body></html>>The break tag got lost cos you didnt use the code tags
    <html><body>Employee<br>Name</body></html>

  • ORA-17414: Insufficient Buffer size to store Columns Names

    Hi,
    During data retrieval from an Oracle 8.0.6 database (on HP-Unix) we get the following error: "Insufficient Buffer size to store Columns Names". This error is registered as ORA-17141 (???). At least this is what we see if we have a look at the JDBC driver (8.1.6 driver for Java 1.2.x in file "Message.properties" of the "classes12.zip")
    We cannot find any further explanation for this problem. Which buffer size is meant? Can this buffer be adjusted? Is this an oracle buffer or an buffer used by java?
    Thanks,
    Ronald

    Thom,
    How many columns are there in your query? Do they have lengthy column names? Has your schema or query changed during the upgrade?
    One possible workaround if you have lengthy column names in your query is to try doing something like "select somelongcolumnname1 as c1, somelongcolumnname2 as c2 ..." and see if it works. Admittedly, this is only a workaround, but it should be better than renaming your column names.

  • Insufficient Buffer size to store Columns Names

    I am using WebSphere 3.02 with Oracle on OS/390. Some of my servlets work but some get the error:
    Insufficient Buffer size to store Columns Names
    This is a Oracle error, ORA-17414. All of the doc says:
    Note: Cause and action for each message will be provided in a later release.
    This was in 1999, and I still cannot find cause and action information.
    Anyone know what this error is?
    Thanks.

    Thom,
    How many columns are there in your query? Do they have lengthy column names? Has your schema or query changed during the upgrade?
    One possible workaround if you have lengthy column names in your query is to try doing something like "select somelongcolumnname1 as c1, somelongcolumnname2 as c2 ..." and see if it works. Admittedly, this is only a workaround, but it should be better than renaming your column names.

  • Java.sql.SQLException: Insufficient Buffer size to store Columns Names

    Hi !
    Here is my question: every time I query
    some tables in my database I get this
    strange exception:
    java.sql.SQLException: Insufficient Buffer
    size to store Columns Names
    This happens to me since we upgraded
    Oracle server to a new revision version
    with new JDBC classes.
    Anyone can help me to fix the problem ? I
    don't want to rename
    the column names to shorter names.
    Thanx

    Thom,
    How many columns are there in your query? Do they have lengthy column names? Has your schema or query changed during the upgrade?
    One possible workaround if you have lengthy column names in your query is to try doing something like "select somelongcolumnname1 as c1, somelongcolumnname2 as c2 ..." and see if it works. Admittedly, this is only a workaround, but it should be better than renaming your column names.

  • How to use column name as variable in select statement

    hi,
    i want to make a sql query where in select statement using variable as a column name. but its not working plz guide me how can i do this.
    select :m1 from table1;
    regards

    Hi,
    Is this what you want..
    SQL> select &m1 from dept;
    Enter value for m1: deptno
    old   1: select &m1 from dept
    new   1: select deptno from dept
        DEPTNO
            10
            20
            30
            40
    SQL> select &m1 from dept;
    Enter value for m1: dname
    old   1: select &m1 from dept
    new   1: select dname from dept
    DNAME
    ACCOUNTING
    RESEARCH
    SALES
    OPERATIONS
    SQL> select &&m1 from dept;
    Enter value for m1: loc
    old   1: select &&m1 from dept
    new   1: select loc from dept
    LOC
    NEW YORK
    DALLAS
    CHICAGO
    BOSTON
    SQL> select &&m1 from dept;
    old   1: select &&m1 from dept
    new   1: select loc from dept
    LOC
    NEW YORK
    DALLAS
    CHICAGO
    BOSTONIf you use single '&' then each time you fire the query, It will ask for the new value..
    But if you will use double '&&' the value of m1 will be persistent across the session..
    Twinkle

  • Sharepoint Workflow : how to get document full path + file name into variable?

    Hi,
    Anybody knows how to get document full path + file name into a variable in Sharepoint 2010 workflow?
    Example http://sp1:80/InvoiceQueue/Shared Documents/123.pdf
    I am using List Workflow which links to a document library.

    Hi SAMSUNG,
    According to your description, my understanding is that you want to get the full path of a document in a list workflow.
    You can set the variable to the Enconded Absolute URL of the document. The screenshot is my testing. In my testing (in the red area), when the title of a document was equal to the tile of the current item, set a variable to the Enconded Absolute URL of the
    document. I used ‘Log to history list’ to check the value of the variable in Workflow History .
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Adding column name into tables.

    Hi guys,
    i have a panel which consist of a scroll table which i am not sure how to i add column names tru this type of coding. and some more i have to retrieve info from the database and display into this table. can someone pls guide me how to i add in the column names and how do i retrieve info out from db and displying it onto the table? a million thanks! :)
          * This method initializes jScrollPane_viewLogTable     
          * @return javax.swing.JScrollPane     
         private JScrollPane getJScrollPane_viewLogTable() {
              if (jScrollPane_viewLogTable == null) {
                   jScrollPane_viewLogTable = new JScrollPane();
                   jScrollPane_viewLogTable.setBounds(new java.awt.Rectangle(27,30,460, 200));
                   jScrollPane_viewLogTable.setViewportView(getJTable_viewLogTable());
              return jScrollPane_viewLogTable;
          * This method initializes jTable_viewLogTable     
          * @return javax.swing.JTable     
         private JTable getJTable_viewLogTable() {
              if (jTable_viewLogTable == null) {
                   jTable_viewLogTable = new JTable();
              return jTable_viewLogTable;
         }Titus

    It's not my code, it's just Java.
    C'mon, read the javadocs.
    Or look at this:
    http://www.exampledepot.com/egs/java.sql/GetRsColCount.html
    %

  • UIX get EO column names into a messageChoice

    I'm working on building a search function into my form which will allow the user to enter an arbitrary search string into a text box and then provides a list of columns in the table to be searched on. Is there any way to populate that list box (messageChoice) with the column names from the database dynamically? And if so, could I have the value set to those and the label set to the 'human readable' label text used on my forms?
    Nick

    Try looking at the section "Apply a filter to the Lov Window" here:
    http://otn.oracle.com/products/jdev/howtos/10g/adf_uix_lov_ht/index.html

  • Store/print name of variable

    import java.util.ArrayList;
    public class Lalalala {
    public static void main(String [] args) {
    ArrayList<String> stringers1 = new ArrayList<String>();
    ArrayList<String> stringers2 = new ArrayList<String>();
    ArrayList listers = new ArrayList();
    stringers1.add("abc");
    stringers1.add("def");
    stringers2.add("ghi");
    listers.add(stringers1);
    listers.add(stringers2);
    System.out.println(listers);
    This code prints out "[[abc, def], [ghi]]" when I would like it to print out "[stringers1, stringers2]"
    So my question is: Is there anyway I can store the name of a variable / ArrayList in an ArrayList?

    Nesthead wrote:
    Sorry, I know it's confusing.
    So instead, am I able to access a specific String in an ArrayList of Strings in an ArrayList?
    Or,
    ArrayList<String> stringers = new ArrayList<String>();
    stringers.add("abc");
    stringers.add("def");
    ArrayList<ArrayList> listers = new ArrayList<ArrayList>();
    listers.add(stringers);
    Is there a line of code that will allow me to access only "def"?Still sounds like you should use a Map. I'm assuming (since you've not provided details) that you have some object
    class Foo {
      String name;
      int x;
      String y;
      Date z;
    }and you have a List of that object, and you want to retrieve one of them based on its "name" field. If that's the case, put the objects in a map, where the key is the name field and the value is the object.
    Why do you even have List<List<String>>? That sounds kind of icky. What do the String and the two Lists represent?
    If for some reason you really just have List<List<String>> and that is actually valid for what you're trying to accomplish, then you'd have to iterate over the outer list, and call indexOf on the inner list. Assuming I'm guessing correctly at what you mean by "access" that String.
    Also, when you post code, highlihgt it and click the CODE button so that it will be readable.
    Edited by: jverd on Oct 4, 2009 9:53 AM
    Edited by: jverd on Oct 4, 2009 9:54 AM

  • Get column names into a VB program, for an SQL query that joins tables

    use [mydatabase]
    select * from InvNum inum
    left join _btblInvoiceLines ilin
    on inum.autoindex = ilin.iinvoiceid
    left join stkitem s
    on ilin.istockcodeid = s.stocklink where InvNumber = 'IVQ0834' or InvNumber = 'IVQ0835'
    I need to get out the column names in a VB program in the same order they would appear in the SQL query above...
    I want to use something like:
    select column_name from information_schema.columns where TABLE_NAME = ....
    except there are several tables involved above so I dont know the format!

    If you execute the query in your program using the SqlDataReader.ExecuteReader method, the column names will be available via the GetName method of the returned reader.  But note that your query may return multiple columns with the same name.
    Dim reader As SqlDataReader = command.ExecuteReader()
    For x = 0 To reader.FieldCount - 1
    Console.WriteLine(reader.GetName(x))
    Next x
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • How to call the column names into the prompt and display values dynamically

    Hi,
    i have a typical requirement where I have to call 3 columns into the AGE Prompt (I know we can use the Column Selector to call the columns) .Below is the Screen Shot.
    !http://i46.tinypic.com/2qjfukh.jpg!
    2nd Requirement)
    The three columns I have are order Date, Ship Date and Entry Date.
    Whenever I click on Orderdate from the Prompt, It should dynamically show its values in the report.
    and When I click on the Ship Date from the Prompt, it should display the corresponding values in the report.
    and so on with the Entry Date.
    Can anybody help me how to acheive this.
    Thanks a ton.

    Ok so then you can use a fake column prompt. Here's one quick approach (nicer and cleaner with LOV tables but I don't if you have any of those).
    - Create a fresh prompt using any column you want.
    - Open the column formula using the fx button and replace the formula with 'abc'.
    - Use "SqL Results" as the "Show" option.
    - SQL:
    select case when 1=0 the Markets.Region else 'Order Date' from Paint.Markets UNION ALL
    select case when 1=0 the Markets.Region else 'Ship Date' from Paint.Markets UNION ALL
    select case when 1=0 the Markets.Region else 'Entry Date' from Paint.Markets
    - Set Variable = Presentation Variable = @{vPresVarSelectedDate}{Order Date}
    - Label = Date
    Then in the request, you change the column formula for the date. I'm going to make it short and just assume you called your time dimension alias(es) like the lowest grain:
    "@{vPresVarSelectedDate}{Order Date}"."@{vPresVarSelectedDate}{Order Date}"
    Cheers,
    C.

  • How to store the value into variable and access it in RMAN script

    I want to create a variable and dynamically assign a numeric value to it (may get the value may be from SQL )and access the value in RMAN script.
    Thanks...Raj

    Raj,
    We have been getting this type of request and it is not possible via RMAN to do that.
    BUT--You could write a sql/plus script to query your variable and produce the RMAN script with the new value.
    Just a suggestion.
    Tammy

Maybe you are looking for

  • ABAP mapping split messages and dynamic filename

    Hello, i have set up a IDOC to file scenario where the IDOC is split into several files, which works fine. In addition to this it is required to set a dynamic filename out of the ABAP mapping for each file. If only one file is created this works alre

  • 10.4.6 Has killed my machine TWICE

    Twice I have tried to install 10.4.6 on my 533 MHz G4 and both times I have been locked in never ending start up. In fact, the first time I tried to install this update I think it somehow killed my system drive. I have since switched to a new hard dr

  • F110 payment postings individual invoices

    Hi, When executing the paymentrun (Direct debits), the payment program generates 1 payment posting (clearing document) per customer in which several open items/invoices are processed. Now we want to have a payment document (clearing document) for eac

  • Start Date for Sysdate

    Hi All, I have requirement, How to find out the START DATE of the CURRENT DATE means SYSDATE. Suppose.......my current date is 10 th July 2007 then i want the oupput as 1 st July 2007 Thanks in Advance Regards, Gita

  • InDesign troubleshooting hyperlinks when containing &,=,?

    Hi, I'm trying to export an interactive pdf and I'm having troubles with certain URL hyperlinks. While links containing only full stops and slashes export well, the other ones that contain characters such as ?, =, & don't work. Please help, I've been