Issue in Column NAMES Printing in SQLPLUS

Hi All,
I am connecting to 2 databases through a 10.1.0.4.2 Version of SQLPLUS.
1st Database runs with - 10.2.0.4 Patchset
2nd Database runs with - 10.2.0.1.0 Patchset
From both the Databases we are running a long query with columns using Decode funtions. We are not able to see the column names completely in the 1st DB i.e 10.2.0.4 Patchset. Whereas in 2nd DB - Version 10.2.0.1.0 - Its working properly. I am not sure whether here DB version is the problem.
This is the query i am firing from both DB's. Here in the 1st column with decode function doesnt prints the column heading in SQLPLUS.
SELECT DECODE('ENG','ENG',A.PC_DESC,A.PC_DESC_BL)
FROM PCOM_CODES A, PCOM_CODES_APPL_CODES B
WHERE CAC_TYPE = 'VEH_CC_TYPE'
AND A.PC_TYPE = CAC_PC_TYPE_2
AND A.PC_CODE = B.CAC_PC_CODE_2
AND ROWNUM < =2
DECODE('ENG','ENG',A.PC_DESC,A.PC_DESC_BL) - This is the column name which doesnt prints properly in a 10.2.0.4.0 Database.
Is there any specific User specific or DB specific setting for such issues. We dont want to use any alias column names for specific purpose to be handled with that column name.
We have already tried out the following.
1) All SQLPLUS environment variables like SET SERVEROUT ON SIZE etc.
2) In the same PC where DB is installed.
3) Checked even if its a Data issue but really not.
4) We cannot set any alias column for this due to functional restrictions.
I appreciate a quick response from the forum users on this issue.
Thanks in advance.

