SQL & PL/SQL :: Query Over Database Link Ambiguous Column Error Not Raised
Apr 1, 2011
why this query is not raising an error:
select memberid, mi.typeid, emailaddress
from memberdata@prod_db m
join memberitems@prod_db mi on m.memberid = mi.memberid;
These are the tables:
SQL> desc memberdata@prod_db
Name Null? Type
----------------------------------------- -------- ----------------------------
MEMBERID NUMBER
EMAILADDRESS VARCHAR2(50)
ADDRESS1 VARCHAR2(50)
SQL> desc memberitems
Name Null? Type
----------------------------------------- -------- ----------------------------
MEMBERID NUMBER
ITEMID NUMBER
Shouldn't we raise an 'ambiguous column' error on memberid?
We are using Oracle 11g with Apex 3.2 on AIX. We are reporting data from customer satisfaction surveys. I'm using the following sql to create my report
<code>select * from( select month,'Overall Satisfaction' as q_group, 1 as srt,Overall Satisfaction,site, case when count(*) < 31 then '*' else round((sum(ttos)/count(*))*100,0)||'/'|round((sum(bfos)/count(*))*100,0)||'/'||count(*) end ospct from v_XXX_report a,(select distinct month_dt month from v_XXX_report) b where Overall_Satisfaction is not null and year_dt = 2012
[Code]....
The problem is that site is not allways present and sometimes I have other variables in addition to site. This creates a situation where the month columns will not allways appear at the same column number. For example, When I run this query as is then the "JAN" column is Col3 (first column is a break, col2 is not shown). When I run this query without site then "JAN" is the second column. I would like to create column links for the "JAN" - "DEC" columns but not for any other columns.
Another issue - in the column link creation screen I can create up to 3 variables that I can pass to the next page. Since my query is a pivot I'm uncertain how to pass the column heading or the row value (for col2)
ie Overall Satisfaction JAN FEB MAR APR MAY ... Overall Satisfaction 12/12/200 12/12/210 12/12/220 12/12/230 12/12/240... Recommend 12/12/200 12/12/210 12/12/220 12/12/230 12/12/240... etc.
So if I clicked on the values at Recommend:FEB how can I get "Recommend" and "FEB" into variables that I can use on the next page? I've tried #column_name#, #month#, #q_name# and #APEX_APPLICATION.G_F10# but no luck.
My problem is I have 3 tables (TEST_TBL1, TEST_TBL2, TEST_TBL3). TEST_TBL2 and TEST_TBL3 are in remote database and I use database link to join them. The following query returns incorrect result (I seems that it ignore the where clause)
SELECT * FROM TEST_TBL1 JOIN TEST_TBL2@db_remote USING (KEY1) JOIN TEST_TBL3@db_remote USING (KEY2) WHERE KEY1=XXX OR KEY2=YYY;
I am on 11R1 (11.1.0.7)
FOR EXAMPLE:
Local database: CREATE TABLE TEST_TBL1 ( KEY1 NUMBER(5) NOT NULL,
I have installed unixodbc 2.3.1, postgres odbc driver (psqlodbc-07.03) and dg4odbc 11.2..On querying : select sysdate from dual@dblink_postgresql, the following error occurs:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message: [unixODBC][Driver Manager]Can't open lib '/oracle/psqlodbc/lib/libpsqlodbc.a' : file not found {01000} ORA-02063: preceding 2 lines from DBLINK_POSTGRES
Similar error appears in the trace file as well.
[unixODBC][Driver Manager]Can't open lib '/oracle/psqlodbc/lib/libpsqlodbc.a' $ isql -v postgresql postgres postgres@2012 [01000][unixODBC][Driver Manager]Can't open lib '/oracle/psqlodbc/lib/libpsqlodbc.a' : file not found [ISQL]ERROR: Could not SQLConnect
However the file is present in the location and has no permission related problems.
$ pwd /oracle/psqlodbc/lib $ ls -lrt total 2952 -rwxr-xr-x 1 oracle oinstall 663 Mar 25 15:28 psqlodbc.la -rw-r--r-- 1 oracle oinstall 731419 Mar 25 15:28 libpsqlodbc.a -rw-r--r-- 1 oracle oinstall 12215 Mar 25 22:11 win_md5.o -rw-r--r-- 1 oracle oinstall 18100 Mar 25 22:11 options.o [code]....
I am trying to build one custom 10g form from TEMPLATE.fmb. when i try to compile my form in desktop it is giving error as Error FRM-40735: ON-ERROR trigger raised unhandled exception ORA-6508.
I am using database 10g and Form 6i. We are working under client server technology. Frequently we are receiving the following error to every user at randomly when they are idle few seconds/minutes.
FRM-40735 or error trigger raised unhandled exception ora-03114
On my APEX page i have region which has sql query as source and it displays as HTML table the query result to the user.
I want to display addinonal column with a hyperlink inside, and that hyperlink would have CGI/URL-parameters which contains the other values of the HTML row.
So, let's say my APEX region queryes columns as "select c1, c2, c3, c4 ..." and displays out values "V1, V2, V3, V4" then i want to have addional output column with such hyperlink:
a href="f?p=100:7:13467554876288::NO::c1,c2,c3,c4:v1,v2,v3,v4">My link column with CGI-parameters</aHow can i create such hyperlink?
The overall idea is that the link would forward to a page which loads those values "v1,v2,v3,v4" into form fields and user can proceed from there.
I want to pass multiple column values of a row in an interactive report page to hidden items in another page through column link. And I did it successfully. However, I found I need to pass more than 3 columns of a row in this report, while a column link only permits me to pass 3 column value at most. Is there anyway that I can pass more column values to hidden items in another page?
I am trying to run the below query to extract the outline data from v$sql_plan(querying other_xml column), but i get the below error...this works perfectly fine on 10.2.0.4 + version...but on 10.2.0.2 and and 10.2.0.1 i get the below error... how to fix it ?
SQL> @sql_hint Enter value for sql_id: d15cdr0zt3vtp Enter value for child_no: 0 extractvalue(value(d), '/hint') as outline_hints * ERROR at line 2: ORA-00904: "D": invalid identifier
the query is taken from below...[URL]....
select extractvalue(value(d), '/hint') as outline_hints from xmltable('/*/outline_data/hint' passing (
I am trying to insert data from 9i to 11g using db link with the below query but while doing so the select statement is going for a full table scan even though rowid is used. But when we execute the same select statement without this insert command it is using proper index. Similar issues I am facing for updates.
Query:
INSERT INTO /*+ APPEND */ emp@db_link select * from emp where rowid ='AAC2SmAIIAAAHQgAAZ'
Import: Release 10.2.0.1.0 - Production on Wednesday, 17 March, 2010 11:07:02 Copyright (c) 2003, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Release 10.2.0.1.0 - Production Starting "MUBA"."SYS_IMPORT_TABLE_01": muba/******** tables=FUNCTION_NO directory=testdump NETWORK_LINK=DBLINK1 Estimate in progress using BLOCKS method... Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
we have the following requirement for creating materialized view.
In database "DB1", a table "abc" is there in "user1" schema. In database "DB2", in "user2", we are accessing the "abc" through DB link "DBL1" to DB1: select * from user1.abc@DBL1; we have created a public synonym for "user1.abc@DBL1" as "sabc".
In database "DB3", we need to create the materialized view to access "abc" in DB1 through DB2. we are not allowed to access "DB1" directly from "DB3". so we create a db link as "DBL2" in "DB3" to "DB2".
when i try to create a materialized view as below: create materialized view abc_mv as select * from sabc@DBL2;
But got the error as "synonym translation invalid". When i access the SQL statement separately as below select * from sabc@DBL2, its working but in Materialized view, it shown that error. Even i tried with schema name as well like "user2.sabc@DBL2" , but that also thrown same error.
Is there any option available for this type of creating materialized view?
I have IR wit one column link target to URL, and it uses javascript:my_function(#COLUMN_VALUE#)as URL, that is, calls some function and passes the value of that column to the function; everything works fine; but when I place a cursor over the link, bottom line of IE9 browser (is it called a 'status bar'?) clearly shows:
'javascript:my_function(<actual value>)' Is there any way to prevent it from showing function name and parameter value? I tried onmouseover="window.status='';"but it does not work
I'm a APEX newbie using APEX 4.1. I have a table with engineering drawing information (drawing number, title, revision, etc.) and another table with the corresponding drawing files (pdfs stored as blobs where the filename is the drawing number with a pdf extension). The user wants to search for a particular drawing by drawing number from the drawing info table and if the drawing number exists in the drawing files table the drawing number will also be a download link for the file, if the drawing number doesn't exist in the drawing files table than the drawing number will display as plain text (not as a download link).
I have a report linked to a form. The link column is currently ROWID and I want to change it to the Primary Key of the DB table, which is called ID.
I have done this before on a previous report/form where that ID was a display column and it works fine. Now I'm trying to copy what I did, which is this:
On the report page, go to Interactive Report attributes, scroll down to Link Column, and for Item 1, change the Name and Value.
The problem is that Name does not list P52_ID. If I type it in, it throws an error when I run the page.
I think I added ID, which is also a Display column, later on, so I wonder whether Apex has a refresh issue and can't "see" P52_ID.
Is it possible to use Database authentication in APEX through database link, and how?Also is it posible to read roles from users through database link?
I have an Interactive Report with a column that I need to create a link on but I need to pass the value of another column.
This report shows the Features of a particular Release. There is a select list for the Release that is selected and executes the report. There is a column that indicates whether the Feature has a Commitment attached to it. If there is have that a link to another report that shows all the Commitments for that Feature by passing the FEATURE_ID which is also a column on the Feature report.
Query: SELECT .... ,CASE WHEN ft.feature_id IN (SELECT cc.feature_id FROM customer_commitments cc WHERE ft.feature_id = cc.feature_id ) THEN 'Yes' ELSE 'No' END "Commitment Exists" ,ft.feature_id ....
FROM ....If "Commitment Exists" has a 'Yes', the 'Yes' is a link that will pass the FEATURE_ID to another report that will show the Commitments for that Feature. If the "Commitment Exists" has a 'No' then no link. I was also wondering if the Commitment report could open in a seperate window and make it modal?
I am having issue with Oracle reserved words, one of the application is using table which has NUMBER as column. I am not able to query that table matching database with NUMBER column.
HERE
select a.* from DOC a , FOLDER B where a.NUMBER= B.INCIDENT_ID and b.open = 'Closed'; I tried double quotes (“”) and sigle quotes too, none of them worked.
I have a report with 2 groups Gheader and Glines.The report looks at PO headers and lines. I want to create a data link from the the 2 queries based on the line id in po_lines_all.However I only want to select this in the lines query so I do not get repeating records at the header query.
Apex 4.2.0.00.27 I have a page with a Form region and a Classic Report region. How can I automatically save changes made in the Form when a user clicks the Edit link column in the Report? At the moment, when the user returns to the Form, any changes made there are lost.
I Have an apex page that display a modal window utilizing jquery. In the modal window I have a classic report with a link column that I want to capture its click event.
I was thinking I could create a dynamic action with selection type=jquery selector. Not for sure if I need to do anything on link column and do not know the syntax jquery selector.
I go to Report Attributes, then I click Add Column Link in the "Tasks" right menu, it adds me a column link, I just add some text for the link and a page to go to. Then I run the report and I get :
report error: ORA-01403: no data foundTested with several classic reports on multiple pages.
Debug mode shows me :
0.43816 0.00240 ...Execute Statement: select distinct [...] order by 3,11 ,4 0.44056 0.00162 print column headings 0.44218 0.04816 rows loop: 25 row(s) 0.49037 0.00141 report error: ORA-01403: aucune donnée trouvée 0.49175 0.00078 Computation point: After Box BodyWhen I run the query in my favorite tool, I get expected results.
I am trying to create a database link from the 11g database to the 10g database using: create database link ORCL10R2 connect to <username10g> identified by <password10g> using <db10g>;
It Returns Database link created.
select sysdate from dual@ORCL10R2 returns error: ERROR at line 1: ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
what changes I need to make to tnsnames and listener at both servers.