Aliase name as another column name...

Hi,
I need to create a query with column aliase as another column name.
Please find an table below.
Account_name Budjet_year Desc
1 2007 test1
2 2007 test2
3 2007 test3
1 2008 test4
3 2008 test5
The resulting column should have an aliase depending on the budjet year say like 2007Act or 2008Act.
I tried using the query
Select Account_name t.Budjet_year||"Act" from table t
but i am geting error
Please advice.

Why not let the client reporting tool handle this?
In SQL*Plus e.g. you could do something like
col d new_value d
with t as
     (select 1 account_name, '2007' budjet_year, 'test1' descr from dual union all
      select 2, '2007', 'test2' from dual union all
      select 3, '2007', 'test3' from dual
select distinct budjet_year || 'Act' d from t
col "&d" form a20
with t as
     (select 1 account_name, '2007' budjet_year, 'test1' descr from dual union all
      select 2, '2007', 'test2' from dual union all
      select 3, '2007', 'test3' from dual
select account_name, budjet_year "&d" from t
/

Similar Messages

  • Alias name for the column name in Prompt

    Hi,
    I have a scenario where I am taking column names into prompt. I have used the following SQL in the SQL results under "Show" option of the Prompt.
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By OrderDate"' END FROM " Real Time"
    UNION ALL
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By ShipDate"' END FROM "Real Time"
    My problem here is I am getting the column names into the Prompt as "Orders"."By OrderDate" and "Orders"."By ShipDate", which is not acceptable and readable for mat for the user. Is there any way that I can assign an alias name for the column name such as OrderDate and ShipDate in the above SQL.
    Your quick respose is appreciated.
    Thanks,
    Rama

    hi,
    try an alternative one....in your administrator make new columns with alias to ones you want...so you wiil be able to show whatever you want.
    Otherwise,is it possible to show
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By OrderDate"' as "xxxxxxxxxxxxx"END FROM " Real Time"
    UNION ALL
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By ShipDate"' as "yyyyyyyyyyyyyyyy"END FROM "Real Time"
    Ending,you want the data from your columns?or just the name??
    hope i helped...
    http://greekoraclebi.blogspot.com/

  • What is the key column name and value column name in JDBC Adapter parameter

    Hi
    Can any one please tell me what is the Key Column Name and Key Column Value in JDBC adatper parameters. If i dont mention those parameters i am getting the following error
    <b> Value missing for mandatory configuration attribute tableEOColumnNameId</b>
    Please help me
    Best Regards
    Ravi Shankar B

    Hi
    I am doing DataBase Lookup in XI
    First i have created a  Table in Database( CheckUser) which has two fields UserName and PhoneNumber and then i have created
    I have created one Communication Channel For Reciever Adapter .
    I have given the parameters like this
    JDBC Driver : com.microsoft.jdbc.sqlserver.SQLServerDriver
    Connection : jdbc:microsoft:sqlserver://10.7.1.43:1433;DatabaseName=Ravi;
    UserName.... sa
    password.... sa
    persistence : Database
    Database Table Name : CheckUser
    Key column name and Value column name i left blank and activated
    and then
    I have created
    Data Types : Source ...... UserName
                      Destination.... PhoneNumber
    Message Types
    Message Interfaces
    In Message Mapping
                  I have created one User Defined function DBProcessing_SpecialAPI().This method will get the data from the database....
    In this function i have written the following code
       //write your code here
    String query = " ";
    Channel channel = null;
    DataBaseAccessor accessor = null;
    DataBaseResult resultSet = null;
    query = "select Password from CheckUser where UserName = ' " +UserName[0]+ " '  ";
    try {
         channel = LookupService.getChannel("Ravi","CC_JDBC");
         accessor = LookupService.getDataBaseAccessor(channel);
         resultSet = accessor.execute(query);
         for(Iterator rows = resultSet.getRows();rows.hasNext();){
              Map  rowMap = (Map)rows.next();
              result.addValue((String)rowMap.get("Password"));
    catch(Exception e){
         result.addValue(e.getMessage());
    finally{
         try{
              if(accessor != null)
                   accessor.close();
         }catch(Exception e){
              result.addValue(e.getMessage());
    And the i have mapped like this
    UserName -
    > DBProcessing_SpecialAPI----
    >PhoneNumber
    when i am testing this mapping i am getting the following error
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Dest_JDBC_MT xmlns:ns0="http://filetofilescenario.com/ilg"><phoneNumber>Plain exception:Problem when calling an adapter by using communication channel CC_JDBC (Party: , Service: Ravi, Object ID: c360bc139a403293afbc49d5c46e4478) Check whether the communication channel exists in the Integration Directory; also check the cache notifications for the instance Integration Server (central Adapter-Engine) Channel object with Id Channel:c360bc139a403293afbc49d5c46e4478 not available in CPA Cache.
    com.sap.aii.mapping.lookup.LookupException: Problem when calling an adapter by using communication channel CC_JDBC (Party: , Service: Ravi, Object ID: c360bc139a403293afbc49d5c46e4478) Check whether the communication channel exists in the Integration Directory; also check the cache notifications for the instance Integration Server (central Adapter-Engine) Channel object with Id Channel:c360bc139a403293afbc49d5c46e4478 not available in CPA Cache.
         at com.sap.aii.ibrun.server.lookup.AdapterProxyLocal.<init>(AdapterProxyLocal.java:61)
         at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.getProxy(SystemAccessorInternal.java:98)
         at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.<init>(SystemAccessorInternal.java:38)
         at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.getConnection(SystemAccessorHmiServer.java:270)
         at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:70)
         at com.sap.aii.utilxi.hmis.server.HmisServiceImpl.invokeMethod(HmisServiceImpl.java:169)
         at com.sap.aii.utilxi.hmis.server.HmisServer.process(HmisServer.java:178)
         at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:296)
         at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:211)
         at com.sap.aii.utilxi.hmis.web.workers.HmisInternalClient.doWork(HmisInternalClient.java:70)
         at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doWork(HmisServletImpl.java:496)
         at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doPost(HmisServletImpl.java:634)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    </phoneNumber></ns0:Dest_JDBC_MT>
    In RWB i have checked the status of JDBC driver its showing the following error
    <b>Value missing for mandatory configuration attribute tableEOColumnNameId</b>
    Best Regards
    Ravi Shankar B
    Message was edited by:
            RaviShankar B

  • How can I lookup text values in a column and display a list of corresponding names from another column, sorted by values?

    My spreadsheet looks like this:
              Monday     Tuesday     Wednesday
    Name 1     OFF          4:30 PM     4:30 PM
    Name 2     5 PM     OFF          4:30 PM
    Name 3     4:30 PM     5 PM     OFF
    Name 4     4 PM     OFF          OFF
    I would like to create a spreadsheet for each day that will display the values sorted by time, as follows (e.g. Monday):
    Name     In Time
    Name 4     4 PM
    Name 3     4:30 PM
    Name 2     5 PM
    Any help would be greatly appreciated. Thanks!

    Here's an example, using the provided data:
    I've set the alignment on Main to Automatic (except for row 1) to distinguish between numeric and quasi numeric values (aligned right) and text (aligned left). This is a visual aid to developing the table, and would likely be changed for appearance in the end version.
    Columns E, F and G of Main are index columns listing the RANK of numeric/date and time values in columns A, B and C respectively. Text values cause RANK to throw an error, which is caught by IFERROR, which returns a value of 999, chosen to be well above any of the RANK values returned. A small amount ( ROW()/100000 ) is added to each result to prevent duplicate results is cases like column D, where duplicate times appear.
    Formula: Main::E2: =IFERROR(RANK(B2,B,1),999)+ROW()/100000
    Fill down the column, and right to column G.
    These columns may be hidden.
    The three daily columns use a single formula each, revised to match the index columns from which they determine the row containing each piece of data to be copied, and to match the columns from which they retrieve that data. The formulas from row 2 of these tables are listed here in the order (left to right) that they are used in the second row of tables above. Parts that are edited from one formula to another are shown in bold.
    =IF(SMALL(Main :: $E,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$E,ROW()-1),Main :: $E,0)-1,0))
    =IF(SMALL(Main :: $E,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$E,ROW()-1),Main :: $E,0)-1,1))
    =IF(SMALL(Main :: $F,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$F,ROW()-1),Main :: $F,0)-1,0))
    =IF(SMALL(Main :: $F,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$F,ROW()-1),Main :: $F,0)-1,2))
    =IF(SMALL(Main :: $G,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$G,ROW()-1),Main :: $G,0)-1,0))
    =IF(SMALL(Main :: $G,ROW()-1)>999,"",OFFSET(Main :: $A$1,MATCH(SMALL(Main::$G,ROW()-1),Main :: $G,0)-1,3))
    Each of the formulas is filled down its column.
    Each of the functions used is described in the iWork Formulas and Functions User Guide, a useful resource to have on hand when you are writing (or attempting to 'decode') Numbers formulas, The guide (and the Numbers '09 User Guide) may be downloaded from the Help menu in Numbers '09.
    Regards,
    Barry

  • How to get the table name and bind columns names in an INSERT statement ?

    I have an INSERT statement with input parameters (for example
    INSERT INTO my_table VALUES (:a, :a, :a)) and I want to know
    without parsing the statement which is the name of table to
    insert to and the corresponding columns.
    This is needed to generate the SELECT FOR UPDATE statement to
    refetch a BLOB before actually writing to it. The code does not
    know in advance the schema (generic code).
    Thanks in advance,
    Joseph Canedo

    Once you have prepared your statement, you can execute the
    statement with the OCI_DESCRIBE_ONLY mode before binding any
    columns. Then you can use OCIParamGet to find out about each
    column (column index is 1-based). You should get OCI_NO_DATA or
    ORA-24334 if there are no more columns in the statement. Note
    that the parameter descriptor from OCIParamGet is
    allocated/freed internally by OCI; you do not need to manage it
    explicitly. The parameter descriptor is passed to OCIAttrGet in
    order to obtain for instance the maximum size of data in the
    column OCI_ATTR_DATA_SIZE. You can also get the column name in
    this way, although I do not remember the #define off the top of
    my head. Getting the table name appears to be much more
    difficult; I have never had to do that yet. Good luck. -Ralph

  • Making XSD element name match the column name/header

    The XML format of the answer I created looks like the following. How can I change the element name from C0, C1... to real column name? http://host:port/analytics/saw.dll?Go&searchid provided the XML
    <?xml version="1.0" encoding="utf-8" ?>
    - <RS xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
    - <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:saw-sql="urn:saw-sql" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset">
    - <xsd:complexType name="R">
    - <xsd:sequence>
    <xsd:element name="C0" type="xsd:double" minOccurs="0" maxOccurs="1" saw-sql:type="double" saw-sql:displayFormula=""CUSTOMERS"."SALES"" saw-sql:aggregationRule="none" saw-sql:aggregationType="nonAgg" saw-sql:tableHeading="CUSTOMERS" saw-sql:columnHeading="SALES" />
    <xsd:element name="C1" type="xsd:string" minOccurs="0" maxOccurs="1" saw-sql:type="varchar" saw-sql:displayFormula=""CUSTOMERS"."CITY"" saw-sql:aggregationRule="none" saw-sql:aggregationType="nonAgg" saw-sql:tableHeading="CUSTOMERS" saw-sql:columnHeading="CITY" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    - <R>
    *<C0>0.3</C0>*
    *<C1>WILLITS</C1>*
    </R>
    Edited by: user732932 on Jan 7, 2010 11:38 AM

    OR is there a way to pass the column headers from OBIEE to a URL? For example, session parameters can be passed using @{parmName}

  • How can I lookup text values in a column and display a list of corresponding names from another column?

    My spreadsheet looks like this:
                     Monday...
    Name 1      4PM
    Name 2      4PM
    Name 3      5PM
    Name 4      5PM
    Name 5      4PM
    I would like to create a spreadsheet that will display the values as follows:
    Openers (4PM)    Closers (5PM)
    Name 1                Name 3
    Name 2                Name 4
    Name 5
    Any help would be greatly appreciated. Thanks!

    Hi Shawn,
    I think this will do it for you:
    There's an auxiliary column in your data entry table. It counts the entries for each distinct time.
    The formula in the auxiliary column's body rows is:
    =COUNTIF(OFFSET(B$1, 0,0,ROW()), B)&"--"&B
    The formula in the Summary table's body rows is:
    =IFERROR(OFFSET(Schedule::$A$1, MATCH(ROW()-1&"--"&A$1, Schedule :: $C, 0)-1, 0), "")
    Regards,
    Jerry

  • Rename column name of a table

    Hi Guys,
    I want to rename the column name of a table. Lets say I have table employee:
    SQL> desc emp;
    Name Null? Type
    EMPNO NOT NULL NUMBER(4)
    ENAME VARCHAR2(10)
    JOB VARCHAR2(9)
    MGR NUMBER(4)
    HIREDATE DATE
    SAL NUMBER(7,2)
    COMM NUMBER(7,2)
    DEPTNO NUMBER(2)
    STARS VARCHAR2(8)
    I want to change the name of the cloumn name of ENAME to EMPNAME so that structure looks like this:
    SQL> desc emp;
    Name Null? Type
    EMPNO NOT NULL NUMBER(4)
    EMPNAME VARCHAR2(10)
    JOB VARCHAR2(9)
    MGR NUMBER(4)
    HIREDATE DATE
    SAL NUMBER(7,2)
    COMM NUMBER(7,2)
    DEPTNO NUMBER(2)
    STARS VARCHAR2(8)
    Can anyone tell me any statement or way to solve this problem. Please keep in mind that I will not delete the table or create another column name of EMPNAME and copy the data from ENAME to EMPNAME.
    Regds,
    Debabrata

    ALTER TABLE DEPT2 RENAME COLUMN ENAME TO EMPNAME
    Regards,
    Raj

  • Invalid Column Name on db link from 11.2.0.2 Oracle to 11.2.0.2 Gateway

    Hello, I am running the Oracle database 11.2.0.2 and using a database link accessing a sql server 2008 R1. The link is working fine, but a table has columns that are greater than 30 chars and Oracle db gateway cannot access this. Does anyone know of a fix or workaround?
    Thanks
    Jennifer L.

    As this is an Oracle database limitation you have to shrink the column name by for example creating a view on the SQL Server side defining aliases for each larger column name and then select from the view rather then from the table directly.
    See also MOS (=My Oracle Support) note: Replication From Sql Server To Oracle Database Failes With "Ora-00972: Identifier Is Too Long" (Doc ID 1322826.1)

  • Column names of a dynamic internal table

    Hi Friends,
    I have a dynamic internal table flowing in my ABAP program and I want to list down the column names of the this dynamic internal table.
    The declaration of this dynamic internal table :
       FIELD-SYMBOLS:
        <l_t_data>         TYPE STANDARD TABLE.
    Can you please tell me how to get the column names?
    Thanks,
    Gaurav

    Hi,
         You can use ABAP Runtime Type Identification to get the column names of the internal table.
    e.g >
    >lo_itab holds reference to description object of internal table whose column names i have to extract.
    >Using method describe_by_data of class cl_abap_typedescr export the field symbol assigned to the table and import the object reference into lo_itab.
    >Then using method get_table_line_type of lo_itab import line type description object reference into lo_line.
    >Check if lo_line is referring to a structure, if yes , downcast it to a object reference lo_struct of type cl_abap_structdescr.
    >The column description of all columns in the structure is stored in 'components' table of cl_abap_structdescr.
         So loop at the table to get all the column names stored in column 'name' of table 'components'.
    Thank You.

  • How to use variable in :old. variable instead of :old.column name.

    My requirement is to update the audit_update table with the old value and new value when an update statement gets executed. If i use :old.columnname the purpose is getting resolved.
    My requirement is to loop through the columns taken dynamically and update the audit_update_details table. The updation is taking place in a function that called.
    The first cursor holds the column name of a given table.
    I have to use a statement like :old.variablename . where the variable holds the column name .
    Is their an alternative?
    CREATE OR REPLACE TRIGGER INSERT_EMP1
    AFTER INSERT OR UPDATE OR DELETE
    ON EMP FOR EACH ROW
    declare
    v_seq number(5);
    v_result boolean;
    v_col_name varchar2(20);
    CURSOR FIRSTCURSOR IS
    select COLUMN_NAME from user_tab_columns where table_name like 'EMP';
    begin
    if inserting then
    INSERT INTO aud_details VALUES(seq_aud_log_id.nextval,'Emp','I','eno',:NEW.ENO);
    end if;
    if DELETING then
    INSERT INTO aud_details VALUES(seq_aud_log_id.nextval,'Emp','D','eno',:OLD.ENO);
    end if;
    IF UPDATING THEN
    INSERT INTO aud_details VALUES(seq_aud_log_id.nextval,'Emp','U','eno',:OLD.ENO);
    select seq_aud_log_id.currval into v_seq from dual;
    open FIRSTCURSOR;
    LOOP
    FETCH FIRSTCURSOR INTO v_col_name;
    EXIT WHEN FIRSTCURSOR%NOTFOUND;
    BEGIN
    -- How to make the code to work successfully.
    if (:old.v_col_name != :new.v_col_name) then
    v_result := insert_fn('emp',:old.eno, v_col_name , :old.v_col_name, :new.v_col_name, v_seq );
    end if;
    end;
    end loop;
    THe below is an example that uses the column name .Instead of column name i need to use the variable. So that the trigger functions for any given table.
    /* IF (:old.ename != :new.ename) THEN
    v_result := insert_fn('emp',:old.eno, 'ename' , :old.ename, :new.ename, v_seq );
    END IF;
    IF (:old.dno != :new.dno) THEN
    v_result := insert_fn('emp',:old.eno, 'dno' , :old.dno, :new.dno,v_seq );
    END IF;
    IF (:old.salary != :new.salary) THEN
    v_result := insert_fn('emp',:old.eno, 'salary' , :old.salary, :new.salary, v_seq );
    END IF;
    END IF;
    END INSERT_EMP1;
    thanks,
    vinodh

    As Solomon said, it's not possible, but you could write a procedure that would generate the code to do it for each individual column. You could then execute the code generator procedure any time the tables DDL changed in order to update the triggers code.

  • Please help me I am not seeing Database table column names in field explorer view

    Hi,
    I am developing a crystal report using eclipse and sql server. After creating connection, when i drag and drop tables, The table name and its columns should apper in field explorer view. Then we drag the columns onto crystal report. Unfortunately I am just  seeing only table names but not column names in field explorer view. Could anyone help me?
    After downloading eclipse I have plugged in the crystal report using the following instructions
    1. Click on the Help menu, and then Software Updates > Find and Install... to open the Install/Update wizard.
    2. Select Search for new features to install and click Next.
    3. Click the New Remote Site button. This will launch the New Update Site wizard
    4. Type the Business Objects Updsate Site for the Name field and the following for the URL: http://www.businessobjects.com/products/dev_zone/eclipse/
    5. Click OK to complete the wizard.
    6. Enable the newly created Business Objects Update Site checkbox as well as the Callisto Discovery Site (which should appear by default with Eclipse 3.2) and click Finish.
    Expand the Business Objects Update Site node and enable the Crystal Reports for Eclipse 1.0.0v555 checkbox.
    8. Expand the Callisto Discovery Site and click the button "Select Required". This will automatically select the required Eclipse features necessary to successfully install Crystal Reports for Eclipse.
    Thank You
    Rajavardhan Sarkapally

    Now we have a lot of views which select data from the tables, but I need to get the "Table Column Name" that is linked in the view.
    If you are using SQL Server 2012/2014, then you can use
    sys.dm_exec_describe_first_result_set (Transact-SQL) to gte the informations.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to get Tablename by using only Column Name in Schema?

    Hi,
    Here I need a small information. I am looking for the TableName based on Column Name.
    I know the Column name but not in which Table that Column belongs? So is there any way to look the Table Name by giving Column Name as an Input parameter in Oracle Schema.
    If anybody have the answer please help me out.I appriciate your help.
    Thanks,
    Srikanth Kondeti

    Srikanth,
    The three data dictionary views:
    <ol>
    <li>USER_TAB_COLUMNS</li>
    <li>ALL_TAB_COLUMNS</li>
    <li>DBA_TAB_COLUMNS</li>
    </ol>
    Contain both the column name and the table name (among other things).
    More information can be found in the Oracle documentation, in particular the Oracle Database Reference.
    All Oracle documentation can be accessed from here:
    http://www.oracle.com/technology/documentation/index.html
    Good Luck,
    Avi.

  • Case sensitive column name problem

    I have a strange problem in my application.
    I install the application on several machines with no problem but in one machine I'm getting an exceptions on:
    "Column 'SomeColumnName' does not belong to table"
    the code look like this:
    DataRow newDataRow = myTableFromDatabase.NewRow();
    newDataRow["SomeColumnName"] = dr["SomeColumnName"];
    when I change the code to upper case:
    DataRow newDataRow = myTableFromDatabase.NewRow();
    newDataRow["SOMECOLUMNNAME"] = dr["SOMECOLUMNNAME"];
    it works on the problematic machine.
    - I got the same problem on reading data from OracleDataReader.
    - The property DataTable.CaseSensitive was not changed (default = false).
    I'm not sure this is ODP problem or .net but I can't find any .net issues on that.

    Ok ,
    This is the most bizar bug that I ever saw:
    The problem was that the machine was running in turkey.
    In .NET culture settings the function ToUpper is not work on the letter 'i' when the region is turkey.
    That means that oracle ODP OracleDataReader is case sensitive on the column name - if the column name have the letter 'i'.

  • How to change the name of the column for dynamic query

    I would like to change the name of the column name to bidderone, biddertwo and bidderthree. the only problem is the vendors name unknown when I run the query and sometimes the query returns two vendors. the maximum vendor is three. here is the query and please let me know how this can be done. thank you so much. I am using oracle 10i
    FOR lv_rec IN   ( SELECT vendor, calcbtot
      FROM (SELECT t.*, ROW_NUMBER () OVER (ORDER BY t.calcbtot Asc) rn
              FROM (  SELECT DISTINCT
                             s.vendor,
                             TO_CHAR (s.calcbtot, '999,999,999.00') calcbtot
                        FROM bidtabs b, bidders s
                       WHERE     b.CALL = s.CALL
                             AND b.letting = s.letting
                             AND b.vendor = s.vendor
                             AND b.letting = v_letting
                             AND b.CALL = v_call
                    ORDER BY 2) t)
    WHERE rn <= 3 )                 
       LOOP
          lv_sql :=
                lv_sql  || ', TO_CHAR(MAX(DECODE(TRIM(S.VENDOR),'''|| TRIM (lv_rec.vendor) || ''', S.BIDPRICE)),  ''$999,999,999.00'') AS "'|| TRIM (lv_rec.vendor) ||'" ';
       END LOOP;

    thank you so so much for your help on this. I am sorry i did not post the entire code. my intention is to use bidderone, biddertwo,bidderthree as a column name insead of the name of the vendors and also calcuate the average of the three vendors. the maximum vendor will be three but the minumum could be one or two. hope this is enought information to help me out further . thank you
    CREATE OR REPLACE PROCEDURE biddersquoteforbridge (
       p_spnumber   IN       VARCHAR2,
       p_result     OUT      sys_refcursor
    IS
       v_letting   VARCHAR2 (40);
       v_call      VARCHAR2 (40);
       lv_sql      VARCHAR2 (32767) := NULL;
    BEGIN
       SELECT DISTINCT L.LETTING, CALL
                  INTO v_letting, v_call
                  FROM LETPROP L, PROPOSAL P
                 WHERE L.LCONTID = P.CONTID AND CPROJNUM= p_spnumber;
       lv_sql :=
          'SELECT   O.PRPITEM "Item Number",
                    INITCAP(FUNC_GET_ITEM_DESCRIPTION(O.PRPITEM)) "Description",
                    O.CONTID "Contract Id",O.SECTION "Section" , P.CPROJNUM "SP Number", P.CFACSSUP "District",
                    FUNCT_GET_SECTION_IDENTIFIER(O.SECTION, O.CONTID) "Section Title",  ''Q''||(TO_CHAR(D.DATELET, ''Q-YYYY'')) "Quarter",
                    O.IPLINENO "Line Number", O.QTY "Quantity" ';
      FOR lv_rec IN   ( SELECT vendor, calcbtot
      FROM (SELECT t.*, ROW_NUMBER () OVER (ORDER BY t.calcbtot Asc) rn
              FROM (  SELECT DISTINCT
                             s.vendor,
                             TO_CHAR (s.calcbtot, '999,999,999.00') calcbtot
                        FROM bidtabs b, bidders s
                       WHERE     b.CALL = s.CALL
                             AND b.letting = s.letting
                             AND b.vendor = s.vendor
                             AND b.letting = v_letting
                             AND b.CALL = v_call
                    ORDER BY 2) t)
    WHERE rn <= 3 )                 
       LOOP
          lv_sql :=
                lv_sql  || ', TO_CHAR(MAX(DECODE(TRIM(S.VENDOR),'''|| TRIM (lv_rec.vendor) || ''', S.BIDPRICE)),  ''$999,999,999.00'') AS "'|| TRIM (lv_rec.vendor) ||'" ';
       END LOOP;
       lv_sql :=
             lv_sql
          || '
            FROM   PROPITEM O  ,                   
                   PROPOSAL P  ,
                   LETPROP  L  ,
                   BIDDERS  B  ,
                   BIDTABS  S  ,
                   BIDLET   D
             WHERE O.CONTID = P.CONTID
                    AND P.CONTID = L.LCONTID
                    AND L.CALL = B.CALL
                    AND L.LETTING = B.LETTING
                    AND B.CALL = S.CALL             
                    AND B.LETTING = S.LETTING
                    AND B.VENDOR = S.VENDOR 
                    AND S.IPLINENO = O.IPLINENO
                    AND L.LETTING = D.LETTING             
                    AND O.LINEFLAG =''L''    
                    AND L.LETTING = :B1
                    AND L.CALL = :B2
             GROUP BY
                   O.CONTID,
                   O.SECTION,
                   O.IPLINENO,
                   O.PRPITEM,
                   O.QTY,
                   P.CPROJNUM,
                   P.CFACSSUP,
                   O.PRICE ,
                   D.DATELET             
             ORDER BY O.IPLINENO ';
      -- DBMS_OUTPUT.put_line (lv_sql);
       OPEN p_result FOR lv_sql USING v_letting, v_call;
    END;

Maybe you are looking for

  • Connect ipad to apple tv

    I want to simply connect my Ipad to my apple tv. How do I do it?

  • How to update values in ValueChangeEvent..

    Hi Everyone, I am using Jdeveloper 11.1.2.0.0. I have a scenario as follows. I have 2 input fields as Password and Confirmpassword. I wrote a ValueChangeListener for the field Password to do some validations and I wrote another ValueChangeListener fo

  • Open Document is not visible in F-53

    Hi All, We are not able to make vendor payment by using T-code F-53, getting a warning message saying There were no open item. When we checked in the vendor balance using FBL1N , there are many open items which are due for payments. Payment Terms : P

  • Problems with Photos and Fonts and Explorer

    I am having problems with photos and fonts when my site is viewed on Explorer. The site is Ostyn-Newman.com The problems can both be seen on the start page -though they happen throughout the site. The photo is supposed to be only 30% opaque and it sh

  • Picexport is not working with SCRIPT

    Hi ALL, I have upgraded my diadem from 2010 to 11 and now this is not working anymore: Call PicExport("X:\transfer\081022\"&SaveFile&"_scaled_tsr","WMF",1,768,1024,"",75,"",0) when I try this script i get a first the failure message ==> acsess violat