Error in the Query
I have 2 tables which I want to join ..........one is I_Sales and Other is I_Cost_Center
......now the common columns in both the tables are cost_center........
Now in this Sales table ,There is a column Showroom_code.
for only one showroom there are values in cost_center column in i_sales table......and rest for all other showrooms there are null values.............
Now i Am using This Query
Select i_Sales.showroom_code,i_Sales.net_amt,i_cost_center.name
from i_Sales ,i_cost_center
where nvl(i_sales.showroom_code,'%') like nvl(&p_showroom,'%') and
i_cost_center.cost_center = i_sales.cost_center
Now when i Am giving one showroom Sr1 which is Having cost_center in i_sales,then this query is giving me records........
But for other showrooms where cost_centers values are null ,it is not giving me any records..............
it should give me records from sales table,keeping name column as blank
How to post a Question.
1. New features keep coming in every oracle version so please provide your Oracle DB Version to get the best possible answer.
You can use the following query and do a copy past of the output.
select * from v$version 2. We dont know your DB structure or How your Data is. So you need to let us know. The best way would be to give some sample data like this.
I have the following table called sales
with sales
as
select 1 sales_id, 1 prod_id, 1001 inv_num, 120 qty from dual
union all
select 2 sales_id, 1 prod_id, 1002 inv_num, 25 qty from dual
select *
from sales 3. Rather than telling what you want in words its more easier when you give your expected output.
For example in the above sales table, I want to know the total quantity and number of invoice for each product.
The output should look like this
Prod_id sum_qty count_inv
1 145 2 4. Next thing is a very important thing to remember. Please post only well formatted code. Unformatted code is very hard to read.
Your code format gets lost when you post it in the Oracle Forum. So in order to preserve it you need to
use the {noformat}{noformat} tags.
The usage of the tag is like this.
<place your code here>\
Similar Messages
-
I have an package with source , data flow and destination to execute on begin and commit.
in the below i have just used for questioning purpose with diagram removing my Data Flow task explaining my problem
on execution, i get error as
[Execute SQL Task] Error: Executing the query "COMMIT TRAN DimCompanyCode" failed with the following error: "The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.". Possible failure reasons: Problems with the query, "ResultSet"
property not set correctly, parameters not set correctly, or connection not established correctly.
as mentioned , i have checked the ResultSet, parameters , connection establish.. all are fine.
Kindly advice on what has to be done.
ShanmugaRajTo avoid this error, the RetainSameConnection property should set to 'True' for the Connection Manager - Application_DB.
Narsimha -
Hi
DECLARE @XMLA nvarchar(3000)
, @DateSerial nvarchar(35);
-- Change date to format YYYYMMDDHHMMSS
SET @DateSerial = CAST(GETDATE() AS DATE);
--SELECT @DateSerial
Set @XMLA =
N' <Batch xmlns="http://schemas.microsoft.com/analysis services/2003/engine">
<ErrorConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"
xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200"
xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200">
<KeyErrorLimit>-1</KeyErrorLimit>
<KeyNotFound>IgnoreError</KeyNotFound>
<NullKeyNotAllowed>IgnoreError</NullKeyNotAllowed>
</ErrorConfiguration>
<Parallel>
<Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"
xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200"
xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300">
<Object>
<DatabaseID>MultidimensionalProject5</DatabaseID>
<CubeID>giri</CubeID>
<MeasureGroupID>Fact Internet Sales</MeasureGroupID>
</Object>
<Type>ProcessFull</Type>
<WriteBackTableCreation>UseExisting</WriteBackTableCreation>
</Process>
</Parallel>
</Batch>';
EXEC (@XMLA) At SHALL-PCAdventureWorksDw ;
iam executive the query when iam getting below error.
[Execute SQL Task] Error: Executing the query "DECLARE
@XMLA nvarchar(3000)
, @DateSerial nvarch..." failed with the following error: "Incorrect syntax near '-'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set
correctly, or connection not established correctly.
how to solve this error;
please help meWhat are you trying to do? What sort of data source is SHALL-PCAdventureWorksDw?
When you use EXEC() AT, I would execpt to see an SQL string to be passed to EXEC(), but you are passing an XML string????
If you explain why you think this would work in the first place, maybe we can help you.
Erland Sommarskog, SQL Server MVP, [email protected] -
create table my_employee
(id number(4)primary key,
last_name varchar2(25),
first_name varchar2(25),
userid varchar2(8),
salary number(9,2)
I want to write an INSERT statement to MY_EMPLOYEE table . Concatenate the first letter of the first name and first seven characters of the last name to produce user ID using a single sql statement
I wrote the query like this and i am getting logical error
insert into my_employee
values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),&salary);
SQL> insert into my_employee
2 values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),&sal
ary);
Enter value for id: 20
Enter value for last_name: popopopp
Enter value for last_name: qwertyyuu
Enter value for salary: 300000
old 2: values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),
new 2: values(20,'popopopp','o',substr('o',1,1)||substr('qwertyyuu',1,7),300000)
1 row created.
it is asking the last_name two timesyou can do it with a .sql script
c:\my_emp.sql
PROMPT
PROMPT instering my_employees
PROMPT
ACCEPT ID NUMBER PROMPT 'ID ? : '
ACCEPT FIRST_NAME CHAR PROMPT 'FIRST_NAME ?: '
ACCEPT LAST_NAME CHAR PROMPT 'LAST_NAME ?: '
ACCEPT SALARY NUMBER PROMPT 'SALARY ? : '
insert into my_employee values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),&salary);
SELECT * FROM my_employee where id=&&id;
and then from sqlplus @c:\my_emp.sql
scott@ORCL> @C:\MY_EMP
instering my_employees
ID ? : 20
FIRST_NAME ?: john
LAST_NAME ?: papas
SALARY ? : 1000
old 1: insert into my_employee values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),&salary)
new 1: insert into my_employee values( 20,'papas','john',substr('john',1,1)||substr('papas',1,7), 1000)
1 row created.
old 1: SELECT * FROM my_employee where id=&&id
new 1: SELECT * FROM my_employee where id= 20
ID LAST_NAME FIRST_NAME USERID SALARY
20 papas john jpapas 1000
scott@ORCL> -
Error executing the Query after deploying and executing the application in WLS 6.1 SP3
Hi,
We are trying to run a application by deploying a war file on Web Logic Server
6.1 SP3. After deploying and at the time of execution of the application, the
server console displays this error message
java.sql.SQLException: ORA-00600: internal error code, arguments: [ttcgcshnd-1],
[0], [], [], [], [], [], []
While debugging thru the application we found that this error comes at the time
of execution of the query thru the Statement.executeQuery method of java.sql.Statement
class.
This same application when deployed on Web Logic Server 8.1 runs perfectly, without
any hitches.
Please, provide me the solution to this asap.Look for sometime around November. No exact date.
Eric
"Dominic Tulley" <[email protected]> wrote in message
news:[email protected]..
Thanks Eric,
you know what I'm going to ask next right?
Any ideas when SP4 comes out?
Cheers,
-Dominic
"Eric Gross" <[email protected]> wrote in message
news:[email protected]..
The next version of Apache that we will support will be 2.0.42/2.0.43
and
the module for that will be included in the next Service Pack for6.1(SP4)
and 7.0(SP2).
The problem with Apache 2 is that when a new release comes out a newmodule
needs to be compiled. Most of the time. For 2.0.42/2.0.43 this is notthe
case.
Regards,
Eric
"Dominic Tulley" <[email protected]> wrote in
message
news:3da3f246$[email protected]..
I'm trying to set this up (initially just apache in front of a single
WLS
server but ultimately I want to put it in front of a cluster).
I've installed Apache 2.0.40.
I've copied the mod_wl_20.so file into the apache modules folder.
I've edited the httpd.conf file and added the line:
LoadModule weblogic_module modules/mod_wl_20.so
When I run apache -t to check the configuration I get the following:
C:\Program Files\Apache Group\Apache2\bin>apache -t
Syntax error on line 173 of C:/Program Files/Apache
Group/Apache2/conf/httpd.conf:
Cannot load C:/Program Files/Apache Group/Apache2/modules/mod_wl_20.sointo
server: The specified procedure could not be found.
So what's going on here?
Looking at previous postings it sounds like there's an issue with
versions
of apache after 2.0.39 but I can't find a download for that version.Also,
it sounded like the issues were for WLS 7, not 6.1. Can this work
with
2.0.40 or am I wasting my time?
If I get the mod_wl_20.so from dev2dev I get the "incompatible plugin"
message that has been mentioned in this group already.
Any suggestions appreciated,
-Dominic -
Dear All,
Please tell me syntax error in the below query. When I'm going to write numeric number in this filed "$[ OVPM.DocNUm ]". It's working fine. But when I'm writing this it give me error.Please clear me where am wrong????I
SELECT T0.[AcctNum] FROM VPM1 T0 WHERE T0.[DocNum] =$ [OVPM.DocNUm ]
Regards
Edited by: Anwar Ali Sohail on Sep 27, 2011 11:43 AMHI
Try This
SELECT T0.[CheckNum] FROM VPM1 T0 INNER JOIN OVPM T1 ON T0.DocNum = T1.DocEntry WHERE T0.[DocNum] = $[OVPM.DocNum]
OR
SELECT T0.[AcctNum] FROM VPM1 T0 INNER JOIN OVPM T1 ON T0.DocNum = T1.DocEntry WHERE T0.[DocNum] = $[OVPM.DocNum]
Edited by: kambadasan on Sep 27, 2011 4:26 PM -
Dear All,
I am using the following in a PL/SQL Before Header process.
Please help me with the following :
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B ('LEASE', 'SELECT LSE_NUM
FROM RE_LEASE
WHERE LSE_COM_NUM = :P0_COM_NUM');I am getting the following error:
ORA-20104: create_collection_from_query_b Error:ORA-20104: create_collection_from_query ExecErr:ORA-01008: not all variables bound
If I change the above as
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B ('LEASE', 'SELECT LSE_NUM
FROM RE_LEASE
WHERE LSE_COM_NUM = ' || :P0_COM_NUM);Then I get the following error :
ORA-20104: create_collection_from_query_b Error:ORA-20104: create_collection_from_query ParseErr:ORA-00936: missing expression
I am using the above to create Next and Previous buttons using the reference provided by ATD in the Re: How to do page break
Note: If I do not use any Items in the WHERE as below then I do not get any errors and it works as required.
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B ('LEASE', 'SELECT LSE_NUM
FROM RE_LEASE');I want to use Items in the query for the collection. Please help.
Best Regards
Arif KhadasHi Jari,
Thanks Jari for the reply. Your solution does work as well but please if you can throw some more light on q'! (first line) and !' (last line).
q'!
SELECT LSE_NUM
FROM RE_LEASE
WHERE LSE_COM_NUM = (SELECT v('P0_COM_NUM') FROM DUAL)
!'Best Regards
Arif Khadas -
Data Error in the Query/Report after selective data deletion for infocube
Hi Experts,
Please advise what i was missing and what went wrong...
I got a Query (Forecast) on a Multicube...which is based on 2 Infocubes with Aggregates...
As i identified some data discrepency..yesteraday i performed selective data deleation on one of the Infocube
and executed report yesteraday and the results in the query are correct...
When today i executed the same report i am getting different results..
When i compared the results of the report with that of data in cube they are not matching
The report is not displaying the data in cube..for some rows it is displaying the data in the cube but for some rows it is just displaying same as the above row
there is no data loaded into info cube after selective deleation
Do i need to perform request compression and fill the aggregated after selective deleation
Please advise what went wrongHi Venkat,
No i haven't done anything on aggregates before or after selective delete
As there is not data load after the selective delete according to SAP Manual we don't need to perform any thing on aggregates...as selective data deletion on cube will delete data from aggregates as well
Please update how to identify error -
Data Error in the Query Output
Hi Experts
Could you please advise me how to proceed.....and impact of Aggregates
I had a Query based on a Multicube which in turn is based on 4 Infocubes
IC1-North,
IC2-South,
IC3-EAST,
IC4-WEST.
I had Aggregates developed on
IC1-North,
IC2-South,
IC4-WEST.
Data is loaded according to Location to the respective cubes
When i execute query based on Multicube...in the variable screen i had a user entry variable...when i select the drop down list of avaliable Location...the list doesn't contain EAST as a Location ID and also when i execute the query with out location it is not displaying IC3-EAST data in the output
Could you please update me ...what might be the reason of the problem and how to proceed
ThanksHi Venkat,
No i haven't done anything on aggregates before or after selective delete
As there is not data load after the selective delete according to SAP Manual we don't need to perform any thing on aggregates...as selective data deletion on cube will delete data from aggregates as well
Please update how to identify error -
Hi all,
I am using a query that has about 12 select clauses in the main Select clause and also other independent columns. I am also using order by for one of the independent column. i am getting an error ORA-01427 - Single subquery returns more than one row.How to resolve this issue. If order by is removed it works. But order by is mandatory here.
ThanksHi!
Please post your query. Without your query I couldn't give you a precise answner. But I guess that your problem is that you've used a single row operator like = in a WHERE-Clause where you get more then one row. Try using somithing like IN, SOME, ANY ...
Hope this helps!
regards -
I have the following query and it is giving me error messages.
select lpad(name,20,’ ‘)||’ = ‘||value xn2, value xv2
from v$sysstat
where name = ‘consistent gets’
11:27:14 Processing ...
11:27:14 select lpad(name,20,’ ‘)||’ = ‘||value xn2, value xv2
11:27:14 *
11:27:14 ORA-00911: invalid character11:27:14 *** Script stopped due to error ***
11:27:14 *** SCRIPT END : Session:SYSTEM@PPRD-SV(1) 14-Mar-2008 11:27:14 ***
11:27:14 End SQL Editor Execution>
11:27:14 Processing ...
11:27:14 select lpad(name,20,’ ‘)||’ = ‘||value xn2,
value xv2
11:27:14 *
11:27:14 ORA-00911: invalid character11:27:14
*** Script stopped due to error ***
1:27:14 *** SCRIPT END : Session:SYSTEM@PPRD-SV(1)
14-Mar-2008 11:27:14 ***
:27:14 End SQL Editor Executionworks for me:
test@ORA10G>
test@ORA10G>
test@ORA10G> select lpad(name,20,' ')||' = '||value xn2, value xv2
2 from v$sysstat
3 where name = 'consistent gets'
4 /
XN2 XV2
consistent gets = 215019 215019
test@ORA10G>
test@ORA10G>
test@ORA10G>Maybe you want to check if those are indeed single quotes.
pratz -
Please tell me the error in the query
select last_name,hire_date,
trunc(months_between(sysdate,hire_date)/12) years,
trunc (months_between(sysdate,hire_date)/60) "years divided by 5"
CASE trunc(months_between(sysdate,hire_date)/60)
WHEN 0 then 'intern'
WHEN 1 then 'junior'
WHEN 2 then 'intermediate'
WHEN 3 then 'senior'
ELSE 'furniture'
END loyalty
FROM employees
where department_id in (60,10)use this query u have missed the (,) in years divided by 5
select last_name,hire_date,
trunc(months_between(sysdate,hire_date)/12) years,
trunc (months_between(sysdate,hire_date)/60) "years divided by 5",
CASE trunc(months_between(sysdate,hire_date)/60)
WHEN 0 then 'intern'
WHEN 1 then 'junior'
WHEN 2 then 'intermediate'
WHEN 3 then 'senior'
ELSE 'furniture'
END loyalty
FROM employees
where department_id in (60,10)kanish -
hi,
i have an anonymous block like
declare
type table_x is TABLE of temp_x%rowtype INDEX BY BINARY_INTEGER;
temp_table_x table_x;
BEGIN
select * into temp_table_x from temp_x;
END;
but when i try to run it, i get an error as follows:
ORA-06550: line 7, column 15:
PLS-00597: expression 'TEMP_TABLE_X' in the INTO list is of wrong type
ORA-06550: line 7, column 28:
PL/SQL: ORA-00904: : invalid identifier
ORA-06550: line 7, column 1:
PL/SQL: SQL Statement ignored
Any idea why?
Thanks,
ARR
Message was edited by:
arrBULK COLLECT INTO is missing:
SQL> ed
Wrote file afiedt.buf
1 declare
2 type table_x is table of emp%rowtype index by binary_integer;
3 temp_table table_x;
4 begin select * into temp_table from emp;
5* end;
SQL> /
begin select * into temp_table from emp;
ERROR at line 4:
ORA-06550: line 4, column 21:
PLS-00597: expression 'TEMP_TABLE' in the INTO list is of wrong type
ORA-06550: line 4, column 32:
PL/SQL: ORA-00904: : invalid identifier
ORA-06550: line 4, column 7:
PL/SQL: SQL Statement ignored
SQL> ed
Wrote file afiedt.buf
1 declare
2 type table_x is table of emp%rowtype index by binary_integer;
3 temp_table table_x;
4 begin select * bulk collect into temp_table from emp;
5* end;
SQL> /
PL/SQL procedure successfully completed. -
Hi,
I was using OBIEE 10.1.3.3.3 /. After upgrading to 10.1.3.4.2 , the queries are not running ( long running queries alone) as expected. and so all the campaigns iwh tlong running queries are cancelled and the error message is seen in the xml log in Marketing jobs management.
We have upgraded the OBIEE version from 10.1.3.3.3 to 10.1.3.4.2 yesterday after which the connectivites have been checked with SQLPLUS and they are working fine. But when the campaign has been loaded, the Analytics have received the request for the segment query and after longer run, the task has been cancelled with the error message "The Query was cancelled as mentioned below in the Job Stats
<jobStats>
<jobID>2</jobID>
<jobType>WriteListFiles</jobType>
<jobUser>userid</jobUser>
<jobState>Error</jobState>
<jobTotalMilliSec>1h 41m 21s 160ms</jobTotalMilliSec>
<jobStartedTime>2012-03-22T08:06:13Z</jobStartedTime>
<jobFinishedTime>2012-03-22T09:47:34Z</jobFinishedTime>
<jobIsCancelling>N</jobIsCancelling>
- <exception>
<message>Job request of type "WriteListFiles" failed.</message>
- <exception>
<message>Error executing the list generation SQL.</message>
- <exception>
<message>Error in executing cursor for WorkNode (Id:0)</message>
- <exception>
<message>The query was cancelled.</message>
</exception>
</exception>
</exception>
</exception>
</jobStats>
Please let us know the suggestions
So far, the unaccessedtimingrunoutminutes tag has been tried to set 50 under ODBC tag in instanceconfig.xml. and the defaulttimeoutminutes has been tried to set to 150 in the same instanceconfig.xml.
along with that the rpd changes are done. For all the users apart from the Administrator, the timeout has been changedfrom 10 minutes to 150 minutes. But still that way is not working.
The segments was fired with the Administrator login. So , if the timeout for admin login can be set, i assume that the problem might be solved. Please let us know ur suggestions here too.
If that is the case, when we open rpd , only for Administrator user and group, the Permissions button is disabled. So i want to know how to change for Admin user settings in rpd..
Please advice us on the same.
Regards,
Madasamy M.
Edited by: Madasamy Murugaboobathi on Mar 26, 2012 1:40 PMThe issue has been resolved by setting the following parameters
<UnaccessedRunningTimeoutMinutes>120</UnaccessedRunningTimeoutMinutes>
<DefaultTimeoutMinutes>120</DefaultTimeoutMinutes>
<ClientSessionExpireMinutes>120</ClientSessionExpireMinutes>
<ConnectionExpireMinutes>120</ConnectionExpireMinutes>
<UIDefaultTimeoutMinutes>1440</UIDefaultTimeoutMinutes> -
Error in the Dynamic query in AME
Hi Experts,
I am using the below query but i am facing the error "Ensure the query selects exactly 1 column" in AME Approval group under Dynamic query.
But the query returns only one column when i ran in toad.
select 'person_id:'||a.person_id from
(SELECT to_number(EXTRACT(column_value,'/e/text()')) person_id
from (select (XXSYK_GET_PERSON_ID(:transactionId)) col1 from dual) x,
TABLE(XMLSEQUENCE(EXTRACT(XMLTYPE('<ROW><e>'||REPLACE(col1,',','</e><e>')||'</e></ROW>'),'//e')))
)A
Thanks,
SadeeshThanks !!!!
Maybe you are looking for
-
Error while transforming XSLT,"Could not compile stylesheet"
Hi, During transformation of my XSLT I needs to fetch data from method named *"myMethod(String str)"*, which is in *"mypackage.test.MyClass"* class. MyClass is in{color:#000000} XXX.jar. {color} This XXX.jar is not in context of my web application.*
-
Flex 2 and Actionscript 3 Workshop in LA
It's a late notice, but important to any Flash professional out there. I just want everyone to know about this rare opportunity. Fly out to LA if you have to! Flex Builder 2 & Action Script 3 Training Workshop Date: Thu, Fri, & Sat, May 11,12, & 13 (
-
Idle users and away users both are shown with red blip
Hi, In my ichat (even when I was using tiger) I can see only two status for all my buddies. Its either green or red. I am not able to get the yellow for idle buddies. Any ideas how to get the yellow ones to work? Thanks
-
Emailbody using SQL: Align Table with Headers
I have a requirement, Where I need to align header and table contents , as a part EMAIL body in HTML format. I'm getting the resultset from a table. Here is the output Rows in these Columns have following maximum length: Table Name :Maximum length of
-
Hi All, Environment - Production and Disaster Recovery Centre have a active passive cluster on solaris 10. Oracle version - Oracle 11gR2. Want to Set up Physical Standby and configure a DG Broker to manually manage the DG. I have gone through the ste