SQL to get all the characters till the first pipe operator
I have a pipe (|) separated values list stored in a column. I just want all the characters till the first pipe.('AER' in the below example.) For that i've wrote an SQL
SQL> select substr('AER|SPAC|EJK|KLSL',1, INSTR('AER|SPAC|EJK|KLSL','|',1,1)-1 ) FROM DUAL;
SUBSTR('AER|SPAC|EJK|KLSL',1,INS
AERCan this be written in a more efficient way?
try,
SQL> select regexp_substr('AER|SPAC|EJK|KLSL', '[^|]+' ) FROM DUAL;
REG
AERTwinkle
Similar Messages
-
Looking for a SQL query to get all the possible Alert Messages from the Rules in a Management Pack
For reporting, I'm looking to get a SQL query of all the possible Alert Messages for Rules configured in a Management Pack (not necessarily the ones that have thrown alerts). I can do this for Monitors, but not for Rules.
The configured alert messages for the Management Pack Monitors
go like this: ManagementPack > MonitorView> RuleModule > RuleModule.Alert Message > Localized Text
The configured alert messages for the Management Pack Rules
should go something like this, but there is a missing link: ManagementPack > RuleView > RuleModule > ? Missing Link ? > Localized Text
The Rules are tied to the Module, but I don't see a connection from the RulesModule to the Alert Message that I see in the LocalizedText. The Rule names do not always equal the Alert name.
Can someone provide the missing link?Hi,
please try below powershell code to find the corresponding management pack for specific alert:
$Alert = get-scomalert | where {$_.Name -like 'Agent Proxy Not Enabled*'} | select -first 1
If ($alert.IsMonitorAlert -eq "True") {
write-host "Ths is a monitor-generated alert"
get-scommonitor -ID $Alert.MonitoringRuleID | select Enabled, DisplayName, ManagementPack
else
write-host "This is a rule-generated alert"
get-scomrule -ID $Alert.MonitoringRuleID | select Enabled, DisplayName, ManagementPack
In addition, please also refer to the below link:
http://blogs.technet.com/b/mazenahmed/archive/2011/12/02/using-powershell-to-map-opsmgr-active-alert-to-its-corresponding-rule-monitor-and-management-pack-name.aspx
Regards,
Yan Li
Regards, Yan Li -
Urgent solution needed for the Problem ( get all the combination from table
we are having a table in following format
day | grpID | pktID
sun | 1 | 001
sun | 1 | 002
sun | 1 | 003
sun | 2 | 007
sun | 2 | 008
sun | 2 | 009
mon | 1 | 001
mon | 1 | 002
mon | 1 | 003
mon | 2 | 007
mon | 2 | 008
mon | 2 | 009
tue | 1 | 001
tue | 1 | 002
tue | 1 | 003
tue | 2 | 007
tue | 2 | 010
1. We have a combination of pkdIDs related with a specific grpID, for a particular day.
Ex: For Sunday, we have two combination list for grpID=1 is (001,002,003) and for group id = 2 is (007,008,009)
2. We need to get all the available combined pktid for each group id for all the days .
Eg the the expected result that is needed from the above table
(001,002,003)
(007,008,009)
(007,010)SQL> with tbl as
2 (select 'sun' d, 1 grp, '001' pk from dual union all
3 select 'sun' d, 1 grp, '002' pk from dual union all
4 select 'sun' d, 1 grp, '003' pk from dual union all
5 select 'sun' d, 2 grp, '007' pk from dual union all
6 select 'sun' d, 2 grp, '008' pk from dual union all
7 select 'sun' d, 2 grp, '009' pk from dual union all
8 select 'mon' d, 1 grp, '001' pk from dual union all
9 select 'mon' d, 1 grp, '002' pk from dual union all
10 select 'mon' d, 1 grp, '003' pk from dual union all
11 select 'mon' d, 2 grp, '007' pk from dual union all
12 select 'mon' d, 2 grp, '008' pk from dual union all
13 select 'mon' d, 2 grp, '009' pk from dual union all
14 select 'tue' d, 1 grp, '001' pk from dual union all
15 select 'tue' d, 1 grp, '002' pk from dual union all
16 select 'tue' d, 1 grp, '003' pk from dual union all
17 select 'tue' d, 2 grp, '007' pk from dual union all
18 select 'tue' d, 2 grp, '010' pk from dual) -- end of data sample
19 select distinct '('||ltrim(max(c1) keep (dense_rank last order by lv),',')||')'
20 from (select d,grp,level lv,sys_connect_by_path(pk,',') c1
21 from tbl
22 connect by d=prior d and grp = prior grp and pk > prior pk)
23 group by d,grp;
'('||LTRIM(MAX(C1)KEEP(DENSE_RANKLASTORDERBYLV),',')||')'
(001,002,003)
(007,008,009)
(007,010)
SQL>That works on 9i. Other possiblities on 10g.
Nicolas. -
Generate a report from the grid to get all the 10g instance name and size
Hi Guru
Greetings foe the day
can you help me to Generate a report from the grid to get all the 10g instance name and size.
If its passible you would help me a ton
Thank youIf you can see in you query, you asking to view dba_segments for one instance and the other query is over the MGMT$DB_TABLESPACES view but NOT "WHERE" clouse is using, and if ypu have more once instance then than view sum all the tablespaces sizes.
How many instanced are registed in your grid control?
http://www.jpuga.cl
Regards
user625256 wrote:
Hi
can any one help on this
The o/p
SQL> select sum(bytes)/1024/1024/1024 from dba_Segments;
SUM(BYTES)/1024/1024/1024
3549.80879
when i query from the above mgmt its returns 1,507,473.149 GB
select target_name DB_NAME,host_name Host,sum(trunc(tablespace_used_size/1024/1024/1024,2)) size_GB
from MGMT$DB_TABLESPACES group by host_name,target_name order by target_name
it gives the size as 1,507,473.149 GB
Thank you in advance -
I want to get all the user name form LOGIN table ... how help me ?
hi all
I have table in MS Access databse called Login with two coulmn (User, Password),
I want to get all the User Name in a string[] called USER,
(LIKE USER = {"AA","BB","CC",........"zz"};)
can anybody send me the code to get the USERNAMES form Login Table, i tried lots of way but bad luck
so plz someone send me a code.
Thanx
Regards
SatinderI made something like this as He pasted the the code above and u know this works for me atleast thanx
kind regards
satinderjit
String User[] = new String[1000];
try
//Load Driver
Class.forName(driver);
// Make Connection
connection=DriverManager.getConnection(url,user,password);
// Create Statement
statement = connection.createStatement();
sql = "SELECT User FROM Login" ;
// Create Resultset
rs = statement.executeQuery(sql);
int j=0;
while(rs.next())
User[j]= rs.getString("User");
j=j+1;
for(int i=0 ;i<J;i++)
Form.C_Manager.addItem(User);
statement.close();
//rs.close();
connection.close();
catch(ClassNotFoundException cnfex) {
//show message
JOptionPane.showMessageDialog((Component) null,
"Failed to load driver..."+
"\n"+cnfex.getMessage(),
"Error...",
JOptionPane.ERROR_MESSAGE);
catch(SQLException sqlex){
//show message
JOptionPane.showMessageDialog((Component) null,
"Unable to connect to Database..."+
"\n"+sqlex.getMessage(),
"Error...",
JOptionPane.ERROR_MESSAGE);
catch(ArrayIndexOutOfBoundsException e){
//show message
JOptionPane.showMessageDialog((Component) null,
"Unable to Load User Name..."+
"\n"+e.getMessage(),
"Error...",
JOptionPane.ERROR_MESSAGE); -
Hi All
I have nearly 70 procedures in my database.
I want to get all the distinct table names used in the 70 procedures.
Is it possible?
Note:
All the table names are prefixed by schema name like DEVSRC.table_name.
Please advice
Thanks
JoJohney wrote:
Hi VT
One doubt.
This query will give the table names of only select stmt used in the procedure
or
List of table names that are with in any DML operations inside the procedure?
Thanks
JoIt will give all the table either used in select or in any DML..
You can also check by creating a temp proc
SQL> drop procedure proc_test;
Procedure dropped.
SQL> select name, referenced_name, dependency_type from user_dependencies
2 where type = 'PROCEDURE' and referenced_type = 'TABLE' and name='PROC_TEST';
no rows selected
SQL> create or replace
2 PROCEDURE proc_test
3 IS
4 v_ID number;
5 v_PRID number;
6 v_PRLID number;
7 v_DATERECEIVED date;
8 Cursor C1 is
9 select * from table_c;
10 BEGIN
11 open c1;
12 LOOP
13 FETCH c1 INTO v_ID,v_PRID,v_PRLID,v_DATERECEIVED;
14 EXIT WHEN c1%NOTFOUND;
15 insert into table_b values(v_ID,v_PRID,v_PRLID,v_DATERECEIVED);
16 Commit;
17 END LOOP;
18 CLOSE C1;
19 END;
20 /
Procedure created.
SQL> select name, referenced_name, dependency_type from user_dependencies
2 where type = 'PROCEDURE' and referenced_type = 'TABLE' and name='PROC_TEST';
NAME
REFERENCED_NAME DEPE
PROC_TEST
TABLE_B HARD
PROC_TEST
TABLE_C HARD
SQL> Regards
Umesh -
Not Getting all the icons in the Toolbar while using using ALV with OOPS
Hello,
But I am not able to get all the Keys in the toolbar for which i have called the method from class cl_salv_functions_list, by using the following logic.
Though i am getting all except Word Processing, ABC Analysis, Save layout, Information, Get Layout.
FORM ALV_DISPLAY .
data: lr_functions type ref to cl_salv_functions_list, "toolbar
lr_columns type ref to cl_salv_columns,
LI_COLUMNS TYPE REF TO CL_SALV_COLUMNS_TABLE, "columns instance
LI_COL TYPE REF TO CL_SALV_COLUMN_TABLE, "column instance
LR_EVENTS TYPE REF TO CL_SALV_EVENTS_TABLE,
GR_EVENTS TYPE REF TO LCL_HANDLE_EVENTS.
TRY. "method for ALV display
CALL METHOD CL_SALV_TABLE=>FACTORY
EXPORTINg
LIST_DISPLAY = IF_SALV_C_BOOL_SAP=>FALSE
IMPORTING
R_SALV_TABLE = li_alv
CHANGING
T_TABLE = it_po_final.
CATCH CX_SALV_MSG .
message e001(00) with text-011.
ENDTRY.
*calling methods for toolbar
lr_functions = li_alv->get_functions( ).
lr_functions->set_default( abap_true ).
lr_functions->set_print_preview( abap_true ).
lr_functions->set_view_excel( abap_true ).
lr_functions->SET_EXPORT_WORDPROCESSOR( abap_true ).
lr_functions->set_export_localfile( abap_true ).
lr_functions->SET_EXPORT_MAIL( abap_true ).
lr_functions->SET_EXPORT_SEND( abap_true ).
lr_functions->SET_ABC_ANALYSIS( abap_true ).
lr_functions->SET_GRAPHICS( abap_true )
lr_functions->SET_LAYOUT_SAVE( abap_true ).
lr_functions->SET_DETAIL( abap_true ).
lr_functions->SET_LAYOUT_MAINTAIN( abap_true )
*... set the columns technical
lr_columns = li_alv->get_columns( ).
lr_columns->set_optimize( abap_true ).
**get ALV columns
CALL METHOD LI_ALV->GET_COLUMNS "get all columns
RECEIVING
VALUE = LI_COLUMNS.
IF LI_COLUMNS IS NOT INITIAL.
*Get EBELN column
TRY.
LI_COL ?= LI_COLUMNS->GET_COLUMN( 'EBELN' ). "get EBELN columns to insert hotspot
CATCH CX_SALV_NOT_FOUND.
MESSAGE i001(00) with text-012.
ENDTRY.
* Set the HotSpot for ebeln Column
TRY.
CALL METHOD LI_COL->SET_CELL_TYPE "set cell type hotspot
EXPORTING
VALUE = IF_SALV_C_CELL_TYPE=>HOTSPOT.
CATCH CX_SALV_DATA_ERROR .
MESSAGE i001(00) with text-012.
ENDTRY.
ENDIF.
*Register events
*Event handler method for ALV
***handle hotspot click
LR_EVENTS = LI_ALV->GET_EVENT( ). "get event
CREATE OBJECT GR_EVENTS.
SET HANDLER GR_EVENTS->ON_LINE_CLICK FOR LR_EVENTS. "register event handler method
IF li_alv IS BOUND. "calling display method for ALV
li_alv->display( ).
ENDIF.
ENDFORM. " ALV_DISPLAYHi Neha,
If you didn't get the answer then follow this one. Yeah and sorry, i checked and found that really you were not getting every icons. I am giving here a sample program.
REPORT zdc_factory_alv_test
TYPES: BEGIN OF ty_vbak,
vbeln TYPE vbak-vbeln,
erdat TYPE erdat,
auart TYPE auart,
kunnr TYPE kunnr,
END OF ty_vbak.
DATA: gt_vbak TYPE STANDARD TABLE OF ty_vbak,
gs_vbak LIKE LINE OF gt_vbak,
gr_salv TYPE REF TO cl_salv_table,
gr_container TYPE REF TO cl_gui_docking_container.
START-OF-SELECTION.
CALL SCREEN '3000'.
*& Module STATUS_3000 OUTPUT
* text
MODULE status_3000 OUTPUT.
SET PF-STATUS '3000'.
SET TITLEBAR 'FACTORY'.
ENDMODULE. " STATUS_3000 OUTPUT
*& Module ALV_OUTPUT OUTPUT
* text
MODULE alv_output OUTPUT.
PERFORM get_data.
PERFORM create_container.
PERFORM display_alv.
ENDMODULE. " ALV_OUTPUT OUTPUT
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
FORM get_data .
SELECT vbeln erdat auart kunnr
INTO TABLE gt_vbak
FROM vbak
UP TO 20 ROWS.
ENDFORM. " GET_DATA
*& Form CREATE_CONTAINER
* text
* --> p1 text
* <-- p2 text
FORM create_container .
IF gr_container IS NOT BOUND.
IF cl_salv_table=>is_offline( ) EQ if_salv_c_bool_sap=>false.
CREATE OBJECT gr_container
EXPORTING
side = cl_gui_docking_container=>dock_at_top
extension = 2000
EXCEPTIONS
others = 1.
ENDIF.
ENDIF.
ENDFORM. " CREATE_CONTAINER
*& Form DISPLAY_ALV
* text
* --> p1 text
* <-- p2 text
FORM display_alv .
DATA : lr_columns TYPE REF TO cl_salv_columns_table.
DATA : lr_functions TYPE REF TO cl_salv_functions_list,
lr_layout TYPE REF TO cl_salv_layout,
ls_layout_key TYPE salv_s_layout_key.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
r_container = gr_container
IMPORTING
r_salv_table = gr_salv
CHANGING
t_table = gt_vbak.
CATCH cx_salv_msg .
ENDTRY.
lr_functions = gr_salv->get_functions( ).
lr_functions->set_all( abap_true ).
lr_columns = gr_salv->get_columns( ).
lr_columns->set_optimize( 'X' ).
lr_layout = gr_salv->get_layout( ).
ls_layout_key-report = sy-repid.
lr_layout->set_key( ls_layout_key ).
lr_layout->set_save_restriction( ).
gr_salv->display( ).
ENDFORM. " DISPLAY_ALV
Note:- Double click on screen name '3000' and it will ask you option of creating screen.
There i have created one module..
After clicking 3000 under output module create MODULE alv_output.
That will look like...
PROCESS BEFORE OUTPUT.
MODULE status_3000.
MODULE alv_output.
PROCESS AFTER INPUT.
* MODULE USER_COMMAND_3000.
This is the sample result..
Still if you have any problem, then feel free to ask..
Regards
Dhananjay -
Not getting all the attributes value from Trusted Recon in eventhandler
Hi,
I am not getting the values of all the attributes in hashmap from Trusted recon in eventhandler.
Following is the hashmap value I am getting :
Parameter Hashmap value is {re_key=1869, Email=[email protected], Role=Full-Time, act_key=22, User Login=TUser43, Xellerate Type=End-User, Last Name=User43, First Name=Test}
Please let me know how to get all the attributes value in eventhandler. I need to take some decisions based on these attributes.
ThanksYou should be getting all the values in the recon event.
To get the current user states for all the records in the bulk event use this:
Identity[] currentUserStates = (Identity[]) eventDataHashMap.get("CURRENT_USER");
Now when you are looping through your bulkParametersp[], you can use the same get from the currentUserStates:
Identity currentUser = null;
currentUser = currentUserStates[counter];
Now if the attribute is not in your hashmap, you can use:
currentUserState.getAttributes().get(attribute)
-Kevini -
Not getting all the notifications to the Mobile Device
Hi All,
We are not able to get all the notifications that are assigned to the mobile device. Only part of the notifications are downloading to mobile device. I can see using MAM30_011_GETLIST there are 195 notifications assigned to that device. Out of 195, I can able to see only 97 notifications on the device.
I debugged and found that whenever I am creating a notifications using some functional locations either from the backend or using mobile device that never get downloaded to mobile device.
Please through some light on this issue I would be grateful to you.We are using Server Driven Functionality.
MAM version is MAM30 SR05.
Regards,
Scott.Hi,
The reason is very simple here. Some of the notifications are referring to technical objects(equipment/functional location) which are actaully not present on the middleware. So when a user request for data from the client to the middleware, because there is a reference from notification to technical objects, middleware will only send those notifications whose all references are actually present on the middleware.
So the way to check if all the technical objects are present in the middleware or not, you can do the following:
1. First check the no. of entries for both equipment and functional location in the middleware.
2. Then later go to the backend, as yours is server driven, then i would say go to variant of technical objects, execute the variant and make a note of the no. of entries it gives.
3. Verify if both middleware and backend gives same no. of entries.
If no, then try to correct the replication and then do a sync from the client.
If yes, then what I see is, even though you have all technical objects selected as a part of variant, there are still some notifications with technical objects which are not a part of technical objects selection in the above variant.
So, try to change the variant for technical objects to get more no. of technical objects which covers all the technical objects that might be a part of your notifications.
Hope this solves your problem.
Thanks & Best Regards,
Siva. -
Get all the values from a multiple select in a multipart form
Hi there!
I am using a form with enctype="multipart/form-data" in order to upload files from the form.
I have read this page: http://commons.apache.org/fileupload/using.html and everything works well for my form.
The only problem is that I can't get all the values from a "multiple select" html object. I get only one value.
Using servlets I have used this method:
public java.lang.String[] getParameterValues(java.lang.String name) But now I have enctype="multipart/form-data" in my form and I can't use this way...
Is there a way to get all the values of a multi-valued parameter?
Thanks a lot!
StefanoHi
I have got solution for this problem so, I am listing here logic
assume tag name of html
<select name="moption" multiple="multiple">
iterate it in as
String moption="";
boolean cnt=true;
while(itr.hasNext())
FileItem fi=(FileItem)itr.next();
if(fi.isFormField())
if(fi.getFieldName().equals("moption"))
if(cnt==true)
moption=fi.getString();
cnt=false;
else
moption=moption+","+fi.getString();
If wants more help then mail me your problem
at [email protected]
Thanks!
Anand Shankar
Edited by: AnandShankar on 6 Nov, 2009 12:54 PM -
How to get all the values in the Select-option.
Hi,
I got the select-option field so_week, for eg. If I give 200923 to 200926 (year and week) in the selection screen and then I need to pass this value (200923) to the FM 'ZWEEK_GET_FIRST_DAY' to get the first day of the week.
My question is how can i get all the values from the select option, (i.e) i need to get 200923, 200924,200925, 200926.
Regards,
Anbu.Hello,
I will prefer Max's solution. But just for the sake of this req.
i need to get 200923, 200924,200925, 200926
i am proposing my soln:
DATA: V_WEEK TYPE RSCALWEEK.
SELECT-OPTIONS: S_WEEK FOR V_WEEK NO-EXTENSION OBLIGATORY.
AT SELECTION-SCREEN.
DATA:
V_COUNT TYPE I,
V_ADD TYPE I,
RT_WEEK TYPE RANGE OF RSCALWEEK,
RS_WEEK LIKE LINE OF RT_WEEK.
V_COUNT = ( S_WEEK-HIGH - S_WEEK-LOW ) + 1.
DO V_COUNT TIMES.
RS_WEEK-SIGN = 'I'.
RS_WEEK-OPTION = 'EQ'.
RS_WEEK-LOW = S_WEEK-LOW + V_ADD.
APPEND RS_WEEK TO RT_WEEK. "RT_WEEK--> Will contain the week values
CLEAR RS_WEEK.
V_ADD = V_ADD + 1.
ENDDO.
@Max: I was stupid enough not to think of your solution. Need to leave office
Cheers,
Suhas -
How to get all the values from the dropdown menu
How to get all the values from the dropdown menu
I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
How do I get number of item is selection dropdown?
How do I extract a ?name? for each value, one by one?
How do I change a selection by referring to particular index of the item in a dropdown menu?
Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
Message was edited by: testtestThe findElement method allows various attributes to be used to search. Take the following two examples for the element below:
<Select Name=ProdType ID=testProd>
</Select>
I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
If I want to search by id I could do the following:
Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
You can use the FindElement to grab links, text boxes, etc.
The next example grabs from a link on a page
Home
Set x = RSWApp.om.FindElement("Home","A","innerText")
I hope this helps clear it up. -
Getting all the values from a JList
Hi,
I want to get all the values from a JList and store it into an array. Any method is available to perform this task? Pls help me out with this task.Use getModel() on the list to get the ListModel and then call getSize() and getElementAt(int) to loop over the elements
HTH
Mike -
How to get all the values in one column of a JTable
How to get all the values in one column of a JTable as a Collection of String.
I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column.I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column. You could always write a custom TableModel that stores the data in the format you want it. It would probably be about 50 lines of code. Or you could write a loop in 3 lines of code. I'll let you decide which approach you want to take.
-
Get all the field's value of addressbook entry using c++ api
How can i get all the field values of address book entry in groupwise using c++ api.
You should be able to do that via the Token API. There is an AddressBookGetEntry method. You could createsome sort of AddressbookEntry class that fetches (via iteration over the defined ABFields) all the innformation.
Maybe you are looking for
-
Message encode from mobile device
Message received encoded koi8-r was forwarded from a mobile device connected to Exchange 2010 with the header was encoded in windows-1251 and the message body in koi8-r and accordingly the recipient(user) could not read it. How can I fix these errors
-
Black background in native Display List elements overlayed with Starling
Hello, I'm having an issue in the iPad, where all native DisplayObjects are shown with an opaque black background instead of being transparent while being displayed over Starling graphics using "nativeOverlay". This doesn't happen in the PC, in ADL,
-
Connecting T510 to LG 42PG6000
Hi Can you please lt me know what are my options to connect my laptop to LG tv and watch movies? Appeared that T510 doesn't have either HDMi or S-Video ports... Thanks in advance
-
Mail Merge download has lost collected address book how do I recover it?
I needed to be able to do large mail merge for e-mails. Found Mail Merge add on and downloaded it. When I restarted Thunderbird, my collected e-mails address book had gone. Only personal address book visible with only 2 addresses in it. Urgently need
-
Hello everybody! I'm just thinking about how to design a reusable component that displays a list of sales organizations (<b>BAPI_SALES_AREAS_GET</b>). I want to be able to reuse this list - e.g. a dropdown field - within different Web Dynpro (Java) a