I have a table with 6 locations with staff allocated to an office. How do I display them in a table windows forms with the column name but not display if empty. If I had the following.
office1 office2 office3 office4 office5 office 6
------- ------- ------- ------- ------- --------
Dave Bob Ed
Alan Jeff John
Tom
Related
I get 0 rows in the results I use
SELECT * from V$RECOVERY_FILE_DEST
V$RECOVERY_FILE_DEST is a default table name for the oracle Flash recovery area.
Does this mean that a Backup never happens on this platform or Flash recovery area name is different from the default? If yes, then how can I locate the Flash Recovery area on Oracle Database if yes?
V$RECOVERY_FILE_DEST shows target OS or ASM directories, as specified in the db_recovery_area_dir initialization parameter, which are designated to contain flash recovery area files. If there is nothing visible in the table, confirm the setting of the initialization parameter. If both are null/empty, then there is no Flash Recovery Area defined for the database.
select * from v$recovery_file_dest;
NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES CON_ID
----- ----------- ---------- ----------------- --------------- ----------
+RECO 1.3980E+10 8989442048 0 5 0
show parameter db_recovery
NAME TYPE VALUE
-------------------------- ----------- ------
db_recovery_file_dest string +RECO
db_recovery_file_dest_size big integer 13332M
I selected every details customers tables in the Order Entry Schema but my data isn't ordered. How do i make the table presentable making every column and row clear to read and understand
I used the query select * from oe.customers and below is how my data was retrieved and makes it quite difficult to read.
CUSTOMER_ID CUST_FIRST_NAME CUST_LAST_NAME
----------- -------------------- --------------------
CUST_ADDRESS(STREET_ADDRESS, POSTAL_CODE, CITY, STATE_PROVINCE, COUNTRY_ID)
--------------------------------------------------------------------------------
PHONE_NUMBERS
--------------------------------------------------------------------------------
NLS NLS_TERRITORY CREDIT_LIMIT
--- ------------------------------ ------------
CUST_EMAIL ACCOUNT_MGR_ID
---------------------------------------- --------------
CUST_GEO_LOCATION(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_OR
--------------------------------------------------------------------------------
DATE_OF_B MARITAL_STATUS G INCOME_LEVEL
--------- -------------------- - --------------------
25-MAY-44 single F A: Below 30,000
CUSTOMER_ID CUST_FIRST_NAME CUST_LAST_NAME
----------- -------------------- --------------------
CUST_ADDRESS(STREET_ADDRESS, POSTAL_CODE, CITY, STATE_PROVINCE, COUNTRY_ID)
--------------------------------------------------------------------------------
PHONE_NUMBERS
--------------------------------------------------------------------------------
NLS NLS_TERRITORY CREDIT_LIMIT
--- ------------------------------ ------------
CUST_EMAIL ACCOUNT_MGR_ID
---------------------------------------- --------------
CUST_GEO_LOCATION(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_OR
--------------------------------------------------------------------------------
DATE_OF_B MARITAL_STATUS G INCOME_LEVEL
--------- -------------------- - --------------------
Image showing the problem
First off, if you're just running ad hoc queries, you probably don't want to be using SQL*Plus. You're almost certainly better off downloading SQL Developer which is an actual GUI that presents query output in a nice, GUI fashion.
SQL*Plus was designed back in a time when reporting generally meant generating fixed width output that would get spooled to a physical printer every morning and generate hundreds of pages of output on green bar paper that would get distributed to various humans in the company to review. So you need to think like an old school report developer.
First, you need to figure out how wide your output window is and set your linesize appropriately. If your output window is, say, 120 characters wide, you'd start with
set linesize 120
Now, you have to figure out how much space out of those 120 character that you want to give each column of your output knowing that larger string values will wrap within the column. So if you want to allow 15 characters for the customer first and last name
column cust_first_name format a15;
column cust_last_name format a15;
You'd need to do that for each column you're outputting. Realistically, it probably doesn't make sense to select a geographic location from SQL*Plus, you'd want to select components of that composite object.
I want to follow SQL transaction in Oracle. We have a software tool with 10g oracle system. The program is slowing down somewhere and I want to find that part. I could not see the event log. What do you think i can do? Is there a 3rd party software?
Thanks.
Oracle offers tracing tools. See documentation - Using Application Tracing Tools in the Performance Tuning Guide.
It is the TKPROF which is reliable and will show you exactly what is going on when you use the application, along with timings so - once you examine the result - you'll be able to do further steps and tune your code.
Sample output (just to show what I'm referring to):
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 29.60 60.68 266984 43776 131172 28144
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 29.60 60.68 266984 43776 131172 28144
^^^^^
This!
So, if you find that something takes a minute (60 seconds, right?) to complete, that might be suspicious.
I have two database tables users and activity_log with dummy records as below:
Table users
id name
1 Michael
2 Joseph
Table activity_log
id user_id activity
1 --- 1 ---------- you received $30 from Joseph
2 --- 1 ---------- you withdrew $20
My problem is that, I don't want to hard-code the name Joseph in the activity since the user might change his name in the future. I want when user 2 changes his name from Joseph, user 1 activity log will be updated accordingly with the new name.
As an example, I need activity log similar to that of Facebook where for example Michael can see in his activity log 'you liked Joseph's photo'. If Joseph changes his name to Jose, Michael will see in his activity log 'you liked Jose's photo'. How can I achieve that?
Thank you in advance.
You can just save the user_id into the activity_log table and then reference it when rendering the message.
activity_log should contain id, owner_id, target_id, and activity_type.
Then you can create a function in the Activity model that'll render proper message accordingly to your requirements.
I have data like so:
NAME TITLE SALARY HIREDATE
-------------------------------
HANK BOSS 100 1/1/2016
JOHN JERK 100 1/1/2015
MIKE PUNK 200 1/1/2014
We want to show this data as such:
NAME HANK JOHN MIKE
-------------------------------
TITLE BOSS JERK PUNK
SALARY 100 100 200
HIREDATE 1/1/16 1/1/15 1/1/14
This is how my client needs to see the data, unfortunately.
How can this be done with SSRS (sql 2012)?
I tried to create a Matrix, I was able to get the names as columns on top.
But when I tried to do the rest of it, no luck.
Thanks!
You can use a matrix with column groups to pivot your data, you will need the settings of your matrix look similar to this:
Just add NAME in the Column Groups pane, then right click the first row and select Insert Row - inside the group, do that three times each for TITLE, SALARY and HIREDATE.
For SALARY use =SUM(Fields!SALARY.Value). Also you may want to hide the last empty row, so select the entire row, right click it and go to Row Visibility, select Hide.
You will get:
Let me know if this helps.