Query to return column name of first NULL column?
I have a table with 40 columns but only the first n have non-null values. Is there a way to pull the name of the first non-null column? I have tried using CASE but I run into nesting too deeply problems (apparently you can only nest to 10 levels).
Thank you.
Kevin
Kevin Burton
Or, you could try something like this:
-- This is just for testing
DROP TABLE #test
CREATE TABLE #Test
(ID INTEGER
,n1 INTEGER
,n2 INTEGER
,n3 INTEGER
,n4 INTEGER
,n5 INTEGER
,n6 INTEGER
,n7 INTEGER
,n8 INTEGER
,n9 INTEGER
INSERT INTO #Test
VALUES (1,256,365,4000,0,NULL,NULL,NULL,NULL,NULL)
SELECT *
FROM #Test
-- THIS IS THE IMPORTANT PIECE
SELECT ISNULL(LEN(LEFT(n1,1)),0)
+ ISNULL(LEN(LEFT(n2,1)),0)
+ ISNULL(LEN(LEFT(n3,1)),0)
+ ISNULL(LEN(LEFT(n4,1)),0)
+ ISNULL(LEN(LEFT(n5,1)),0)
+ ISNULL(LEN(LEFT(n6,1)),0)
+ ISNULL(LEN(LEFT(n7,1)),0)
+ ISNULL(LEN(LEFT(n8,1)),0)
+ ISNULL(LEN(LEFT(n9,1)),0)
FROM #Test
The LEFT(x,1) will always either give you a LEN of 1, or a NULL. Add 'em up. Try it.
Then use the Ordinal_Position from the Information Schema to get the name of the column (if that is what you need)
Duncan Davenport
Similar Messages
-
No Column Name Was Specified for Column 1 of 'ShipFromStoreXML'
I get the error:
Msg 8155, Level 16, State 2, Line 16
No column name was specified for column 1 of 'ShipFromStoreXML'.
My SQL is as follows:
SELECT * FROM (
SELECT [StoreInventoryID] AS A
,[StoreID]
,[ProductID] AS B
,[QtyOnHand]
,[QtyDefective]
,[QtyTradeHold]
,[ModifiedDate]
,[CreatedDate]
,[QtyReservationHold]
,[QtyHopsHold]
,[QtyTradeHoldDefective]
FROM [StoreInformation].[dbo].[StoreInventory]
WHERE StoreID = 8127
FOR XML PATH('Item'),ROOT('ShipNode'))
AS ShipFromStoreXML
Ryan P. Casey • <a href="http://www.R-P-C-Group.com">www.R-P-C-Group.com</a>You just have to give the column an alias
SELECT * FROM (
SELECT [StoreInventoryID] AS A
,[StoreID]
,[ProductID] AS B
,[QtyOnHand]
,[QtyDefective]
,[QtyTradeHold]
,[ModifiedDate]
,[CreatedDate]
,[QtyReservationHold]
,[QtyHopsHold]
,[QtyTradeHoldDefective]
FROM [StoreInformation].[dbo].[StoreInventory]
WHERE StoreID = 8127
FOR XML PATH('Item'),ROOT('ShipNode')
AS ShipFromStoreXML(x)
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 -
Dynamically Pass the Column Name cursor. || Dynamic Column Name
Hi,
I need to dynamically pass the column name based on a Mapping table in a loop ( Right now i have hardcoded stuff )just like using Execute immediate.... Inside the procedure, I have commented as where i hit the problem.
Thanks for all of your time...
Thanks
Muthu
CREATE OR REPLACE PROCEDURE xml_testing_clob AS
doc xmldom.DOMDocument;
main_node xmldom.DOMNode;
root_node xmldom.DOMNode;
user_node xmldom.DOMNode; item_node xmldom.DOMNode;
root_elmt xmldom.DOMElement;
item_elmt xmldom.DOMElement;
item_text xmldom.DOMText;
item_test xmldom.DOMText;
nodelist xmldom.DOMNodeList;
sub_variable varchar2(4000);
x varchar2(200);
y varchar2(200);
sub_var varchar2(4000);
CURSOR get_users IS
SELECT FIRST_NAME,LAST_NAME,ROWNUM FROM USER_INFO_TBL WHERE WEIN_NUMBER = '1234' ;
CURSOR get_cdisc_name IS
select CTS_COL_NAME,CDISC_NAME from CTS2CDISC_DICTIONARY where CTS_TABLE_NAME = 'USER_INFO_TBL';
BEGIN
-- get document
doc := xmldom.newDOMDocument;
doc := xmldom.NewDomDocument;
xmldom.setVersion(doc, '1.0');
xmldom.setStandalone(doc, 'no');
xmldom.setCharSet(doc, 'ISO-8859-1');
-- create root element main_node := xmldom.makeNode(doc);
root_elmt := xmldom.createElement(doc,'AdminData');
root_node := xmldom.appendChild(main_node,xmldom.makeNode(root_elmt));
FOR get_users_rec IN get_users LOOP
item_elmt := xmldom.createElement(doc,'User');
xmldom.setAttribute(item_elmt,'OID' , get_users_rec.rownum);
user_node := xmldom.appendChild(root_node,xmldom.makeNode(item_elmt));
FOR cv_get_cdisc_name IN get_cdisc_name LOOP
EXIT WHEN get_cdisc_name%NOTFOUND;
sub_var := cv_get_cdisc_name.cts_col_name;
sub_variable := 'get_users_rec.';
sub_variable := 'get_users_rec.'||cv_get_cdisc_name.cts_col_name;
x := sub_variable;
dbms_output.put_line(x); -------------- Here i just see the literal string
y := get_users_rec.FIRST_NAME;
dbms_output.put_line(y); -------------- Here i just see actual value ( data )
item_elmt := xmldom.createElement(doc,cv_get_cdisc_name.cdisc_name);
item_node := xmldom.appendChild(user_node,xmldom.makeNode(item_elmt));
item_text := xmldom.createTextNode(doc,x ); ---- This is the place i am hitting with an error .
If i use variable X then i am able to see only the literal
string in the output. BUT if i put cursor name.coulmname,
then the resumt (XML) is fine.I wanted acheive this
dynamically just like execute Immediate
item_node := xmldom.appendChild( item_node , xmldom.makeNode(item_text));
END LOOP;
END LOOP;
-- write document to file using default character set from database
xmldom.WRITETOCLOB(doc,);
xmldom.writeToFile(doc, 'c:\ash\testing_out.xml');
-- free resources
xmldom.freeDocument(doc);
END;
+++++++++++++++++++++++++++++++++++ XML OUTPUT +++++++++++++++++++++++++++++++++++++++++
<?xml version="1.0" ?>
- <AdminData>
- <User OID="1">
<FirstName>get_users_rec.FIRST_NAME</FirstName>
<LastName>get_users_rec.LAST_NAME</LastName> </User>
- <User OID="2">
<FirstName>get_users_rec.FIRST_NAME</FirstName>
<LastName>get_users_rec.LAST_NAME</LastName>
</User>
- <User OID="3">
<FirstName>get_users_rec.FIRST_NAME</FirstName>
<LastName>get_users_rec.LAST_NAME</LastName>
</User>
- <User OID="4">
<FirstName>get_users_rec.FIRST_NAME</FirstName>
<LastName>get_users_rec.LAST_NAME</LastName>
</User>
- <User OID="5">
<FirstName>get_users_rec.FIRST_NAME</FirstName>
<LastName>get_users_rec.LAST_NAME</LastName>
</User>
++++++++++++++++++++++++++++++++++++++++++++++++++++ MAPPING TABLE DETAILS +++++++++++++++++
CTS_COL_NAME CDISC_NAME CTS_TABLE_NAME XML_TAG -----------> Column Name
FIRST_NAME FirstName USER_INFO_TBL Element -----------> Records
LAST_NAME LastName USER_INFO_TBL Element -----------> RecordsMy scenario is little different, let me explain:
My columns will remain same but values changes (based on column formula) according to the selected prompt value
If I select 'Oct' from prompt then
Curr will contain data for 'Oct' only
Next1 will contain data for 'Nov' only
Next2 will contain data for 'Dec' only
Next3 will contain data for 'Jan' of next year only.
Later if I select 'Jul' from prompt then
Curr will contain data for 'Jul' only
Next1 will contain data for 'Aug' only
Next2 will contain data for 'Sep' only
Next3 will contain data for 'Oct' only.
I don't have different columns for each months but the columns are capable to reflect data for any month.
So, how can I reflect the column name as month name for which that contains data.
Regards,
S Anand -
Need to know base table and base column name for Oracle view columns
I am trying to load metadata for some views and that requires me to know what the final table and column name would be corresponding to the view column.
For example, if I have a view x_v that is select a,b from x_v2; and x_v2 is a view that is select a,b,c from x;
I need to get the following information.
View View Col Base Table Base Col
X_V A X A
X_V B X B
and so on.
Is it possible to get this programmatically using any SYS schema tables or Dependency tables?
I tried an indirect approach wherein I lock tables using LOCK TABLE or FOR UPDATE OF. But I'm not too sure if I can go down to the level of individual view columns.
Can you help me with this?Thanks. I was looking at some indirect approaches.
I came up with this script that does it faster than dependencies but thats just for tables and not column mapping.
declare
cursor bt(cp_sid number) is
select u.name uname, o.name oname
from sys.obj$ o, sys.user$ u
where o.obj# in (select id1
from v$lock
where sid=cp_sid)
and u.user# =o.owner#;
cursor c_sid is
select sid
from v$session
where audsid =userenv('sessionid');
l_sid number;
l_view varchar2(100):= 'PER_PEOPLE_V';
l_schema varchar2(10):= 'APPS';
begin
open c_sid;
fetch c_sid into l_sid;
close c_sid;
dbms_output.put_line('SID: '||l_sid);
execute immediate 'lock table '||l_schema||'.'||l_view||' in row share mode nowait';
for i in bt(l_sid) loop
dbms_output.put_line(i.uname||'.'||i.oname);
execute immediate 'alter table '||i.uname||'.'||i.oname||' disable table lock';
execute immediate 'alter table '||i.uname||'.'||i.oname||' enable table lock';
end loop;
end;
It basically uses locks on views to verify locks on the base tables.
Just wondering, can we use FOR UPDATE OF statements to get to the columns? -
Trouble changing column name used in calculated column
I have a calculated column in my list. The calculation is based on a column "Status". It worked fine. But I recently had to do some work on the Status column and changed it to Status_OLD and replaced it with a new Status column.
The above mentioned calculated field is now using Status_OLD and thus not working because Status_OLD is no longer in use. I went in the to calculation formula and tried to change it to Status, but Status does not appear in the Insert Column list, nor
does it allow me to just type in Status into the formula without throwing an error. Short of deleting the column and re-creating it, is there something I'm doing wrong or overlooking?
There are no mistakes; every result tells you something of value about what you are trying to accomplish.Finally getting back to this issue. I have two columns in my list "Status" and "Status_OLD". "status" is a replacement for the previous one. I have three calculated fields that use that field. I need to change
their calculation to now use "Status" instead of "Status_OLD". When I go to the settings for that column, "status" is not listed in the choice of columns that can be inserted. Just typing it in won't work either.
When I try to make a new cal as a test, "Status" isn't available there either.
I really need to get this fixed as soon as possible now because some of these dates need to be acted upon.
There are no mistakes; every result tells you something of value about what you are trying to accomplish. -
How to rename a column name in a table? Thanks first!
I tried to drop a column age from table student by writing the
following in the sql plus environment as :
SQL> alter table student drop column age ;
but I found the following error
ORA-00905: 缺少关键字 (Lack of Key word)
I have oracle enterprise edition 8.0.5 installed at windows 2000
thank you
And I want to know how to rename a column name in a table?
thanksIn Oracle 8i, your syntax would have worked. However, if I
recall correctly, in Oracle 8.0, you can't rename or drop a
column directly. One way to get around that problem is to
create another table based on a select statement from your
original table, providing the new column name as an alias if you
want to change the column name, or omitting that column from the
select statement if you just want to drop it. Then drop the
original table. Then re-create the original table based on a
select statement from the other table. Then you can drop the
other table. Here is an example:
CREATE TABLE temporary_table_name
AS
SELECT age AS new_column_name,
other_columns
FROM student
DROP TABLE student
CREATE TABLE student
AS
SELECT *
FROM temporary_table_name
DROP TABLE temporary_table_name
Something that you need to consider before doing this is
dependencies. You need to make a list of all your dependecies
before you do this, so that you can re-create them afterwards.
If there are a lot of them, it might be worthwhile to do
something else, like creating a view with an alias for the
column or just providing an alias in a select. It depends on
what you need the different column name for. -
Problem in displaying row vale as column name
Hello Experts,
Please help me,its very urgent....
i want to dispaly a column value as a column name.
i have two column into selete statement and i want to dispaly one column value as a column name and other column value as a single row.
My query is :
SELECT MAX(DECODE (NAME,'virtualDeviceId',VALUE))vdid ,
MAX(DECODE (NAME,'virtualDeviceType',VALUE)) vdevtype,
MAX(DECODE (NAME,'domainName',VALUE)) vdevtype1,
MAX(DECODE (NAME,'sCTPPortSip',VALUE)) vdevtype2,
MAX(DECODE (NAME,'signallingIpAddress',VALUE)) vdevtype,
MAX(DECODE (NAME,'signallingNetworkMask',VALUE)) vdevtype,
MAX(DECODE (NAME,'uDPPort',VALUE)) vdevtype,
MAX(DECODE (NAME,'uDPPortEnum',VALUE)) vdevtype,
MAX(DECODE (NAME,'sCTPPort',VALUE)) vdevtype,
MAX(DECODE (NAME,'sCTPPortM3UA',VALUE)) vdevtype FROM(
SELECT extractvalue(VALUE(l),'/S109:trafficParameters/S109:name'
, 'xmlns="http://itprogrammes.intra.bt.com/pdb/capabilities/ManageDaaliResource/2005/11/16" xmlns:header="http://wsi.nat.bt.com/2005/06/StandardHeader/" xmlns:S97="http://ccm.intra.bt.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services" xmlns:S109="http://ccm.intra.bt.com/2005/11/16/LIB/Info/MTOSI"') NAME,
extractvalue(VALUE(l),'/S109:trafficParameters/S109:value'
, 'xmlns="http://itprogrammes.intra.bt.com/pdb/capabilities/ManageDaaliResource/2005/11/16" xmlns:header="http://wsi.nat.bt.com/2005/06/StandardHeader/" xmlns:S97="http://ccm.intra.bt.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services" xmlns:S109="http://ccm.intra.bt.com/2005/11/16/LIB/Info/MTOSI"') VALUE
FROM INTERFACE_MESSAGE_DESTINATION imd ,TABLE(xmlsequence(EXTRACT(XMLTYPE(imd.remote_request),'/activateConnection_Payload/jobBody/subnetworkConnection/S109:aEndTerminationPoint/S109:managedElement/S109:physicalTerminationPoint/S109:connectionTerminationPoint/S109:trafficDescriptor/*'
, 'xmlns="http://itprogrammes.intra.bt.com/pdb/capabilities/ManageDaaliResource/2005/11/16" xmlns:header="http://wsi.nat.bt.com/2005/06/StandardHeader/" xmlns:S97="http://ccm.intra.bt.com/2005/11/16/LIB/Info/CCM/AnalysisModel/Services" xmlns:S109="http://ccm.intra.bt.com/2005/11/16/LIB/Info/MTOSI"'))) l
WHERE message_id ='NIAS/0000041608') GROUP BY VALUE ;
output is :
Col1 Col2 col3 col4 col5 col
1.'1001105' '1001105'
2. 'MGC'
3.'value' 'value' 'value'
output display : MGC in Col2 and in row 2, 'values' are in col4 and col5 and in row 3.
I want all values in a single row.
Please help me
Surender RanaIt is ugly to force multiple rows into a single row. But it can be done and can be done dynamically as the following approach shows.
SQL> create or replace type TStrings as table of varchar2(4000);
2 /
Type created.
SQL>
SQL> create or replace function ForceColumns( cur SYS_REFCURSOR ) return TStrings is
2 setCols TStrings;
3 setResults TSTrings;
4 begin
5 setResults := new TStrings();
6 loop
7 fetch cur into setCols;
8 exit when cur%NOTFOUND;
9
10 if setCols.Count > 0 then
11 setResults.Extend( setCols.Count );
12 for i in 1..setCols.Count
13 loop
14 setResults( setResults.Count-i+1 ) := setCols(i);
15 end loop;
16 end if;
17 end loop;
18
19 return(setResults);
20 end;
21 /
Function created.
SQL>
SQL> select
2 ForceColumns(
3 CURSOR(
4 select TStrings(object_id,object_name,object_type) from user_objects where rownum <= 5
5 )
6 ) as RESULT_SET
7 from dual
8 /
RESULT_SET
TSTRINGS('TABLE', 'A', '70998',
'PROCEDURE', 'ABC', '54360',
'TABLE', 'ANIMALS', '84829',
'TABLE', 'B', '69604',
'PROCEDURE', 'BUILDNAMEMAP', '70155')
SQL>Note that as the row can contain any number of columns, it needs to be dynamic. This approach uses a collection type called TStrings to achieve this. -
Dynamic Column Names using Refcursors
Hi,
I have a stored procedure which returns a refcursor. The refcursor contains a SQL query in which the column names and number of columns vary dynamically based on the date parameters passed.
"My objective is to return certain XYZ details of employees for a certain month range."
For ex: For the month of Aug-2011, the column names would be '1-AUG-11' to '31-AUG-11 and for Feb-2011 '1-FEB-11' to '28-FEB-11'
My issue is, when I execute the refcursor query using "EXEC", my column names/headings are preserved.
FIELD NAMES: EMPLOYEE_CODE XYZ_TYPE *1-AUG-11* *2-AUG-11* ... *31-AUG-11*
DATA: EMPCODE_Z TYPE1 VALUE_1 VALUE_1 ... VALUE_31
Whereas when I fetch the refcursor into a collection of nested table and display, my column names are lost.
DATA: EMPCODE_Z TYPE1 VALUE_1 VALUE_1 ... VALUE_31
Is there a way where I can preserve the column names from the refcursor after fetching into pl/sql collections?
Any help would be highly appreciated.
Thank you.
Edited by: 867622 on Nov 11, 2011 4:38 PM867622 wrote:
If not dynamic SQL, how can the number of columns be altered based on the input parameters?Cannot. A dynamic SQL projection means dynamic SQL (there's an exception to this, and despite interesting is not relevant to 99.99% of problems dealing with dynamic SQL projections).
You can however still use a dynamic projection and wrap that into a user defined type interface.
Here's the basic approach:
// create a user define type that will provide the wrapper for the SQL projection
create or replace type TString as table of varchar2(4000);
// build dynamic SQL projections via this type, e.g.
select
TStrings( object_id, object_name, created )
from user_objects
select
TStrings( emp_id, dept_id, salary, commission )
from employeesDespite the SQL cursors being different and the columns and number of columns being selected different, the SQL projection of both are the same. The Count method tells you the number of columns in the projection. Referencing an applicable column is simply done by using the column's sequential number in the projection.
You also do not have to use a collection or varchar2 as the wrapper type - you can create complex user objects and use the collection type for that, as the SQL projection.
Another alternative is converting the ref cursor into a DBMS_SQL cursor and using the latter's describe interface to dynamically determine the structure of the SQL projection and fetching the column values from it. But 11gr1 or later is needed for doing this. -
How To Create Table View With Same Column name But Different Table?
Hi All,
I have the problem to create a tableview with same column name but in different table.
The Table that i have:-
Table - PAC051MPROFORMA
Column - mrn,visitid
Table - PAC051TPROFORMA
Column - mrn,visitid
Table - PAC052MTRANSBILL
Column - mrn,visitid
Then i want to create a table view to view that table. This is my SQL
CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
As Select PAC051MPROFORMA.mrn,PAC051MPROFORMA.visitid,PAC051TPROFORMA.mrn,PAC051TPROFORMA.visitid,PAC052MTRANSBILL.mrn,PAC052MTRANSBILL.visitid
where
*(a.PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)*
and
*(a.PAC051TPROFORMA.mrn=PAC052TRANSBILL.mrn)*
That SQL Return this error = ORA-00957: duplicate column name
Then I modify that SQL to
CREATE VIEW pacviewproforma (mrn,visitid)
As Select PAC051MPROFORMA.mrn,PAC051MPROFORMA.visitid,PAC051TPROFORMA.mrn,PAC051TPROFORMA.visitid,PAC052MTRANSBILL.mrn,PAC052MTRANSBILL.visitid
where
*(a.PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)*
and
*(a.PAC051TPROFORMA.mrn=PAC052TRANSBILL.mrn)*
This time this error return = ORA-01730: invalid number of column names specified
What should i do?
Thanks...Hi,
SQL> CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
2 As Select
3 PAC051MPROFORMA.mrn,
4 PAC051MPROFORMA.visitid,
5 PAC051TPROFORMA.mrn,
6 PAC051TPROFORMA.visitid,
7 PAC052MTRANSBILL.mrn,
8 PAC052MTRANSBILL.visitid
9 from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
10 where
11 (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
12 and
13 (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
ERROR at line 1:
ORA-00957: duplicate column namePlease give different names to each column.
Something like this..
SQL> CREATE OR REPLACE VIEW pacviewproforma (MPROFORMA_mrn,MPROFORMA_visitid,TPROFORMA_mrn,TPROFORMA
_visitid,MTRANSBILL_mrn,MTRANSBILL_visitid)
2 As Select
3 PAC051MPROFORMA.mrn,
4 PAC051MPROFORMA.visitid,
5 PAC051TPROFORMA.mrn,
6 PAC051TPROFORMA.visitid,
7 PAC052MTRANSBILL.mrn,
8 PAC052MTRANSBILL.visitid
9 from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
10 where
11 (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
12 and
13 (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
View created.
SQL> DESC pacviewproforma;
Name Null? Type
MPROFORMA_MRN NUMBER
MPROFORMA_VISITID NUMBER
TPROFORMA_MRN NUMBER
TPROFORMA_VISITID NUMBER
MTRANSBILL_MRN NUMBER
MTRANSBILL_VISITID NUMBER
ORA-01730: invalid number of column names specifiedThe list of column nmae you specified during the CREATE VIEW should match with the SELECT list of the view.
Twinkle -
"Invalid column name 'DiscountPartNo'." during Items Synch
Hi everyone, I'm having the following error message on the items synchronization part.
Invalid column name 'DiscountPartNo'.
Invalid column name 'DiscountPartNo'.
at netpoint.api.data.DataFunctions.ExecuteReader(CommandType commandType, String SQL, IDataParameter[] parameters, String connectionstring)
at netpoint.api.catalog.NPPart.Fetch(String partNo, String catalogCode)
at netpoint.api.catalog.NPPart..ctor(String partNo, NPConnection conn)
at NetPoint.SynchSBO.SBOObjects.SBOItem.SBOToNetPoint(SBOQueueObject qData)
at NetPoint.SynchSBO.SynchObjectBase.Synch()
I'm working with WebTools 2007 PL06 and SAP 2007 PL15.
Running the synchronization process for the first time on this DB and it seems that I can't sort this problem alone.
It would be of great assistance if someone could help me on this one. Thanks in advance.Well I've double checked and the WebTools version is 626 (files versions 626 also) but It was a previous upgrade from 624 so what I did was Backup and uninstall everything, manually delete folders, DB, site, etc. then Install all over again with version 626 from scratch and it worked perfect!
So problem solved. Thanks Shane! -
While loading the data from XML source I am getting following error
ORA-00972: identifier is too long
I understand that some of the Column name are more then 30 char (Oracle Limit) inmy source but I like to know what needs
to be modified in the IKM to pick only first thirty characters of column name in case of column name is more then 30 Char.
The LKM works fine as it take only the first 30 char to create the table name, I think it take that setting from topology manger.
but what need to modify in IKM to take only first 30 char for column name.
I am creating target table on the fly and I dont wanna modify each column name in the target table, It'll be alot of work for me.
Please let me know your thoughts on this.
ThanksYes its erroring out for IKM step for creating target table.
The step is ignoring the error on Create Target Table because of following error
972 : 42000 : java.sql.SQLException: ORA-00972: identifier is too long
java.sql.SQLException: ORA-00972: identifier is too long
ofcourse the column name is longer then Oracle limitation that is 30 Chars.
In the next step for inserting data it is also failing because of same error.
LKM steps work fine as it strip the column name longer then 30 char. -
How the BEE lines column names populated in OTL?
Hi,
I am trying to figure out how the elementry entry lines column names( in the pay_batch_lines table they are from value_1 to Value_15) populated in the form dynamically. I checked the pay_input_values_f table and it seems the element entry form is showing the columns for the vlaues in the name column for a particular element_type_id. So can we say the element entry lines shows the column which are in pay_input_values_f table and stores data ascending order of display sequence in pay_input_values_f table.
Thanks and Regards.Extracted from the ProC manual from Oracle 7.3 (don't ask :-{).
Chapter 11: Using Dynamic SQL
Section: Using Method 4
What Is a SQLDA?
A SQLDA is a hostprogram data structure that holds descriptions of
selectlist items or input host variables.
SQLDA variables are not defined in the Declare Section.
The select SQLDA contains the following information about a query
select list:
maximum number of columns that can be DESCRIBEd
actual number of columns found by DESCRIBE
addresses of buffers to store column values
lengths of column values
datatypes of column values
addresses of indicatorvariable values
addresses of buffers to store column names
sizes of buffers to store column names
current lengths of column names
NOTICE THE LAST THREE ENTRIES!
Could this also be usefull?
Enjoy. -
How to set column names when not using object of row data in constructer
hello i am using JTable constructer as
public JTable(int numRows,
int numColumns)
can i set column names for the columns .How?hi,
sure you can: Create a subclass of DefaultTableModel and overwrite the method public String getColumnName(int) which returns the column name of a specific column. Then use this subclass as the data model for the table.
best regards, Michael -
Currently in PowerView, if a column name changes in the tabular model, and that column is being used in a PowerView chart, the PowerView will become inaccessible.
It would be nice if it functioned similar to Pivot Table. If a column name changes for a column that is being used in a Pivot Table, the field is just removed from the chart, and the user can select the newly named column.Hi plantm,
After testing the issue in my environment, I can reproduce it. After we change a column name which is used in a Power View chart, Power view will render the message that” The external data connection has been disabled for this Power View report. Please enable
the connection.” when we reopen the file.
To fix this issue, we can click Refresh button under POWER VIEW menu, then it would prompt us that” Power View was not able to complete the action due to a query failure. This can happen if the structure of your data has changed, in which case closing and
re-opening the application will resolve the problem.”
According to the error message, we should try to reopen the file to fix this issue. Power view will render the message that” Please refresh to see the data for this Power View Sheet. You can set properties in the Connection Properties dialog so that the
data refreshes automatically when you open the file.” when we reopen the file. Then we can refresh it again, the report will be displayed without that field.
Based on my research, inherently what the message means is that Power View cannot be used as a tool for snapshot reporting. With an Excel PivotTable, we can see the data last saved in the PivotTable. Power View, however, does not behave the same way – it
won’t render the last saved state. If we want to avoid this message when we reopen the file, there are two methods:
When we create the Power View report, we can select the checkbox that “Refresh data when opening the file”.
After it’s been set up, go to Connections on the Data menu, then choose Properties.
For more details about the settings, we can refer to the following blog:
http://www.sqlchick.com/entries/2013/3/30/creating-a-power-view-report-in-excel-2013-which-uses-an-ext.html
Hope this helps.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
ORA-01400 - not null column with default value and item with authorization
I've searched - I would think someone has run into this. APEX 3.0.0.00.20 - I've created a simple form on a table. One of the column is a not null column with a default value. I have a select list on that item, but it has security on it - authorization scheme. So, it checks the user and if that user isn't of the right role, it will not even display that item. However, APEX appears to still send in the column in its sql! So, the default value is useless, it sends in null each time. Even if I set the default at the Item level, I get null. Argg. That's got to be a bug...
In debug, I do not see the item listed at all. It's not used. That's fine - but why is it trying to insert the value? I would think it would leave it off??? I think because the item is associated with a database column. But, getting around this is ugly. Having to create a hidden item for each one, and then check to see if I need to take the list value... horrible. Any way to get around this???I should add - I guess I can always put my own custom process in to replace the DML. Just seems like a simple thing - if the value doesn't appear on the debug, isn't set with any default value... don't include it in the DML.
Maybe you are looking for
-
Getting error while using odiRef.getPop("POP_NAME")
Hi, I am trying to insert interface name while running using below command added as step in IKM. INSERT INTO STG.CNTL_TAB VALUES(NULL,'<%=odiRef.getPop("POP_NAME")%>',SYSDATE,NULL) when I try to update the same inserted record in another step it is g
-
Hi, I am creating Good receipt with tc: MB1C, but when I put document date: 08.09.2008 & posting date 08.09.2008 an error message is coming: "Posting only possible in periods 1998/03 and 1998/02 in company code 1480" & when I put document date: 05.0
-
Users Disappeared from Workgroup Manager
All I see is the admin user. All Users and Groups are gone. Strange thing is that I can still view the LDAP tree from another machine and see all the users and groups. Command line access to the Kerberos system also shows the users existing there as
-
I can't download or update anything on my Ipod touch
Like the title says I cant download or update apps. I have an Ipod Touch 5g and it runs ios (the latest one). How do I resolve this issue?
-
ADSL Broadband keeps dropping out when trying to u...
Hi, hope someone can offer some advice please. Our connection seems to have got a lot slower over the last few months (about 2.64 on a very good day) and now keeps dropping out when trying to use either the laptop or PS3. I have followed the advice o