Non nullable columns
If we need to insert blank into a non nullable char and varchar fields
what should we do. And in case of int and decimal fields can we insert
0 and 0.0
Thanks
If you need to insert blank then you should insert
blank. It makes no difference whether the column
accepts null values or not because blank is not null.That is not entirely true. With Oracle a String of the length zero will be treated as a null value.
Similar Messages
-
Issue with non calculated column in a fact table
Hi All,
With 3 facts(Fact1,Fact2,Fact3) and 2 Confirmed Dimensions my joins work fine in Criteria when I include All calculated columns from facts. If I try to include a non calculated column from Fact1(Which is a number Data type) Columns from Fact2 and Fact3 show Null values. I know it is not recommended to include dimension columns in fact , does OBIEE not support Number type non calculated columns as well? Is there any work around that I can bring in my non calculated column from Fact and still get results for other fact columns.Iam at 11.1.1.7 of OBIEE
Let me know if Iam not clear.
Your help is much Appreciated.
Thanks,
Vineela.i would like to add 2 fields into my fact tables - LOAD ID (populated by a sequence during each load) and LOAD DATE.
as these fields are not related to any reporting dimensions, it is still possible to add them in OWB ? the fact wizard always ask for a foreign key to a dimension ...
Duncan,
If you want to add non dimensional attributes to a fact by using OWB, you can create additional measures to it and use them as attributes.
Igor -
Filter Data with Merged and non merged columns in one
Hi there,
I have an excel spreadsheet that has got merged and non merged columns. What I want to be able to do is, filter a row that has got merged column and non merged columns. But when I filter it only takes the first line, rather than the merged and non merged
columns.
With this data I have one merged column which spans 6 rows, and then in the same row I have 6 rows with different points in, and what I want to do is filter my list, but be able to see the merged coloum aswell as the 6 points.
Any ideas are much appriciated.
Cheers
SANYou cannot filter across a row - so I have assumed that what you mean is that some cells in columns are merged to serve as the headers, and the data is in the came columns but in the row(s) below the header. If this is incorrect, ignore this post.
For this example, I have assumed E to J are the column of data and merged cells, column K is free, and the first merged header is in row 1:
In K1, enter
=E1
in K2, enter
=IF(COUNTA(E2:J2)=1,E2,K1)
and copy down. Then filter based on column K, and it will show the headers and the data for the selected header value.
HTH, Bernie -
Region sql query(updateable report) data entry in non db columns
In a tabular report type updateable report
What is the best way to provide data entry into a non db column a) (to accept parameters for some on demand pl/sql processes)?
Only when setting a) as a standard report column the db insert/update transaction can be processed
When changing a) to text field the db insert/update transaction fails with en error (screen/db are not in sync which is not actually the case)
a) should not be part of the db insert/update transactions but still allow data entry
How can this be achieved?
Thanks
PeterHi Peter,
I think the easiest solution is to use an updateable view instead of the direct table access.
Here is an example:
CREATE OR REPLACE VIEW V_EMPLOYEES
AS
SELECT EMPLOYEE_ID
, FIRST_NAME
, LAST_NAME
, FIRST_NAME||' '||LAST_NAME AS FULL_NAME
FROM EMPLOYEES
CREATE OR REPLACE TRIGGER TRG_V_EMPLOYEES
INSTEAD OF INSERT OR UPDATE OR DELETE
ON V_EMPLOYEES
REFERENCING NEW AS new OLD AS old
FOR EACH ROW
BEGIN
IF UPDATING
THEN
UPDATE EMPLOYEES
SET FIRST_NAME = :new.FIRST_NAME
, LAST_NAME = :new.LAST_NAME
WHERE EMPLOYEE_ID = :old.EMPLOYEE_ID
-- insert and delete is not allowed
ELSIF INSERTING
THEN
NULL; -- there would be a insert code
ELSIF DELETING
THEN
NULL; -- there would be the delete code
END IF;
END;
/FIRST_NAME||' '||LAST_NAME AS FULL_NAME in the example view simulates your function call.
There might be a possibility to do it in APEX as well, but that was the first solution which came into my mind.
Patrick
Check out my APEX-blog: http://inside-apex.blogspot.com
Check out the ApexLib Framework: http://apexlib.sourceforge.net -
Displaying a non existent column from a Table.
Hi
I have an SQL Query that returns back a count of all the
entities
select count(*)'COUNTER',
id_entity 'ENTITY'
from claim
where id_status = 'O'
group by id_status,id_entity
order by id_entity ASC
Output
COUNTER ENTITY
169 AGL
6 DBC
28 DELI would like to put a non existent column called 'Type' with a counter
of 0,so that the output looks like :
COUNTER ENTITY
0 TYP
169 AGL
6 DBC
28 DELIs this possible ? What do I need to change in my select clause
for this?
Please helpmonalalwani, do you mean something like this?
you have -
1 select count(*) as counter, deptno
2 from emp
3* group by deptno
UT1 > /
COUNTER DEPTNO
5 10
5 20
6 30
-- but want counter = 0 for dept 0
UT1 > select count(*) as counter, deptno
2 from emp
3 group by deptno
4 union
5 select 0, 00
6 from dual
7 /
COUNTER DEPTNO
0 0
5 10
5 20
6 30
HTH -- Mark D Powell -- -
Order By Clause on Non-Database Column using Forms
How to Sort by using Order by Clause on Non-Database Column using Forms6i
Eugene,
What is the error message/ number you are seeing? If you run "select name from tblperson order by name" do you still get an error? -
if we have data in the following format:
c1 c2 c3 c4
0 234 0 12
0 111 0 11
0 280 0 38
0 387 0 49
the above no.of columns can be variable
how can we select only non-zero columns - c2 and c4Hi,
This requires dynamic SQL.
To find if table_x.c1 contains anything except 0 (incluiding NULL), you could say:
SELECT 'TABLE_X', 'COL1' FROM dual WHERE EXISTS (SELECT NULL FROM table_x WHERE NVL (c1, 1) != 0);What you have to do, using dynamic SQL, is write a SELECT statement like that for every column you want to test.
So you'll need a query like
SELECT 'SELECT '''
|| table_name
|| ''', '''
|| column_name
|| ''' FROM dual WHERE EXISTS (SELECT NULL FROM '
|| table_name
|| ' WHERE NVL ('
|| column_name
|| ', 1) != 0);' -- Omit ';' in PL/SQL
FROM all_tab_cols
WHERE ... -- whatever you needIn SQL*Plus, you can write all of these statements to a SPOOL file, and then execute it by saying @spool_file.
In PL/SQL, you would use EXECUTE IMMEDIATE to run each statement. -
How to access a non-database column in a report?
Hi all,
I would like to populate a column in my report, which is not based (in Oracle Forms, it is a "non-database item").
But I don't know how to access it. Let's say the alias of the column is "column", I tried to do it with #column#, but it's not valid.
Does anyone know a solution here?
Thanks a lot,
DovikDovik
Where do you need to access the column value ? Are other columns of the report accessible from where you are trying to access the value of this 'non database' column ?
varad -
One can create an index on a non-existent column in a table
I am using Oracle 10.2.0.3 on Windows 2003. I wanted to create an index on columnb of
Tablea. When I use statement like:
Create index index1 on tablea (‘columnb’) …
Oracle created index: index1. However, when I looked tat the column in user_ind_columns it had some weird colculn like SYS_NCxxxx. For sometime, I had
No idea what was going on. My index was not being used in queries at all. Then it dawned on me that I should not put single quotes around columnb. Once I removed quotes, things worked as expected.
But why does Oracle allow index on a non-existent column?we cannot create the index on nonexistent column of table We can. Its called a function-based index. Here's how we do it.
Also read Howard's reply, right above yours.
SQL> desc t
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
OBJECT_NAME NOT NULL VARCHAR2(30)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NOT NULL NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED NOT NULL DATE
LAST_DDL_TIME NOT NULL DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
SQL> create index t_idx on t( substr(object_name, 1, 5));
Index created.
SQL> select column_name from user_ind_columns where index_name = 'T_IDX';
COLUMN_NAME
SYS_NC00014$
SQL> select index_type from user_indexes where index_name = 'T_IDX';
INDEX_TYPE
FUNCTION-BASED NORMAL
SQL> -
OWB Dataprofiling - Unique Key Analysis on non-number columns
Does anyone know an easy way to enable unique key analysis on non-Number columns (OWB 10.2.0.3).
It seems that the profiler by default disables the
'Use in relationsship discovery' when the documented datatype is non-Number.
Is this a setting which can be configured for OWB, or is there a smart way to set this property for all columns?
thks in advanceHi don't think there is a way to to automatically switch this on/off, a small script can be created to set the option on/off for all columns in the table.
Cheers
David -
Filtering merged and non merged columns
Hi there,
I have an excel spreadsheet that has both merged and non merged columns. I want to filter a row that has got merged column and non merged columns. But when I filter it only takes the first line, rather than the merged and non merged columns.
Any ideas are appriciated.
ThanksAs you have found, (vertical) merging and filtering do not go together. The value of a merged area only "lives" in the top left cell of the area, the other cells are blank.
I would unmerge the cells and fill the values down into the blank cells. You should then be able to filter normally.
Regards, Hans Vogelaar (http://www.eileenslounge.com) -
Non Database Column to Grid Control
Hi,
How do I add a Non database column to a Grid Control which is
based on a Rowset. I want the similar functionality of a
multirow Block in D2K Forms, which is based on a Database query
and to which another item is added which is non Database item
and it is also displayed as any another item in the same
multirow block. The updatable and queryable property for this
item is set to false.
How do I get similar functionality in JDeveloper using InfoSwing
GridControl. Thanx in advance.
--- Ravi
nullThe GridControl does not have built-in support for this
functionality. However, the GridControl source code is provided
so you can extend the control to provide this functionality.
In 3.0, the Oracle Business Components for Java will provide the
ability to create objects that can mix db and non-db attributes.
The GridControl can then be bound to this object to provide the
functionality you seek.
- PSW
Ravindra Channe (guest) wrote:
: Hi,
: How do I add a Non database column to a Grid Control which is
: based on a Rowset. I want the similar functionality of a
: multirow Block in D2K Forms, which is based on a Database query
: and to which another item is added which is non Database item
: and it is also displayed as any another item in the same
: multirow block. The updatable and queryable property for this
: item is set to false.
: How do I get similar functionality in JDeveloper using
InfoSwing
: GridControl. Thanx in advance.
: --- Ravi
null -
I saved an Excel workboob as a web-page - In IE 8 it displays exactly as I want (that is all visible, non-hidden columns) - In Firefox 10 it displays the same, ''plus'' the ''first'' of what should be a series of'' hidden columns'' - Why would Firefox see a hidden column which IE doesn't - I'm working on XP (fully up-to-date with all patches applied)
Thanks fmdeveloper as a result of you confirming that it is an FF bug I delved deeper into it and I've now found a fix as follows:-
1) Unhide Excel columns, format cells to ;;;
2) From first re-formatted col to rightmost end of all cols select & hide
When saved as web page this then displays in FireFox as it does in IE
NB: After re-formatting previously hidden cols it is necessary to hide '''all''' the remaining cols or there will be a display of blank cols in FF where garbled 'hidden entries' were seen previously
Regards homeric -
Reg: Nullable column search
Hi all,
I have a table DIAGNOSIS which has a QDESC as a nullable column.
columns DIAGCODE and SDESC are not nullable.
I have written a Stored Procedure to retrieve records from DIAGNOSIS table based on the columns values specified.
p_<column_name> indicates the parameter passed to the Stored Procedure
The correspong SQL statement goes as follows.
SELECT * FROM DIAGNOSIS
WHERE
UPPER(DIAGCODE) LIKE
(CASE WHEN LENGTH(p_DIAGCODE) > 0 THEN '%' || UPPER(p_DIAGCODE) || '%' ELSE '%' END)
AND UPPER(SDESC) LIKE
(CASE WHEN LENGTH(p_SDESC) > 0 THEN '%' || UPPER(p_SDESC) || '%' ELSE '%' END)
-- QDESC is a nullable field; but the following logic doesnt work :-(
AND UPPER(QDESC) LIKE
(CASE WHEN LENGTH(p_QDESC) > 0 THEN '%' || UPPER(p_QDESC) || '%' ELSE '%' END)
Sample data of the table is as follows.
DIAGCODE SDESC QDESC
123 DESC 1 AAA
123 DESC 2
123 DESC 3 BBB
123 DESC 4
When I use the above query to find records with DIAGCODE as 123, I get
DIAGCODE SDESC QDESC
123 DESC 1 AAA
123 DESC 3 BBB
i.e QDESC with null values are not displayed.
How am I supposed to modify the query to get the correct result?
Any help would be highly appreciated.
Thanks n Regards,
TanujaLet's assume the formal parameter is called p_column_name.
The actual content of that parameter is 'DIAGCODE' or 'Q_DESC' or whatever.
In static sql
you can only have
<column_name> = <constant>
and <constant> can be replaced by a bind variable.
This construct
select *
from <table>
where p_column_name is null
is not going to work, as there is no p_column_name in that table.
This construct
declare
dynstr varchar2(100);
p_dummy varchar2(100);
p_column_name varchar2(30);
begin
p_column_name := 'bar';
dynstr := 'select bar from foo where '||p_column_name||' is null';
execute immediate dynstr into p_dummy;
end;
although silly dummy code is going to work.
Hth
Sybrand Bakker
Senior Oracle DBA -
Histogram on non-indexed columns
Hi All,
Is there any point in having histogram on non-indexed column? If we use a non-indexed column for filtering data, there will be a full table scan anyway.
Does having histogram in such column make any difference.
I am on v11.2. Are there any differences/advances in this respect in 11g ?
Thanks in advance.rahulras wrote:
Hi All,
Is there any point in having histogram on non-indexed column? If we use a non-indexed column for filtering data, there will be a full table scan anyway.
Does having histogram in such column make any difference.
I am on v11.2. Are there any differences/advances in this respect in 11g ?
Thanks in advance.Histogram used to correct estimate selectivity(~ cardinality) by CBO if there are indexes or no!.So if there are indexes then after estimating selectivity based on values CBO can be select FULL TABLE SCAN but not INDEX SCAN!.Finally histograms use when your columns data non uniform distributed(actually skewed).
Maybe you are looking for
-
Dialog Instance installation error - rdisp/msserv_no not possible
Dear All, While trying to install a DI I am getting the following error: An error occurred while processing service SAP CRM 5.0 Support Release 3 > Software Life-Cycle Options > Application Server > MS SQL Server > Dialog Instance( Last error reporte
-
Memory Leak in 10.4.7
Question for all you Mac "Guru's" out there. I have an Imac (intel) with 2 512MB Memory Sticks and Have Noticed that there appears to be a memory leak in the OS. After several staggering hours It seems that the culprit is WindowServer and kernal_task
-
Plugin-container.exe using 40% of cpu
== Issue == Firefox is having problems with certain web sites == Description == FYI, (thanks to all developers) I rarely go to porn sites but the popunder-windows they generate caused the plugin-container.exe to use 40% of cpus (2 cpu). This is after
-
Replacement for FM WS_MSG as it is obsolete in ECC6.0
HI ALL, can you please suggest me the replacement for obsolete FM WS_MSG.
-
G505s Laptop shuts down in sleep mode
Hi, I recently bought a new G505s laptop running Windows 8.1. When the laptop goes into sleep mode (either on the battery or when plugged in with the lid down) the laptop will shut down completely. It does not even seem like the laptop is going into