Query output doubt
Hi all,
I am running the following query.
select rawtohex(a.member), nvl(b.status, 'null'), b.group#, b.bytes from v $logfile a, v$log b where a.group#=b.group#;
Its output:
RAWTOHEX(A.MEMBER)
NVL(B.STATUS,'NU GROUP# BYTES
*2F6462326565655F686F6D655F6C6F63616C2F6F7261636C652F6F7261646174612F6F7261616978312F7265646F30312E6C6F67*
INACTIVE 1 104857600
Where the hex code means = /db2eee_home_local/oracle/oradata/oraaix1/redo01.log
Is this possible that some other version of sqlplus, the same query reports the same ansmer but without (.log) extension.
Like this: /db2eee_home_local/oracle/oradata/oraaix1/redo01
Vivek
user12059959 wrote:
Thanks for the updated query.
But I wanted to make it clear that with different versions of Oracle (sqlplus) ; we always get the .log extension.If you will use my query, it doesn't matter in what oracle(sqlplus) version that query will be executed, it will always return hex code as the representation of the member column value but without the +.log+ characters.
The reason for that is using the rtrim function.
The same applies for using your query in different versions of oracle(sqlplus);it will always produce hex code as the represenatation of the member column value but with the +.log+ characters. The reason for that would be not applying the rtrim function on the member column.
Examples:
9i
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
PL/SQL Release 9.2.0.7.0 - Production
CORE 9.2.0.7.0 Production
TNS for HPUX: Version 9.2.0.7.0 - Production
NLSRTL Version 9.2.0.7.0 - Production
SQL> select rawtohex(rtrim('/u01/app/oracle/oradata/ECRM/redo01.rdo','.rdo')) from dual;
RAWTOHEX(RTRIM('/U01/APP/ORACLE/ORADATA/ECRM/REDO01.RDO','.RDO'))
2F7530312F6170702F6F7261636C652F6F7261646174612F4543524D2F7265646F3031
SQL> select utl_raw.cast_to_varchar2('2F7530312F6170702F6F7261636C652F6F7261646174612F4543524D2F7265646F3031') from dual;
UTL_RAW.CAST_TO_VARCHAR2('2F7530312F6170702F6F7261636C652F6F7261646174612F454352
/u01/app/oracle/oradata/ECRM/redo0110g
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> select member from v$logfile where rownum < 2;
MEMBER
/u02/oradata/RING10/redo07.log
SQL> select rawtohex(rtrim(member,'.rdo')) from v$logfile where rownum < 2;
RAWTOHEX(RTRIM(MEMBER,'.RDO'))
2F7530322F6F7261646174612F52494E4731302F7265646F30372E6C6F67
SQL> select utl_raw.cast_to_varchar2('2F7530312F6170702F6F7261636C652F6F7261646174612F4543524D2F7265646F3031') from dual;
UTL_RAW.CAST_TO_VARCHAR2('2F7530312F6170702F6F7261636C652F6F7261646174612F454352
/u01/app/oracle/oradata/ECRM/redo0111g
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL>
SQL>
SQL> select member from v$logfile where rownum < 2;
MEMBER
/u01/app/oracle/oradata/ECRM/redo01.rdo
SQL> select rawtohex(rtrim(member,'.rdo')) from v$logfile where rownum < 2;
RAWTOHEX(RTRIM(MEMBER,'.RDO'))
2F7530312F6170702F6F7261636C652F6F7261646174612F4543524D2F7265646F3031
SQL> select utl_raw.cast_to_varchar2('2F7530312F6170702F6F7261636C652F6F7261646174612F4543524D2F7265646F3031') from dual;
UTL_RAW.CAST_TO_VARCHAR2('2F7530312F6170702F6F7261636C652F6F7261646174612F4543524D2F7265646F3031')
/u01/app/oracle/oradata/ECRM/redo01As you can see,
due to the rtrim function, you will always have hex code without +.log+ characters.
user12059959 wrote:
But I wanted to make it clear that with different versions of Oracle (sqlplus) ; we always get the .log extension.Geting the .log extension don't depend on oracle/sqlplus version but on formulation of your query.
To get .log extension use your query, and to get hex without the .log extension use my query.
Similar Messages
-
Hi All,
i have used CMS in SQL 2008 R2. i have added couple of servers in its group. i have executed a query & i need to send the query output in the form of email.
basically query is checking the rows count from couple of user tables in servers.
issue here is how to copy the data that is used by CMS? i need to work on automate the rows count in difft user table in db servers
could you please suggest how can i achieve this?Copy to what?
SELECT COUNT(*) FROM sys.objects
Running the above statement returns two columns (server name and count)
All the servers SS2005 and onwards , then use
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'name',
@recipients = '[email protected]',
@query = 'SELECT COUNT(*) FROM sys.objects',
@subject = 'Count rows'
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
ERROR displaying in the query output... urgetn
hi experts,
For the amount keyfigures in the query output it displaying ERROR after the amount like ex- 2000 ERROR.
plz let me know how to rectify this..
regards
vadlamudihi,
i have created only two keyfigures EMP_BASIC and EMP_HRA. and in the transformations i have mapped with 0DOC_CURRCY.
but in the report its showing ERROR only after the amount. plz tell me exactly with what field i need to map???
regards
vadlamudi -
Hello Gurus,
I am having an issue with query output.Please find below the details of it
Unsold claims: Total---> 200
Dispatch: Total--->118,086
Unsold claims/dispatch--->0.001694
This should be the output but its coming --.0033120 because itu2019s dividing with max value in dispatch which is 60,386.
Reason: The aggregation property of Dispatch is max value. I am not supposed to do any changes in Modeling. So can we do any thing at reporting level to get the desired output?
Desired output---->0.001694
Output coming---->.0033120
Please help me in getting the desired output at query level.
Regards,solved with the help of nested exception aggregation
-
Change layout of Adhoc query output list for Custom infotype
Hi All,
The fields in the Infoset query output on a custom infotype are aligned with the fields u2018payment typeu2019 and u2018amountu2019 appearing repeatedly(in columns) as declared in the Infotype and the output will be a long horizontal list.
Instead, the requirement is that the output list should show vertically so that If I choose u2018Payment Typeu2019 and u2018Amountu2019 as output fields, it will show a long vertical list as in the case of a standard infotype (IT0008).
Also, this way enables user to use Payment Type as a selection criteria so as to just pulling the needed payment type. When we use IT0008 in the infoset it works fine but in custom IT it does not work.
Any pointers/suggestions on how we can achieve this would be helpful.Hi yu liang,
You can find vendor list having Vendor No. & without showing total liability for every vendor.
after executing the report,
1.You need to select "change layout (ctrl+F8)",
a small window comes, it has two part -> column content & hidden fields.
then u select "Vendor" from hidden field & move it to column content.
2. at column content there is a column named "Total". u need to remove check for your column name "amount".
now select "copy" button or enter. u will find the req. report.
u can save it also by ur name.
hope its helpful to u.......
plz, reward points as a way of thanks if helpful... -
To download the query output to falt file
Hi all,
i have a query which i know will give more than 65k records as the output for a selection.
i cannot run this query in excel due to its limitation.
if i run on web i cannot download this as downloading is happening to excel file only.
The customer ideally wants to download the query result to a text file(csv,tab-delimited etc) which inturn it will upload to MS-Access.
How do i achieve this?
SAP has given response use try using these options:
1.open interfaces to receive the output of a query via the MDX language.
2.open hub tool as it is designed for big amounts of data.(i suppose this is not possible as i want to download query output not the data target contents)
how do i achieve my scenario with option 1?
Are there any alternatives??
Any useful help will be rewarded.
Regards,
Dhanya.hi vivek,
thnks for the useful reply.
i have some problem with my ID,hence loggin in through my coleague's ID.
i will assign u points as i get logged in.
I did as u said by downloading it to unconverted format.
the file got download to a text file.where the output has
1.header rows(10 lines almost)
2.the values r coming in single quotes e,g:
'144000023073 'TAAS SETTLEMENT CONV 738 '19333000 '30.09.2006 '0.000
how can i remove all this?
Regards,
Dhanya
I -
How to get the Query output to Excel
Hi ,
Can you tell me how to get the Query output to excel with out using any third party tool?
Can you tell me how to write the code in Webservice and call it..
Please explain it Elaboartly..
Thanks in Advance!!!
Miniwhats your source system?
you can use Live office, or query as a webservice if you are getting data from universe
if you're getting data from SAP BI query and you have a java stack on your netweaver then you can get the data directly using sap bi connector in xcelsius.
good luck -
Query Output to download in flat file through APD or other means?
Hello Experts,
I am currently on BW3.5 system and have requirement to load query output in flat file in .csv format. I checked the option of APD but looks like we cant directly load the query output in flat file like in APD (BW 3.5 system) .
One way i can think of it...load the query output in transactional ODS and built an infospoke on it to write into flat file.
Please advice if there are any better methods to store the query output in flat files.
Thanks!Hi,
Use RSCRM_BAPI.
See
Re: RSCRM_Bapi
See the help on RSCRM_BAPI
Re: Running Quaries automatically and saving them in as a Excel file in Server
Re: Data transfer to external systems
Re: Loading from a Custom R/3 Table
Re: How can I schedule my Bex report to execute in background
Re: How can I insert the RSCRM_BAPI into Process chain?
Thanks
Reddy -
How to replace # or Not assigned with blank in BEx Query Output.
Hi,
While running the query through BEx Query desginer or Anlayser, I am getting # or Not assigned where there are no values.
The requirement is to "Replace # or Not assigned with a blank" in the output.
I want to know, is there any setting in BEx query desginer where we can do this. How to do this.
Please share your inputs on this. Any inputs on this would be appreciated.
Thanks,
NaveenCheck out SDN-thread: "Re: Remove 'Not assigned'" for more details
Ideas from SDN research:
"a solution i have used is to put each RKF column in a CKF colum then in each CKF use RKF + 0, the outcome is that your # should now be 0s, in the query properties you can set the option to display 0s as blank."
"try to enter a text for the blank entry in the master data maintenance of the relevant objects and set the display option for the objects to 'text'."
Threads:
SDN: How to replace # or Not assigned with blank in BEx Query Output.
SDN: Re: Remove 'Not assigned
SDN: How to replace # or (Not assigned) with blank in BEx Query Output.
SDN: Bex Analyzer : Text element system's table ?
SDN: change message in web application designer ["nonavailable" -> 136 of SAPLRRSV]
SDN: Not Assigned ["Not Assigned -> 027 of SAPLRRSV]
SDN: replacing '#'-sign for 'not assigned' in queries
SDN: # in report when null in the cube
SDN: How to replace '#' with blank when there is no value for a date field
Edited by: Thomas Köpp on Sep 13, 2010 5:20 PM -
How to store select query output in arrays.
i created a varray type variables and now want to assign some data though select query output in pl/sql code as well as in reports 6i.
You're in the wrong forum (this one is for issues with the SQL Developer tool). You were in the right one where you posted first, but don't reuse unrelated threads as you did.
Regards,
K. -
Output mismatch between BEx query output and WebI Report output
Hi All,
I have a BEx query in which there are only characteristics placed in rows.
There are combinations of the values of the characteristics giving different records in the query output.
Date is one of the characterisctics in the query output.
There is an output mismatch between the query output and the WebI report output in the following case:
When there are 'Not Assigned' or '#' or blank values, there are additional entries(rows) in the WebI report, giving repeating or wrong entries in the Date field. This is incorrect data.
Is this because of the 'Not Assigned' or '#' or blank values of the Characteristics or is there any other reason?
How do I fix this?
Please helo me with this.
Thanks and Regards,
Srilakshmi BHi Rajesh,
I need to verify the WebI report output for records with # and 'Not assigned' values for the cHracteristics in the report.
So I cannot check the WebI report by hiding the # or Not assigned values.
The problem is that in the Query output the records are like these shown below:
Char1 CHar2 CHar3 Date field
A B C Date1
#(Not assgined) #(Not assgined) #(Not assgined) No value
Where as the WebI report output is as below:
Char1 CHar2 CHar3 Date field
A B C Date1
#(Not assgined) #(Not assgined) #(Not assgined) Date1
As shown here, there are wrong/repeating entries for the Date field in the WebI report output.
Please check this and let me know what could be the issue and how do I fix it.
Thanks and Regards,
Srilakshmi B -
Query output transfer to excel file
hi all,
how can i query output transfer to excel file ? i am not using any tool. please suggest me. is there any method that i transfer that output to excel file?You can create a csv file. See dump_csv function from Tom Kyte.
-
Want to See Selected Input Variables in the query output
Hi al
My client gives a requirment like they want to see selected variables in the query output. Like suppose if i am entering Profit center, controlling area, version, caldayas a input on the screen. Now they want to see only Profit center and version on the query result.
Please let me know if any one has this solution.
Regards,
Amit ShetyeHi
Can you please give us user requirement and according to ure requirement so we given replies . If ure requirement please explain detail
But it is not neccessary that we can put something in free char and all. Inspite of that they wanted to select the input variable as per their requirement. They dont want to restrict them in Free char. -
Hello Experts,
Recently we have upgraded the system and we are facing issues with Ad-Hoc query output.
Issue : After entering data in selection fields and click on "OUTPUT" button we are getting output. now I changed the selection field data and click on "OUTPUT" button then we are getting message "No Data selected".
But when clicked on "HIT LIST" button for changed selection fields then we are getting HIT LIST count and after click of "OUTPUT" button we are getting output.
So at this point this is unclear why it is working after HIT LIST? This is not consistent but appearing most of the time.
Regards,
SaurabhThank you for reply. Yes I have checked SQ03, 02 and 01.
It is not specific to particular query it is appears to be for all the queries.
The important thing is to get the output we need to click first HIT LIST button and then OUTPUT. Is there any specific settings maintained for displaying output without clicking HIT LIST ? -
SAP Query output download to Excel
Hi All,
Once I export/download Query Output to Excel the fields are not in the order of Actul Query output
<u><i><b>Char fields are treated as Key fields and displayed Left side.</b></i></u>
As it is a SAP Query where to keep this kind of setting(key columns = 0).?
Thanks in advance and useful answer will be awarded.
cheers!!
Komatsuwhen u download data to excel sheet, u can't handle the data from SAP....The data in excel takes excel properties and accordingly data gets adjusted to the formats of excel.
If u need formatting u need to use OLE concepts in SAP from which u can set the formats of Excel Sheet.
Maybe you are looking for
-
Another problem with "plxcore.plx"... what the hell is it f
ahoi! i have the audigy2 zs. as i had problems with my 3d sound i reinstalled my sounddrivers, i got this problem about "plxcore.plx wasn't found blah blah", i used google and read how to fix it, next time i reinstalled driver i copied the file into
-
Windows 8.1 (w/OSX 10.9.1)
Please post your results using bootcamp and Windows 8.1 on 2013 model Mac Book Pro now that 10.9.1 has been released. Please include the following minimum information in your post below. Windows Type: Retail or OEM Windows Platform: 32bit or 64bit (y
-
Nano seem to hang up my startup menu. If I unplug the ipod windows boots. When I plug it in after booting it seems OK. Itunes will not allow me to dump music from the ipod to library keeps giving me a not authorized message even though I have gone th
-
How to add a table (J2ME CDC)
Is there a way to add a table? I am using Eclipse IDE & IBM J9 ( Personal Profile 1.1, FP 1.1, CDC 1.1) Thanks in advance.
-
hello all, I have a zen v plus (obviously) and am very happy with it. it has more than enough memory for my uses and is ideal for me. Im not into the whys and wherefors of every detail of the thing as I only want to listen to music with it. the one p