check this out.
I still believe it is a formatting issue.
SQL> select decode(empno,7369,job||hiredate||sal||deptno,deptno) from emp;
/*Output */
DECODE(EMP
30
20
30
20
10
/* now*/
SQL> set line 1200;
SQL>  select decode(empno,7369,job||hiredate||sal||deptno,deptno) from emp;
DECODE(EMPNO,7369,JOB||HIREDATE||SAL||DEPTNO,DEPTNO)
CLERK17-DEC-8080020
30
30
20
30
30
10
20
10
30
20
try setting set line 1200 and then running that query.
Cheers!!!
Bhushan

Similar Messages

  • SQL Dev converts MS SQL to Oracle - issue with numeric prefix column name

    Hi,
    We're working on migrating MS SQL data into Oracle 10g. An issue we encountered is that some of MS SQL's tables have column names with numeric prefix like 1Q07, 2Q07, ..., 4Q08, and so on. The converted model as well as script can be created. But one thing I notice is that SQL Dev appends a prefix "A" for column names with numeric prefix. This makes sense because Oracle does not allow a column with number. But somehow this does not work with only 4Q
    1Q04 => A1Q01
    2Q07 => A2Q07
    3Q08 => A3Q08
    4Q08 => 4Q08 ???
    Why? Any place in the tool where I can override this?
    Obviously I can manually modify column name 4Q08 to A4Q08 in the script. But by doing this when moving data, it would fail because tool has no knowledge of updated column name.
    Thanks in advance.

    Hi ittichai,
    In <repository>.MIGRATION_TRANSFORMER body
    FUNCTION first_char_check(p_work NVARCHAR2) RETURN NVARCHAR2
    v_allowed := C_DISALLOWED_CHARS || '012356789_$';
    should be
    v_allowed := C_DISALLOWED_CHARS || '0123456789_$';
    If you make this change and convert the 4Q08 will be
    A4Q08 is expected, without any manual rename.
    -Turloch
    Message was edited by:
    Turloch O'Tierney

  • Invalid column name: syabase issue

    Hi
       I am trying to load data from sybase into temporary table. When i executing the job, it is giving the following error.
    3220     5728     DBS-070404     2/11/2008 8:07:26 AM     SQL submitted to ODBC data source <ppi-r_pp3_V1R00> resulted in error <[DataDirect][ODBC Sybase Wire Protocol driver][SQL
    3220     5728     DBS-070404     2/11/2008 8:07:26 AM     Server]Invalid column name 'State'.
    But there is a State column in the table.
    Can anybody help me how to reolve this issue?
    Thanks
    Venkat

    Problem is that the Source column name and Target column name are not same may be in Query transform name is differing.Chk it again

  • AIR 1.5.2 vs AIR 2.0 outer left join - column name issues

    Hi All,
    I was wondering if anyone has seen this or know a workaround to this issue.
    After a machine got updated to AIR 2.0 our apps started to fail. Upon further inspection I discovered that the column names in the return results from an SQLite query using "outer left join" were different between AIR 1.5.2 and AIR 2.0.
    Here's my proof of concept: (I attempted to make this as sort as possible but reproduce the issue)
    private function runTest():void{
                        var conn:SQLConnection = new SQLConnection();
                        var stmt:SQLStatement = new SQLStatement();
                        var res:Array = [];
                        stmt.text = "SELECT tableOne.int, tableAlias.varchar " +
                                  "from tableOne " +
                                  "outer left join (SELECT * FROM tableTwo) as tableAlias " +
                                  "on (tableOne.int == tableAlias.int)";
                        conn.open(File.applicationDirectory.resolvePath("tempdb.db"));
                        stmt.sqlConnection = conn;
                        stmt.execute();
                        conn.close();
                        res = stmt.getResult().data as Array
                        trace(ObjectUtil.toString(res));
    AIR 1.5.2 trace results:
    (Array)#0
      [0] (Object)#1
        tableAlias_varchar = "apple"
        tableOne_int = 0
      [1] (Object)#2
        tableAlias_varchar = "boat"
        tableOne_int = 1
      [2] (Object)#3
        tableAlias_varchar = "cat"
        tableOne_int = 2
    AIR 2.0 trace results:
    (Array)#0
      [0] (Object)#1
        int = 0
        varchar = "apple"
      [1] (Object)#2
        int = 1
        varchar = "boat"
      [2] (Object)#3
        int = 2
        varchar = "cat"

    I'm having an issue which I think is similar but the workaround does not work.
    Using a table like the one below:
    uid
    name
    parentuid
    1
    math
    2
    science
    3
    language arts
    4
    addition
    1
    5
    subtraction
    1
    6
    division
    1
    7
    multiplication
    1
    8
    geology
    2
    9
    physics
    2
    10
    biology
    2
    11
    phonics
    3
    12
    literature
    3
    13
    grammar
    3
    I execute the following query:
    SELECT child.uid, child.name, child.parentuid, parent.uid, parent.name, parent.parentuid
    FROM category AS parent, category AS child
    WHERE child.parentuid=parent.uid
    GROUP BY child.uid
    In AIR 1.5 I get:
    (Array)#0
      [0] (Object)#1
        child_name = "addition"
        child_parentuid = 1
        child_uid = 4
        parent_name = "math"
        parent_parentuid = (null)
        parent_uid = 1
      [1] (Object)#2
        child_name = "subtraction"
        child_parentuid = 1
        child_uid = 5
        parent_name = "math"
        parent_parentuid = (null)
        parent_uid = 1
      [2] (Object)#3
        child_name = "division"
        child_parentuid = 1
        child_uid = 6
        parent_name = "math"
        parent_parentuid = (null)
        parent_uid = 1
    But in 2.0 I get:
    (Array)#0
      [0] (Object)#1
        name = "math"
        parentuid = (null)
        uid = 1
      [1] (Object)#2
        name = "math"
        parentuid = (null)
        uid = 1
      [2] (Object)#3
        name = "math"
        parentuid = (null)
        uid = 1
    I can't think of any way to make this work in both versions.

  • Delete command in SQLPLUS by use wrong column name command

    Assume I have three table T1,T2 and T3 shown as follow...
    sql> desc T1 ;
    cusid number
    name varchar2(50)
    sql> select * from T1;
    cusid name
    1) 101 TEST1
    2) 102 TEST2
    3) 103 TEST3
    4) 104 TEST4
    sql>desc T2;
    ref_cusid number
    sql>select * from T2
    cusid
    1) 103
    if I want to delete account in T1 that deleted account is in T2.
    I must use query1 , it will work
    query1::>
    delete from T1 where cusid in (select ref_cusid from T2);
    but if i type wrong by this command
    query2::>
    delete from T1 where cusid in (select cusid from T2);
    in query 2,it should be have warning message because field cusid is not in T2.Right ? But it will delete all account in table T1.
    compare query2 with query 3,
    query3::>
    delete from T1 where cusid in (select field_test from T2);
    it will show warning message like 'ORA-00904: "FIELD_TEST": invalid identifier'
    I noticed that in query2 and query3 , Different Thing is query 2 wrong column name in T2 has same name as column in T1. I wonder why it is.

    I doubt very much if this is really what you did:
    sql>desc T2;
    ref_cusid number
    sql>select * from T2
    cusid
    1) 103The desc command shows a column name ref_cusid. The select command shows a column title cusid, not ref_cusid.
    You start by saying that you have 3 tables, without doing anything with T3. Are you sure you you haven't mixed up a copy and paste somewhere?

  • How to create list of a View's column names and source

    Using SQL 2005, 2008, and 2012
    How to create list of a View's column names and source. For the following example would like to @Print something like the following.  Does anyone already have some code to do this? I realize there are probably some gotchas, but the views that I am looking
    at to use this follows the code snippet pattern below.
    DBACCT.[Account Number]
    dbo.ConvertDate(DBACDT). [Boarding Date]
    DBXES.DBXES
    CREATE VIEW [dbo].[v_ods_DBAL]
    AS
    SELECT DBACCT AS [Account Number], dbo.ConvertDate(DBACDT) AS [Boarding Date], DBXES
    FROM dbo.ods_DBAL

    The column information can be obtained from INFORMATION_SCHEMA.COLUMNS view using logic like below
    SELECT c.COLUMN_NAME,c.DATA_TYPE
    FROM INFORMATION_SCHEMA.COLUMNS c
    WHERE EXISTS (SELECT 1
    FROM INFORMATION_SCHEMA.TABLES
    WHERE TABLE_NAME = c.TABLE_NAME
    AND TABLE_TYPE='VIEW')
    http://technet.microsoft.com/en-us/library/ms188348.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Duplicate column name when inserting a batch to biztalk

    I wonder why I get the following error:
    The adapter failed to transmit message going to send port "SEND_PORT_TESTORCHESTRATION_00010" with URL "oracledb://OracleServer/?PollingId=TEST_ORCHESTRATION_ORACLE_00010". It will be retransmitted after the retry interval specified for
    this Send Port. Details:"Microsoft.ServiceModel.Channels.Common.TargetSystemException: ORA-06550: line 2, column 290:
    PL/SQL: ORA-00957: duplicate column name
    ORA-06550: line 2, column 1:
    PL/SQL: SQL Statement ignored ---> Oracle.DataAccess.Client.OracleException: ORA-06550: line 2, column 290:
    PL/SQL: ORA-00957: duplicate column name
    ORA-06550: line 2, column 1:
    PL/SQL: SQL Statement ignored
       at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)
       at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, Boolean bCheck)
       at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
       at Microsoft.Adapters.OracleCommon.OracleCommonUtils.ExecuteNonQuery(OracleCommand command, OracleCommonExecutionHelper executionHelper)
       --- End of inner exception stack trace ---
    When I tried to pull a batch from sql server to insert to an oracle table. I have checked and none of the records were duplicate or had the same key. If I sent a batch of only 1 record, it went through fine and oracle database was updated.
    However, in either cases, no response from Oracle were received. I had a FILE port to save oracle response to file because the oracle port in the orchestration was 2 way (Send/Receive) port.
    Why was BizTalk not writing the response to file?
    Your hint/instruction to shed some light to this mystery is highly appreciated. Thanks!
    Note: When I tried to look the orchestration debugger, I saw the same message from sql being transmitted twice...why is BizTalk doing that?

    Hi BoatSeller,
    I think it may be something related to the map, I just do not know what. This is what I saw from the message part:
    <ns0:Insert xmlns:ns0="http://Microsoft.LobServices.OracleDB/2007/03/ORACLETABLE/Table/ROTATION_REQ">
    <ns0:RECORDSET>
    <ns0:ROTATION_REQRECORDINSERT>
    <ns0:RotationID>D4-2015-CO1</ns0:RotationID>
    <ns0:RotationID>D4-015-GL1</ns0:RotationID>
    <ns0:Year>2015</ns0:Year>
    <ns0:Year>2015</ns0:Year>
    <ns0:Class>D4</ns0:Class>
    <ns0:Class>D4</ns0:Class>
    <ns0:Rotation>CROSSOVER</ns0:Rotation>
    <ns0:Rotation>GOOCHLAND CLINIC</ns0:Rotation>
    <ns0:From>2014-08-06</ns0:From>
    <ns0:From>2014-05-20</ns0:From>
    <ns0:To>2015-03-05</ns0:To>
    <ns0:To>2015-03-05</ns0:To>
    <ns0:NumberOfConsecutiveSession>1</ns0:NumberOfConsecutiveSession>
    <ns0:NumberOfConsecutiveSession>1</ns0:NumberOfConsecutiveSession>
    <ns0:AmOrPM InlineValue="1"></ns0:AmOrPM>
    <ns0:AmOrPM InlineValue="2"></ns0:AmOrPM>
    <ns0:DayOfWeek>5</ns0:DayOfWeek>
    <ns0:DayOfWeek>4</ns0:DayOfWeek>
    </ns0:ROTATION_REQRECORDINSERT>
    </ns0:RECORDSET>
    </ns0:Insert>
    I thought that would be an issue because it looks like it was repeating the content, but if I understand you correctly, this is what the message content supposed to be? If not, what should I change in the map so that Oracle will get the following?
    <Record1> <field1>..</field1><field2>..</field2></Record1>
    <Record2> <field1>..</field1><field2>..</field2></Record2>
    This is the print screen of my orchestration debugger:
    If this is a problem, how should I fix this?
    And this is my mapping:
    Thanks,

  • SQLException: invalid column name

    I created a view on a Oracle 8.0.5 database which joins three tables. One column of the view is built by subtracting the values of two table-columns by each other. On SQLPlus everything works fine, but when I run a SELECT-Statement over JDBC I got a SQLException: invalid column name. With WHERE-Clauses, which will not have any results the query also works under JDBC.
    An example:
    "select * from OpenOrderPos where OrderID = <myval>" will work when run under SQLPlus
    but not under JDBC and when there should be results
    Here is my code:
    create View OpenOrderPos
    (OrderID, PosNo, ArticleID, ArticleBez, ArtPrice, RestQuantity, Sum)
    as
    select O.OrderID_FK, Count(A.PosNo), Art.ArticleID, Art.ArtDescr,
    Art.ArtPrice, O.Quantity - I.Quantity, (O.Quantity - I.Quantity) * Art.ArtPrice
    from OrderPos O, InvoicePos I, Article Art
    where O.OrderPosID = I.InvPosID and
    O.ArticleID_FK = Art.ArticleID and
    (O.Quantity - I.Quantity) > 0
    Group by O.OrderID_FK, Art.ArticleID, Art.ArtDescr, Art.ArtPrice, O.Quantity - I.Quantity, (O.Qunatity - I.Quantity) * Art.ArtPrice;
    Any ideas would be great!
    Chris

    I would also suggest you specify the column names in your SQL statement. If for no other reason than it is good programming practice. If you explicitly specify your columns instead of use * then you will not have to worry about an invalidated object should the view be changed at a later date. Considering the fact that JDBC makes all database statements dynamic, this is not an issue but once again, it is good programming practice.

  • Bcp queryout with column name in output

    DECLARE @cmd nvarchar(1000);
    SELECT @cmd = 'bcp "SELECT ObjectID,FeatureID,ParcelID,Card,ISNULL(Units,0) as Units,ISNULL(Bed,0) as Bed,ISNULL(Bath,0) as Bath,ISNULL(Half,0) as Half,TaxYear FROM pubtables.dbo.Tax_StructureApartment" queryout "\\WDC1GISSHP1\Scripts\DataManagement\DataMaintenance\SyncDataCatalog2SDE\CAMA.txt" -T -c';
    PRINT @cmd
    exec xp_cmdshell @cmd;
    I am extracting certain fields from a large table and using bcp to output to a file.  The code above works, but the output does not have the column name (i.e. header).  How would I go about doing that ?
    Thank you.

    you need to add a query based on catalog view information_schema.columns for that
    see this example
    http://sqlblogcasts.com/blogs/madhivanan/archive/2008/10/10/export-to-excel-with-column-names.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Reading MS Project column names and data on the fly from a selected View

    Hi guys,
    I have several views on my project file (MSPROJECT 2010) and I want to build a macro so that;
    1. User can select any view ( Views can have diffrent columns and the user may add new columns as well)
    2. User runs the Macro and all the coulmns along with the tasks displayed in the view will be written to a excel file. ( I don't want to build several macro's for each view, I'm thinking of a common method which would work for any selected view)
    The problem I'm facing is that how will i read the column names and data for a particular view on the fly without hard coding them inside the vba code ?
    The solution needs to work on a master schedule as well.
    Appreciate your feedback.

    Just to get you started the following code writes the field name and data for the active task to the Immediate window.
    Sub CopyData()
    Dim fld As TableField
    For Each fld In ActiveProject.TaskTables(ActiveProject.CurrentTable).TableFields
    If fld.Field >= 0 Then
    Debug.Print Application.FieldConstantToFieldName(fld.Field), ActiveCell.Task.GetField(fld.Field)
    End If
    Next fld
    End Sub
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • What is the order of Column Names in Sqlite query results?

    I am writing an application using Adobe Air, Sqlite, and Javascript.
    After writing the following select statement:
              SELECT field1, field 2, field 3, field 4 FROM TableA;
    I would like to get the columnName/data combination from each row -- which I do successfully with a loop:
              var columnName="";
              for (columnName in selResults.data[i]) {
                   output+=columnName + ":" + selResultsdata[i][columnName] + ";";
    My issue is that the column names come out in a different order every time I run the query and never once have they come out in the desired order -- field 1, field 2, field 3, field 4.  If I run the query in Firefox's Sqlite Manager, the columns come out in the "proper" order. When I run them in Adobe Air, the order will be the same if I run the query mulitple times without closing the app.  If I make a change such as declaring the columnName variable with "" before the for column, or declare it as (var = columnName in selResults.data) , then the order changes.  If I shut down my app and re-open after lunch and run query, it comes out in another order.  At this time, I'm not interested in the order of the rows, just the order of the columns in each output row.  I've even tried assiging an index to columnName which seems to just pick up a single letter of the columnName.
    I'm in the process of changing my HTML presentation of the data to assign a precise columnName to an HTML table title, but I'm reluctant to let go of the above concept as I think my separation of HTML/presentation and Javascript would be better if I could use the solution described above.
    So, does anybody know how to force the order of the columnNames in my output -- or what I'm doing to cause it to come out in a different order?
    Jeane

    Technically there isn't any "order" for the return columns. They aren't returned as an Array -- they're just properties on an Object instance (a "generic object"). The random order you're seeing is the behavior of the for..in loop iterating over the properties of the object. Unfortunately, with a for..in loop there is no guaranteed order for iterating over properties (and, as you've seen, it tends to vary wildly).
    The only solution is to create your own list of the column names and sort it the way you want to, then use that to create your output. For example, use the for..in loop to loop over the properties, but rather than actually get the values, just dump the column names into an Array:
    var columnName="";
    var columns = [];
    for (columnName in selResults.data[i]) {
        columns.push(columnName);
    columns = columns.sort(); // just uses the default alphabetical sort -- you would customize this if desired
    var j = 0;
    for (j = 0; j < columns.length; j++) {
        columnName = columns[j];
        output+=columnName + ":" + selResultsdata[i][columnName] + ";";

  • Need help on getting the column names of Tabletype

    I have a table Mapping with the following values: This Mapping table contains the table names (in Tabname) and the column names(colname) of various tables and values(ValuesTobeFilled) for the columns.
    I have to insert into the tables present in the Tabname field with the values present in the ValuesTobeFilled in the columns present in the Colname field.
    Note: The Mapping table need not contain all the columns of the base table. The columns that are not present can be filled with null. And this mapping table is not fixed i.e. rows can be inserted/deleted frequently.
    Sample values in mapping table:
    Tabname                        Colname        ValuesTobeFilled
    sample_items     Eno     Corresponding Expression to get the values from XML input
    sample_items     Ename     Corresponding Expression to get the values from XML input
    XXX     YYY     Corresponding Expression to get the values from XML input
    Before filling in the actual tables, I have to store the entire data temporarily and I have used a tabletype declared as follows:
    TYPE T_sample_items IS TABLE OF sample_items%ROWTYPE INDEX BY BINARY_INTEGER;
    l_sample_items T_sample_items;
    Where the table sample_items have the following columns:
    •     Eno
    •     Ename
    •     Eaddress
    •     Eemail
    So, the tabletype should be filled as:
    Eno     Ename     Eaddress     EEmail
    1     XXX     -     -
    I have declared a cursor to select the values from mapping table and I need to fill in the ValuesTobeFilled values to the corresponding table.
    CURSOR c_xpath (c_tname mapping.TABNAME%type)
    IS
    select * from mapping where tabname = c_tname;
    CURSOR c_tables
    IS
    SELECT DISTINCT TABNAME FROM mapping;
    FOR crsr IN c_tables
    LOOP
    p_tname := CRSR.TABNAME;
    FOR csr IN c_xpath(p_tname)
    LOOP
    IF l_xml_doc.EXISTSNODE(CSR.XPATH_EXP) = 1
    THEN
    l_node_value := l_xml_doc.extract(CSR.XPATH_EXP).getStringVal(); -- This is the value to be stored in the corresponding column
    ELSE
         l_node_value := NULL;
    END IF;
    IF CSR.COLUMN_NAME = ‘eno’
    THEN
         l_sample_items(1).eno := l_node_value;
    ELSIF CSR.COLUMN_NAME = ‘ename’
    THEN
         l_sample_items(1).name := l_node_value;
    END IF;
    END LOOP;
    END LOOP;      
    And I need to eliminate hard coding while comparing the column names (in the following piece of code) as the Mapping table values are subject to insertion/deletion:
    IF CSR.COLUMN_NAME = ‘eno’
    THEN
         l_sample_items(1).eno := l_node_value;
    ELSIF CSR.COLUMN_NAME = ‘ename’
    THEN
         l_sample_items(1).ename := l_node_value;
    END IF;
    I need to insert the values directly into the tabletype without this hardcoding. Please suggest me ways to compare the mapping table values with the field (column) names of the tabletype. If it is not possible using tabletype, please suggest any other ways of fixing the problem.
    Many thanks,
    Gopi

    I take it this isn't going to be a serious production system at the end of the day?
    Storing metadata in tables for extraction and insertion of data is just wrong in so many ways. It smells heavily of Entity Attribute Value modelling, which is the most wrong way to use a relational database and is known to have major performance implications and be liable to bugs and issues. The idea that EAV modelling allows for 'generic' databases where new data items can be added flexibly later on without having to change code is usually justified with an excuse of "it means we don't have to update all our tables when we want a new column" which is easily countered with "if you're adding a single column a good relational design wouldn't require you to add it to more than one table anyway in most cases".
    Just what exactly are you trying to do and why? There has to be a better way.

  • Renaming Column Names in a single shot in Requests

    Hi All,
    We are having one issue while trying to rename the column in the requests.
    Requirement:
    We are having two presentation table "Fact Summary" and "Countries Dimension". Both of these tables contain one column "Country Description".
    Presently in all the reports we have developed till now, we used "Fact Summary"."Country Description".
    Now the users want us to replace "Fact Summary"."Country Description" with "Countries Dimension"."Country Description" and delete the "Country Description" from "Fact Summary" table.
    Approach we followed:
    Opened the Catalog Manager in Offline mode and used the XML Search and Replace option.
    With this option we are able to replace column names that are selected in a request but not those just used as filters(is prompted).
    Example:
    Suppose we have one request with "States Dimension"."State" seleted and "Fact Summary"."Country Description" as filter, we are able to not able to replace "Fact Summary"."Country Description" with "Countries Dimension"."Country Description"
    Can anyone please help me...Is there any alternative solution for this?
    Thanks in Advance.....

    Nope, I don't have a solution for this. You must never model descriptive columns in a fact table. Even when you have descriptive columns or textual content in one of your fact table columns, you should model them as part of a logical dimension table. Let this be a good lesson.
    Regards,
    Stijn

  • Need to know the column names in my dynamic select clause

    Dear All,
    Please go through the following code. While executing the following code i am getting an error saying that dbms_sql.describe_columns overflow, col_name_len=35. Use describe_columns2.
    Please guide me how to proceed further. Or please help me, how can i get the column names when i issue a dynamic select clause.
    DECLARE
    CUR INTEGER;
    COL_CNT INTEGER ;
    A INTEGER;
    SEL_CLAUSE VARCHAR2(2000);
    DESC_T DBMS_SQL.DESC_TAB;
    REC DBMS_SQL.DESC_REC;
    b number;
    BEGIN
    SEL_CLAUSE := 'SELECT 1,2,DECODE(1,1,''ONE'',2,''TWO'',3,''THREE'') FROM DUAL';
    --'SELECT ROWID,PARA_SUB_CODE,DECODE('||''''||'ENG'||''''||','||''''||'ENG'||''''||',PARA_NAME,PARA_BL_NAME),NULL,NULL FROM PCOM_APP_PARAMETER';
    --'SELECT 1,2,DECODE(1,1,''ONE'',2,''TWO'') FROM DUAL';
    DBMS_OUTPUT.PUT_LINE( SEL_CLAUSE );
    CUR := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(CUR,SEL_CLAUSE,DBMS_SQL.NATIVE);
    DBMS_SQL.DESCRIBE_COLUMNS(CUR,COL_CNT,DESC_T);
    B := desc_t.first;
    FOR J IN 1..COL_CNT
    LOOP
    DBMS_OUTPUT.PUT_LINE('J := '||J || ' COL CNT ' || COL_CNT);
    END LOOP;
    BEGIN
    A := DBMS_SQL.EXECUTE(CUR);
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    END;
    Regards,
    Balaji

    Is there any way can i have it directly??It does not work with static SQL either. Dynamic SQL is no different.
    SQL> select 1 x from dual where x = 1 ;
    select 1 x from dual where x = 1
    ERROR at line 1:
    ORA-00904: "X": invalid identifier
    SQL>As suggested already, you will need to use alias if you want your select expression to be referred in the where clause.
    SQL> BEGIN
      2      FOR rec IN (SELECT *
      3                  FROM   (SELECT 1,
      4                                 2,
      5                                 DECODE(1, 1, 'ONE', 2, 'TWO', 3, 'THREE') "DECODE(1, 1, 'ONE', 2, 'TWO', "
      6                          FROM   DUAL)
      7                  WHERE  "DECODE(1, 1, 'ONE', 2, 'TWO', " = 'ONE')
      8      LOOP
      9          NULL;
    10      END LOOP;
    11  END;
    12  /
    PL/SQL procedure successfully completed.
    SQL>Message was edited by:
    Kamal Kishore

  • How to get table and column names thats being used in SQL , that's generating all my reports on SSRS.

    Good day,
    I searched through the forum and cant find anything.
    I have around 300 published reports on SSRS and we are busy migrating to a new system.
    They have already setup their tables on the new system and I need to provide them with a list of table names and column names that are being used currently to generate the 300 reports on SSRS.
    We use various tables and databases to generate these reports, and will take me forever to go through each query to get this info.
    Is it at all possible to write a query in SQL 2008 that will give me all the table names and columns being used?
    Your assistance is greatly appreciated.
    I thank you.
    Andre.

    There's no straightforward method for that I guess. There are couple of things you can use to get these details
    1. query the ReportServer.dbo.Catalog table
    for getting details
    you may use script below for that
    http://gallery.technet.microsoft.com/scriptcenter/42440a6b-c5b1-4acc-9632-d608d1c40a5c
    2. Another method is to run the reports and run sql profiler trace on background to retrieve queries used.
    But in some of these cases the report might be using a procedure and you will get only procedure. Then its upto you to get the other details from procedure like tables used, columns etc
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • GE60 2PE Don't boot to BIOS, notebook bricked.

    Hello, Yesterday night I was watching a youtube show on my netbook, running without power supply only with the battery (I only done this for 3 times in 7 months so I'm not worried about battery being discharged) and I fall sleep. This morning when I

  • Bluetooth connection with Lexus and Storm 9530

    Been trying to connect the bluetooth in the lexus with the storm.  it connects, then drops the connection.  it does not connect when you turn the ignition on, as it did with Motorola V710....not the car's issue, seems like the phone needs something c

  • Problem in Form builder when calling layout tabstrip

    Hello @all, The last days all work great, but since today when i call the layout tabstrip in transaction. There comes the error message popup : Adobe LiveCycle Designer ES has encountered a problem and needs to close.  We are sorry for the inconvenie

  • BAPI_ACC_PURCHASE_ORDER_POST

    Hi All, Can Any one send me sample code for posting the purchase orders using BAPI_ACC_PURCHASE_ORDER_CHECK and BAPI_ACC_PURCHASE_ORDER_POST. Basically I need the information about the tables parameters and and what fields are to be filled in the pro

  • Music stream not playing

    On WinXP Pro, I successfully use the site listed below. However on OS X using Firefox I cannot hear the music on this site. I select the Play All from within this page, a popup is displayed as normal but no music. Again, this works in WinXP. For the