BUG: Wrong column name in View Object
Hello,
I've had this happen several times to me. I added an Entity Object to a View Object in the VO Wizard. I then went to the "Query" section and hit "Test" to test the SQL code generated by the VO Wizard. The test failed because the wizard had added an equality test (table1.col1 = table2.col2) to the WHERE part which used the wrong table name.
It is possible to manually fix this by putting the correct table name in the query, but you'd have to do this every time you make a change to the View Object.
What I did was to rebuild the View Object from scratch, and this time it correctly generated the SQL query. I was able to add some more Entity Objects, but then it happened again. This is really irritating because my View Object is fairly complex and it takes quite some time to remake it.
I can't give instructions on how to reproduce this because it only happens every so often. It would save a lot of frustration if someone could fix it though.
Hariolf
Hi Hariolf,
I was able to build this scenario and test the query with success. Here is the sql for the view object I created
from the following entities:
RootEO one to many association with Entity01
with Entity02
with Entity03
Entity01 one to many association with Entity04
All objects are included in the view object, here is the resulting generated sql:
SELECT RootEO.ROOTID,
RootEO.ATTR,
Entity01.EO1ID,
Entity01.ROOTID AS ROOTID1,
Entity04.EO4ID,
Entity04.ATTR AS ATTR1,
Entity02.EO2ID,
Entity02.ROOTID AS ROOTID2,
Entity03.EO3ID,
Entity03.ROOTID AS ROOTID3
FROM ROOTEO RootEO, EO1 Entity01, ENTITY04 Entity04, ENTITY02 Entity02, ENTITY03 Entity03
WHERE (((RootEO.ROOTID = Entity01.ROOTID)AND (Entity01.EO1ID = Entity04.ATTR))AND
(RootEO.ROOTID = Entity02.ROOTID))AND (RootEO.ROOTID = Entity03.ROOTID)
Let me know if I need to retest using a different scenario. Also, what version of jdeveloper are you using?
Amy
Similar Messages
-
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? -
Dynamic view names in view objects (adf faces bc 10g)...
I have written an application in adf faces and business components, but would like to be able to add sections to it by simply creating a database view, say with standard names and a suffix, and probably static number of columns (just a read only view). i can handle the front end and logic, but can't see a way to parametise the view names & columns in business component's view objects. I can do things like create a load of dummy views with 10 cols in say selecting 0 from dual then chuck them in the model, which is messy, but would work... Just wondering if there is a cleaner way i can achieve this through the model or any other method, so any ideas that could point me in the right direction would be useful.
Thanks in advance...
Tim.Hi,
you may want to investigate into dynamic ViewObjects or dynamicaly adding attributes like example 9 and 29 of http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
See also
http://www.bloggingaboutjava.org/2006/04/binding-dynamic-view-object/
Frank -
DOC BUG: 9.0.3.1 View Object Wizard and a Question
First the question: What is the Passivate property for in the View Object Wizard's Attribute Settings page?
Related Doc Bugs 9.0.3.1
Topic: Define New View Attribute Dialog
(click Help button in New Attribute dialog when creating a view object attribute)
Problems: The description for the "Attribute" property is "foo"; Descrimator, Updateable, and Queriable have single letter descriptions. Key Attribute and Passivate are not listed.
Topic: View Object Wizard - Attribute Settings Page
(click Help button in Attribute Settings page in View Object Wizard)
Problems: Query Column Type and Passivate are not listed. Attribute Settings column lists properties in a strange order (not a bug).
Peter KoletzkePeter,
I've logged doc bug 2814172: BC4J GLOSSARY SHOULD HAVE ENTRIES FOR PASSIVATE AND ACTIVATE.
For more information, you could read the "About Application Module Pooling" topic in the online documentation. Passivation is what happens when the application module's state is saved to the database - and activation happens when an application module instance retrieves passivated state from the database.
Thanks
Blaise -
Possible bug when creating multiple detail view objects
using jdev 11.1.1.0.0 to build jsf/adf applications. I wanted to report what seems like a bug in 11g. I have a parent table which has two child tables. After creating the appropriate entities, associations, views, and view links, the app module looks like this:
MasterView
--DetailView1
--DetailView2
The two detail view objects are on the same level, they are both direct children of the Master view.
Here's what's happening:
1) I create the master entity/view objects (MasterView)
2) I create one of the detail entity/view objects (DetailView1).
3) I create the association and view link to establish relationship between MasterView and DetailView1. Everything works fine.
4) I create the entity/view objects for second detail view (DetailView2)
5) When I attempt to create a second view link (based off an association) to establish the relationship between MasterView and DetailView2, the query clauses of the Create View Link wizard (screens 4 and 5) do not get created properly. I finish the wizard and save. Not only does this view link not get created properly, but in the process the query clauses that were defined in the first view link between MasterView and DetailView1 are wiped out. This will break any coordination between master and detail views in both the app module tester and runtime. Has anyone seen this problem?fyi, it looks like this issue has been resolved with jdev 11.1.1.0.2 (Update 2)
-
suppose i have a table employee with column name first and last. Now i want to make a view of that table employee with column name First_name and Last_name. Is it possible?
If you would have taken the time to look up the create view command in the SQL manual or in the Application Developers Guide - Fundaments you would not be asking this question.
You can name the table columns any legal column name in the view definition.
create or replace view bob_vw
as select lname as LAST_NAME, fname as FIRST_NAME from source_table;
HTH -- Mark D Powell -- -
How can I keep the column names in view on long spreadsheets?
I want to be able to see the column header names on long spreadsheets. In Excel you can create multiple panes in the window so as to keep both column and row headers in view. Any way to do this in numbers?
In Numbers 09 there is a similar feature; Freeze Header Row, or Column. It's only available in the Sheet View mode. In Print View mode, you can choose to Repeat Header on each page.
The controls are included in the Format Bar and Table Inspector, Heaader and Footer controls.
Jerry -
ORA-00957 Duplicate Column Name Materialized View ( UPDATED: Not answered)
Hello all. I am getting this error when trying to create a Materialized View. I have many other MV I created without problem, but I cannot find the catch up here, can anyone help?. I cannot find any duplicates. The only duplicate I though was the Pipeline_Code column that was entered into the function and the one being being called out as a column. To check, I renamed the latter and still am getting this issue.
Any help would be greatly appreciated.
Thanks!
The query is below:
CREATE MATERIALIZED VIEW MV_TEST_STATION
REFRESH COMPLETE
START WITH TO_DATE('20-SEP-2013 00:00:00','dd-mon-yyyy hh24:mi:ss')
NEXT (SYSDATE +12/24)
AS
SELECT T.TEST_STATION_ID,
--(SELECT TEST_STATION_TYPE.DESCRIPTION
-- FROM TEST_STATION_TYPE
-- WHERE TEST_STATION.TEST_STATION_TYPE =
-- TEST_STATION_TYPE.TEST_STATION_TYPE)
--AS TEST_STATION_TYPE,
TST.DESCRIPTION AS TEST_STATION_TYPE,
T.SURVEY,
T.STATUS,
T.STATION,
F_TRUESTATION2 (
T.STATION,
T.PIPELINE_CODE,
F_REROUTE_CODE (T.STATION,
T.PIPELINE_CODE))
AS TRUE_STATION,
T.REQUIRED,
-- (SELECT PIPELINE_CODES.PIPELINE_CODE_DESCRIPTION
-- FROM PIPELINE_CODES
-- WHERE TEST_STATION.PIPELINE_CODE = PIPELINE_CODES.PIPELINE_CODE)
-- AS PIPELINE_CODE,
PC.PIPELINE_CODE_DESCRIPTION AS PC_PIPELINE_CODE,
T.INSTALL_DATE,
T.FUNCTIONAL COMMENTS,
TSR.TEST_STATION_READING_ID,
TSR.TEST_DATE,
TSR.SURVEYOR,
TSR.ON_VOLTS,
TSR.ON_BG,
TSR.ON_AG,
TSR.METER_UTC,
TSR.METER_ID,
TSR.IO_BG,
TSR.IO_AG,
TSR.INSTANT_OFF_VOLTS,
TSR.FUNCTIONAL_DAMAGE_OUT,
TSR.FUNCTIONAL_DAMAGE_IN,
TSR.COSEMETIC_DAMAGE_OUT,
TSR.COSEMETIC_DAMAGE_IN,
TSR.COMMENTS,
TSR.CASING_ON,
TSR.CASING_OFF,
TSR.CASING,
TSR.CALIBRATION_DUE_DATE,
TSR.ANODE_AMPS_ON,
TSR.ANODE_AMPS_OFF,
TSR.ANODE
FROM TEST_STATION T
INNER JOIN TEST_STATION_TYPE TST ON T.TEST_STATION_TYPE = TST.TEST_STATION_TYPE
INNER JOIN PIPELINE_CODES PC ON T.PIPELINE_CODE = PC.PIPELINE_CODE
INNER JOIN TEST_STATION_READING TSR ON T.TEST_STATION_ID = TSR.TEST_STATION_ID
WHERE T.TEST_STATION_ID = TSR.TEST_STATION_IDsince we don't have your tables or data, we can not run, test, fix or improve posted code
How do I ask a question on the forums?
https://forums.oracle.com/message/9362002#9362002 -
Invalid Column Name on select from materialized view?
Hey all, I have created this materialized view for my java to select from. For some reason when I try to select from it, I get invalid column name. Here is my mat view statement in its simplest form:
create materialized view mv_pgridtcevcluster_property as
select distinct clustername_ as "OBJECT_ID", CLUSTERNAME_, LICENSEMODE_
from p_gridtcevcluster p
order by clustername_;
Now when I run my select statement from jdbc:
SQL: select object_id from MV_PGRIDTCEVCLUSTER_PROPERTY
java.sql.SQLException: Invalid column name
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3319)
at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1926)
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515)
at com.mchange.v2.c3p0.impl.NewProxyResultSet.getString(NewProxyResultSet.java:3342)
at historian.objects.mgmt.udrManagerTest.gatherObjects(udrManagerTest.java:73)
Anyone have issues with this before? It seems to throw the error sporatically, any help would be much appreciated!
Regards,
TimS
Edited by: TimS on Mar 30, 2009 1:54 PM
Nevermind, figured it out. Was using wrong column name identifier when picking values from resultset.Since you have "OBJECT_ID" in quotes, Oracle stores the column name literally and case sensitively, and the column name must be capitalized when referenced.
From a regular sql*plus window, try
select object_id from mv_pgridtcevcluster_property;
select OBJECT_ID from mv_pgridtcevcluster_property;
select "OBJECT_ID" from mv_pgridtcevcluster_property;What is the result from each of them? -
Finding Application Module name in read-only view object classes
Hi all,
I have a fairly basic question about finding application module name when we are coding in ViewObject java classes.
I want to know how can I obtain <<application module>> NAME that our current view object is contained in it at run-time. I think there should be a way to find current application module NAME, when we are in ViewObject classes including View Object, View Row or view object definition classes (I've overridden all mentioned classes).
I should notify that since our view object is read-only I may not count on view object's entity classes, coz as you know a read-only view object don't have any entity in it!
So, if you have any idea about finding current application module name in view object java classes please let me know.
Appreciate for your replies,
NasserThanks guy, it was helpful:)
Now i can access application module name through viewObject classes.
But another question is raised...sorry if i m boring:( I promise its the final question ;)
Is there a way to get application module name in an extended version of JboException class?
Thanks again for your reply:)
Nasser -
Getting a View Object Total Attributes
Hi, Is there any way to retrieve the Attribute count (DataBase Columns) of a View Object in its own java implementation?
I'm using this:
JDev 11.1.1.6
System.out.println("this.getEntityDef(0).getAttributeCount() " + this.getEntityDef(0).getAttributeCount());
System.out.println("Column count1 " + this.getAttributeCount());
System.out.println("Column count2 " + this.getAttributeDefs().length);
System.out.println("Column count3 " + this.getProperties().size());
but none of them works the best way:
the first one gives me 6 more than the actual columns that excist in the entity object
the second and third are gives me more than the attributes of that object
the forth gives me 200 and more
which way gives me the count of the database table columns, and how can I access it in by index?
thanks- Here is modified code, which prints attribute name along with database column name the attribute represents:
public int getCountOfPersistentAttrs() {
int result = 0;
for (AttributeDef attr : getAttributeDefs()) {
if (attr.getAttributeKind() == AttributeDef.ATTR_PERSISTENT) {
System.out.println("Name of persistent attribute : " + attr.getName());
System.out.println("Name of the database column the attribute represents : " + attr.getColumnName());
result++;
return result;
} -
I am receiving an Invalid column name SQLException. I initially
thought it was a problem with the computed fields, but was after
making the usual changes to the model implementation the exception is
still occurring. I can run the SQL statement in SQLplus and get no
errors and the three results I'm expecting (grabbing the SQL statement
from the model's beforeExecute event). The mystifying part is that it
returns one of the three rows that I'm expecting. That is, the model
executes and the result set is partially filled. The model is Select
only. The computed fields are concatenated strings. After logging the
exception I call getNumRows() on the model and receive a 1 back. The
computed fields are returned in that one record. Any ideas about what
to try or where to look next?
Thanks,
paulKostas,
Thanks for your help. During migration a QueryFieldDescriptor was
created for a field that is only used in the where clause. I'm
assuming it then couldn't be mapped back to the ResultSet, and this
caused the Invalid Column Name exception. That is, I am selecting 5
fields, but had 6 QueryFieldDescriptors.
paul
--- In SunONE-JATO@y..., Kostas Morfis <kmorfis@i...> wrote:
Hi Paul,
It would appear you have a column name mismatch between what isdefines in
your modelImpl
and what is being returned by the JDBC driver.
From the SQL you sent, the Column Names would be something like:
'SURVEYGROUP_XREF',SURVEY_ID', CF_SURVEYANDGROUP', 'CF_SURVEYGROUP',
'RESULTS_VIEWER_ID'
Do all your column names definitions in your modelImpl match up tothese ?
>
eg public static final StringCOLUMN_WIS_SURVEYANDGROUP="CF_SURVEYANDGROUP";
>
Note: the qualified column vairables (QUALIFIED_COLUMN_XXXXXX) doNOT get
used for Select queries.
If it still unclear where the mismatch is occurring, you can addsome simple
debugging :
To tell you what you are trying to access add the the following in
ResultSetModelBase just before the
exception occurred:
System.out.println("UPDATE_MODEL: Attempting to Access Column Name:
"+fd.getColumnName());
Object value=resultSet.getObject(fd.getColumnName());
If still need more information,you can look at the column namesreturned by
the JDBC calls by doing something like:
ResultSetMetaData metaData = resultSet.getMetaData();
int columnCount = metaData.getColumnCount();
for(int i = 0; i < columnCount ; i++)
System.out.println("Colummn["+i+"]"+
metaData.getColumnName(i+1));
Hope that helps.
Kostas -
Jpub invalid column name error
I try to create a Wrapper for a PL/SQL Package in a Oracle8i database with jpublisher.
I created Packages and Object Types with the SQl script Rational.sql. \oracle\ora81\sqlj\demo\jpub\Rational.sql
jpub failed to produce any sqlj or java files, but produces a "invalid column name" error. This happened with all packages I have tested. Object Types are wrapped without problems.
jpub -sql=RationalP -user=scott/tiger -url=jdbc:oracle:oci8:@xx
SCOTT.RATIONALP
ORA-00904: invalid column name
JPub: Java Object Type Publisher, version 8.1.7.0.0 Production
Thanks for Help, KonradThe database that your are running against is 8.1.6 or earlier.
You are seeing an issue where JPublisher is not backwards compatible. It looks up system tables to determine the signatures of SQL types and of PL/SQL packages. A change happened with the 8.1.7 release in the representation for packages, but JPublisher did not keep backward compatibility. You can do one of the following:
(1) Use the JPublisher version that came with your database. (Use the runtime.zip/translator.zip libraries under [Oracle Home]/sqlj/lib.)
(2) Use the JPublisher from Oracle 9.0.1 or later. It also provides backward compatibility to 8i databases.
Let us know if you have any further questions. -
How to Insert the row in the View object
I want to insert the row in the view object by instantiating Impl.java file
Could someone please let me know how to insert the blank row
ThanksInserting onto a view object should be done the following way:
//vo is your view object
Row aRow = vo.createRow();
//Set your attributes
aRow.setAttribute("AttributeName", objectValue);
//insert
vo.insertRow(aRow);
That should work for you if you are programming the input. If you are using java components bound to columns in a view object then the input should be done automatically for you when you commit. -
ADF BC View object with invalid character in column names
Hello
I Have a table with columns containing # character , for example ORDER# , When i create the read only view object j developer automatically renames this to order, but when i try to sort on that column or try search (filter) i get error that column order is not found
what i can change to resolve this
Thanks for your time
SrinivasThanks frank i will do that , as a work around , the error is resolved by changing the query from select order# , other fields to select order# as ordernumber etc
Thanks
Srinivas
Maybe you are looking for
-
CAN'T jump to the other pages in itunes!!!!
i just figured out the itunes had been suck !!!! i CAN'T jump to the other pages in App store for Games (ex: from page 1 to page 10 or 10 to 20). So, before i close the itunes, i was at page 50, but everytime i closed the itunes, i had to start over
-
Position of Parameter in BIP Report
Hi, I have created some parameters.Those are automatically showed on the Report View page by default at some postions.What I need is to adjust the parameters on the screen at my convinient postions. Can anybody help? Thanks & Regards, Ajay
-
Dynamically changing the content of the block
Hi, We have a requirement as below : The form contains two blocks. The main block contains a dropdown which will show a list of tables (like emp, dept..etc). When the user will select a particular table, the second block should show the columns of th
-
Personalised data from Variable
Can U give me an example how this funtion works and where do I have to personalise the values?
-
Hello guys, I am running the byproduct scenario, I have given its qty in negative in bom of material along which we get the byproduct.After mrp run,its showing depreqmt of byproduct in negative and system is not generating any procurement proposa