I have done a create or replace view called creditcard1. If I do a "select * from creditcard1" it retrieves the data just fine. If I try to do a statement where I am listing the column names it doesn't recognize them.
create or replace view creditcard1 as
select
pidm
,tbraccd_term_c ode as "Term"
,tbraccd_detail _code as "Detail_Cod e"
,tbbdetc_desc as "Detc_Desc"
,tbraccd_tran_n umber as "Tran_Numbe r"
,DECODE(tbbdetc _type_ind, 'C', tbraccd_amount, 0.00) as "Charge_Amo unt"
,DECODE(tbbdetc _type_ind, 'P', tbraccd_amount, 0.00) as "Payment_Amount "
,tbraccd_activi ty_date as "Activity_D ate"
,tbraccd_desc as "TBRACCD_DE SC1"
,MAX (tbracct.TBRACC T_DETC_EFF_DATE )
KEEP (DENSE_RANK LAST order by (tbracct.TBRACC T_DETC_EFF_DATE )) max_detc_eff_da te
from creditcard, tbraccd, tbbdetc, tbracct
where pidm = tbraccd_pidm
and tbr_chg_tran_nu m = tbraccd_tran_nu mber
and tbbdetc_detail_ code = tbraccd_detail_ code
and pidm = '20'
and tbraccd_detail_ code = tbracct_detail_ code
group by
pidm
,tbraccd_term_c ode
,tbraccd_detail _code
,tbbdetc_desc
,tbraccd_tran_n umber
,DECODE(tbbdetc _type_ind, 'C', tbraccd_amount, 0.00)
,DECODE(tbbdetc _type_ind, 'P', tbraccd_amount, 0.00)
,tbraccd_activi ty_date
,tbraccd_desc
order by pidm, tbraccd_tran_nu mber
Then I try to run:
create or replace view creditcard2 as
select
creditcard1.pid m
,creditcard1.Te rm
,creditcard1.De tail_Code
,creditcard1.De tc_Desc
,creditcard1.Tr an_Number
,creditcard1.Ch arge_Amount
,creditcard1.Pa yment_Amount
,creditcard1.Ac tivity_Date
,creditcard1.TB RACCD_DESC1
,creditcard1.ma x_detc_eff_date
,tbracct_b_fund _code as "Charge_Fun d"
,tbracct_b_orgn _code as "Charge_Org n"
,tbracct_b_acct _code as "Charge_Acc t"
from creditcard1, tbracct
where creditcard1.Det ail_Code = tbracct_detail_ code
and creditcard1.max _detc_eff_date = tbracct_detc_ef f_date
and get this error message:
ORA-00904: "CREDITCARD1"." DETAIL_CODE":in valid identifier
I have checked the spelling - in fact I just did a cut and paste so there wouldn't be spelling errors. When I do the "select * from creditcard1" it lists the column name of "Detail_Cod e" - the same column that the error message says doesn't exist. If I try just a select statement instead of "create or replace view creditcard2 as", I get the same error. The creditcard1 view is coming from a view I did called creditcard and it didn't have any problems recognizing the column names from the original view of creditcard.
If I comment out the where clause, it just gives the same error on a different column name - if I comment out that column name, then it errors on the next column name.
I am using SQL through TOAD against an Oracle 9i database.
Any ideas on why it won't recognize the columns from the view I created?
I am doing the creditcard2 view to pull in additional data for tbracct_b_fund_ code, tbracct_b_orgn_ code and tbracct_b_acct_ code because I was getting multiple rows in the results that I didn't want. In the table TBRACCT there can be multiple rows per tbracct_detail_ code. I only want to choose data from the row with the most recent tbracct_detc_ef f_date. The MAX statement does that, but if I also select tbracct_b_fund_ code in the same statement, it pulls a row for each different value that exists in tbracct_b_fund_ code (even if the tbracct_detc_ef f_date is not the most recent). So - if there was some way to code the creditcard1 view to also include tbracct_b_fund_ code, tbracct_b_orgn_ code and tbracct_b_acct_ code without getting the duplicate data that would be helpful also.
Thanks,
Wendy Hope
2 8936
I found the answer to my problem from another source, but thought I would post it here in case it could benefit someone else:
"I think the problem is in your use of explicit capitalization in the aliases for the columns of your views. Once you put double quotes around a column alias you must put double quotes around any reference to it and match the capitalization exactly from then on. So you must change all your WHERE clauses and any GROUP BYs or ORDER BYs... As a matter of coding style I would recommend leaving off all the double quotes; then by default the Oracle SQL engine will promote all references to upper case making coding much easier."
i am getting a major problem in running shell script by using dbms_scheduler package. if i write only echo in the shell script then it is running but if i want to execute normal linux command like 'ls -l' , 'chmod' etc , shell script is not executing properly. if possible then pls help me.
I found the answer to my problem from another source, but thought I would post it here in case it could benefit someone else:
"I think the problem is in your use of explicit capitalization in the aliases for the columns of your views. Once you put double quotes around a column alias you must put double quotes around any reference to it and match the capitalization exactly from then on. So you must change all your WHERE clauses and any GROUP BYs or ORDER BYs... As a matter of coding style I would recommend leaving off all the double quotes; then by default the Oracle SQL engine will promote all references to upper case making coding much easier."
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: John |
last post by:
Hi
Right password -> ORA-12154: TNS:Could not resolve service name
wrong password => ORA-01017: invalid username/password; logon denied
Tested on a Windows XP client connecting to Oracle on an AIX server.
Using toad and sqlplusw
Everything working fin connecting to other 8.1.7 Oracle servers on windows
|
by: Ping |
last post by:
Where can i find the initialization file to change some parameters? This file
used to be init<sid>.ora in previous versions of oracle.
Oracle 9.2 on xp is in question.
Thanks in advance
Ping
|
by: Adam Ruth |
last post by:
I'm using OCI on Mac OS X and I've run into a strange problem with my
TNSNAMES.ORA file.
My TNSNAMES.ORA file has one entry INV4II and it works fine. However,
it will only work if that is the name of the entry. If I use any
other name for that entry I get the dreaded ORA-12154. For example:
TNSNAMES.ORA -> INV4II Application -> INV4II :: works fine
TNSNAMES.ORA -> INV4DEV Application -> INV4DEV :: ORA-12154
TNSNAMES.ORA -> INV4DEV...
|
by: bdj |
last post by:
Hello!
I have at set of tnsnames.ora. I wich to make an union, e.g. a single file
of it.
How can I do that easy?
Greetings
Bjørn
|
by: Paul Green |
last post by:
What might cause the following behavior?
We have a set of front-end programs accessing an Oracle database on
the server.
Things work fine on our older computers and mostly OK on our new
computers - except one particular program, after being used for a few
minutes gives errors like ORA-12571, ORA-03114.
This suggests the network is disconnected, but tnsping shows the
Oracle DB is still there, and the other programs in the suite still
work.
| |
by: jstmehr4u3 |
last post by:
I just installed ODP.net 10.2.02 on my local machine (Windows XP Pro)
running IIS.
I have created a sample webservice in VS2003, connecting to localhost.
I am getting:
Oracle.DataAccess.Client.OracleException ORA-12154: TNS:could not
resolve the connect identifier specified at
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src,...
|
by: Dwie |
last post by:
Dear All,
I'm a new in Oracle DB. I'm using Windows 2000 as server and Windows XP as client. I installed Oracle Enterprise on server and Oracle 8.1 on clients.
I have some client with 2 different IP address, 172.16.xx.xx and 192.168.xxx.xx whices I want to connect to the server DB. How can I set the Listener.ora & Tnsnames.ora so all clients could connect to server. Right now I can connect just only one IP and the other IP is offline, but...
|
by: lrg |
last post by:
I'm writing an application in ASP.NET using C# for code behind and i'm also using oracle 10g. I thought when i retrieve data from the DB first tnsnames.ora is referred. But my experience is that server name given in web.config is directly connected whether or not entry is present in tnsnames.ora. Then why do we need a tnsnames.ora?
|
by: Nitvar |
last post by:
When i am trying to connect to oracle it is giving me these two errors
ORA-12224: TNS:no listener
ORA-01034: ORACLE not available
I am new to oracle ,plz help
I am using solaris 5.6 and oracle 8.0.5 version
I am posting my listener.ora and Tnsname
|
by: bacterium |
last post by:
Hi,
Is there any way to solve the question :'ORA-12154: TNS:could not resolve service name' ,I import database in Oracle , but I can not logon into the database , while login through the SQL PLUS, it notes 'ORA-12154: TNS:could not resolve service name', I configured at net8s configure assistant , at the end it notes : ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor. but on the file tnsnames.ora :
KANKYO =
...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |