Help with select from USREXTID table
HI,
I try to select from table USREXTID and when i try to use do the select like below
SELECT bname FROM usrextid
INTO TABLE lt_bname
WHERE type = 'DN'
AND extid = temp_extid
AND status = 'X'.
here when i take the exact entry from the table i get sy-subrc = 0.
Working o.k.
when i try to use the select for SAML like
SELECT bname FROM usrextid
INTO TABLE lt_bname
WHERE type = 'SA'
AND extid = temp_extid
AND status = 'X'.
I get sy-subrc = 4.
I have entry on the table with SA and i copy all the entry from EXTID field and put it on
temp_extid ,
What can be the problem ?
Best Regards
Nina
Edited by: Nina C on Jun 15, 2009 10:05 AM
HI,
i copy the entry from the table exactly and i put it ,
The problem here is with SA.
when i copy entry from table with DN it work fine.
it's behave strange .
Best Regards
Nina
Similar Messages
-
Update table with select from another table
Hallo,
I'd like to update table b with codes from a mapping table a.
a has:
town_id, town_code, town_name
b has town_code, town_id, town_population, town_zip_code,...
Table a has all the details - town_id, town_code and town_name and acts as the mapping between town_id and town_code
In table b, town_code is null. I want to update the column b.town_code with town_code from table a where a.town_id = b.town_id.
How will the update query look like?
I tried
UPDATE B SET town_code = (SELECT A.town_code FROM A,B WHERE A.town_id=B.town_id)
and I get the error 'single-row subquery returns more than one row'
Will appreciate your assistanceThis is what I did.
First, I created and populated the TOWN_INFO table:
CREATE TABLE "TOWN_INFO"
( "TOWN_ID" NUMBER,
"TOWN_CODE" NUMBER,
"E_MAIL" CHAR(15 BYTE)
Table Created.
insert all
into TOWN_INFO (TOWN_ID, E_MAIL) values (3024,'[email protected]')
into TOWN_INFO (TOWN_ID, E_MAIL) values (3040,'[email protected]')
into TOWN_INFO (TOWN_ID, E_MAIL) values (3052,'[email protected]')
into TOWN_INFO (TOWN_ID, E_MAIL) values (3065,'[email protected]')
into TOWN_INFO (TOWN_ID, E_MAIL) values (3066,'[email protected]')
select * from dual
5 rows created.
The following creates and populates the mapping table:
CREATE TABLE "TOWN_MAPP"
( "TOWN_CODE" NUMBER,
"TOWN_ID" VARCHAR2(255 BYTE),
"TOWN_NAME" CHAR(6 BYTE)
insert all
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3024,'1001','TOWN_1')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3040,'1003','TOWN_3')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3052,'1002','TOWN_2')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3065,'1004','TOWN_4')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3066,'1006','TOWN_6')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3088,'1007','TOWN_7')
into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3020,'1009','TOWN_9')
select * from dual
7 rows created.
And now the update query:
UPDATE TOWN_INFO
SET TOWN_CODE=(SELECT B.TOWN_CODE FROM TOWN_MAPP B, TOWN_INFO C
WHERE B.TOWN_ID=B.TOWN_ID)
SET TOWN_CODE=(SELECT B.TOWN_CODE FROM TOWN_MAPP B, TOWN_INFO C
ERROR at line 2:
ORA-01427: single-row subquery returns more than one row
Thanx in advance
Edited by: user9954260 on Apr 13, 2010 7:40 AM
Edited by: user9954260 on Apr 13, 2010 7:44 AM -
XML parsing failed while select from my table with criteria
While select from my table an error displayed as
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00601: Invalid token in: '/<XML Path>/row[c24="SA0010001"]'
select * from category
where existsNode(xmlrecord, '/<XML Path>/row[c24="SA0010001"]') = 1;
xmlrecord
<row id="52843" xml:space="preserve">
<c1>Refund of Domestic Payment Order</c1>
<c2>Ref Dom Py Or</c2>
<c3>PLsql</c3>
<c20>1</c20>
<c21>62_TAABSINPUTT___OFS_TAABS</c21>
<c22>0803181605</c22>
<c23>62_TAABSINPUTT_OFS_TAABS</c23>
<c24>SA0010001</c24>
<c25>1</c25>
</row>Hi,
Did you copy that sample from some demo?
The part "<XML Path>" is meant to be replaced by a real XPath fragment.
Here, I think you may just want this :
select * from category
where existsNode(xmlrecord, '/row[c24="SA0010001"]') = 1;Edit : OK, just seen your previous post and the example given
Edited by: odie_63 on 6 juil. 2010 21:16 -
How to populate a table based on a row selection from another table.
Hi, i just started to use ADF BC and Faces. Could some one help me or point me a solution on the following scenario .
By using a search component , a table is being displayed as a search result. If i select any row in the resulted table , i need to populate an another table at the bottom of the same page from another view. These two tables are related by primary key . May i know how to populate a table based on a row selection from another table. Thanks
ganeshI understand your requirement and the tutorial doesn't talk about Association between the views so that you can create a Master-Detail or in DB parlance, a Parent-Child relationship.
I will assume that we are dealing with two entities here: Department and Employees where a particular Department has many Employees and hence a Parent-Child relationship.
Firstly, you need to create an Association between the two Entities - Department and Employees. You can do that by right clicking on the model's entity and then associating the two entities with the appropriate key say, DepartmentId.
Once you have done that, you need to link the two entities in the View section with this Association that you created. Then go to AppModule and make sure that in the Available View Objects: 'EmployeesView' appears under 'DepartmentView' as "EmployeesView via <link you created>". Shuttle the 'DepartmentView' to the right, Data Model and then shuttle
"EmployeesView via <link you created>" to the right, Data Model under 'DepartmentView'.
This will then be reflected in your Data Controls. After that, you simply would have to drag this View into your page as a Master-Detail form...and then when you run this page, any row selected in the Master table, would display the data in the Detail table.
Also, refer to this link: [Master-Detail|http://baigsorcl.blogspot.com/2010/03/creating-master-detail-form-in-adf.html]
Hope this helps. -
Selecting from two tables and confirming from them despites they not relate
Please I need a query to select from two tables that are not related to each other.
I also want to confirm data's as in verify wether what the user has entered is in accordance with what is in the tables
Examples
the first table is named "Card" and the second table is named "Student_Details"
Card table contains a column named "Pin_Number".
The Student_Details table contains fields such as Exam_Number, Name, Age, Sex.
The user has to Enter the Pin_Number which has to be confirmed in the Card table and Exam_Number which has to be confirmed in the Student_Details table and verify that both data's are correct.
Please I need the SQL and PL/SQL queries for this problem.
ThanksHi,
I think you need two different queries
You can write a procedure like:
create or replace procedure p1 (p_pin_number number, p_exam_number)
is
r_card_row card%rowtype;
r_student_details student_details%rowtype;
cursor c1 is
select *
from card
where pin_number = p_pin_number;
cursor c2 is
select *
from student_details
where exam_number = p_exam_number;
begin
open c1;
loop
fetch c1 into r_card_row;
exit when c1%notfound;
.... do whatever you want..... and the samething you can do with other cursor
end loop;
close c1;
end p1;Hope this helps
Ghulam -
I have a db, call it xyz.mdb
It suddenly is that SSMS is not listing the table objects nor the Views. SELECT * FROM sys.Tables and SELECT * FROM sys.Views work very fine. But when I click on the tables node, on Objects Explorer, Only the Systems Tables and File Tables folders
show.
Other DBs on same SQL instance do not show same problem. They are all working very fine.
I have backed up and restored this db on other computers and the behaviour is the same. Incidentally right-clicking the db and clicking Properties throws up this error message.
-------------------------------------------------------------------------Error!
Cannot show requested dialog.
Property Size is not available for Database '[Pliny E DB - NOA 2014]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.PropertyCannotBeRetrievedExceptionText&EvtID=Size&LinkId=20476
--------------------------------------------------------------------------------End>
When I try to Refrresh the Tables node on Object Explorer, I get this other:
------------------------------Error!
SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0x9090d9b7; actual: 0x909001b4). It occurred during a read of page (1:1173) in database ID 21 at offset 0x0000000092a000 in file 'c:\Databases\Clients\NOA\Pliny E DB -
NOA 2014.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check
(DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (Microsoft SQL Server, Error: 824)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=824&LinkId=20476
------------------------------End>
The Help link of course is not valid any more.
Many thanks
Vie
@Abuja
VieYour database is corrupted and you need to run.
DBCC CHECKDB
You already have a backup so do it...
This link will provide you with more information:
http://msdn.microsoft.com/en-us/library/ms176064.aspx -
Work with data from a table of another SAP R/3 system
Hi,
I want to work with data from a table of another system. I know there's a function called 'RFC_READ_TABLE' but I don't know really how it works. What I want to do is to get data from that system and pass it to the one where I'm working in order I can continue working with this data in the report.
Besides, I'd like to select only the records that have some conditions.
I'd appreciate if someone could tell how to do it, whether with FM 'RFC_READ_TABLE' or in another way.
Thanks in advance,
Gerard
P.S: The systems are already connected in SM59Yes, you can use RFC_read_table .You can pass the number of columns but I recommend you to bring all results in your internal table after that you can filter the records. Most of the time I have notice when you make RFC call with this FM to another system it works but it may also happen that other system controlling authorization and then it might give you nothing. As I face this problem on my last Project.
Hope thisll give you idea!!
<b>P.S award the points.</b>
Good luck
Thanks
Saquib Khan
"Some are wise and some are otherwise" -
How to do a SELECT from different tables into an internal table?
How to do a SELECT from different tables into an internal table?
I want to select data from MARA, MARC and ZPERSON and populate my ITAB_FINAL
REPORT zinternal_table.
TABLES:
mara,
marc,
zperson.
TYPES:
BEGIN OF str_table1,
v_name LIKE zperson-zname,
v_matnr LIKE marc-matnr,
v_emarc LIKE marc-emarc,
v_werks_d LIKE marc-werks_d,
v_dstat LIKE marc-dstat,
END OF str_table,
i_table1 TYPE STANDARD TABLE OF str_table1.
DATA:
BEGIN OF str_table2,
v_mandt LIKE mara-mandt,
v_ernam LIKE mara-ernam,
v_laeda LIKE mara-laeda,
END OF str_table2,
itab_final LIKE STANDARD TABLE OF str_table2.first find the link between mara , marc and zperson , if u have link to 3 tables then u can jus write a join and populate the table u want ( thats final table with all the fields).
u defenitely have alink between mara and marc so join them and retrieve all data into one internal table.
then for all the entries in that internal table retrieve data from zperson into another internal table.
then loop at one internal table
read another internal table where key equals in both the tables.
finally assign fileds if sy-subrc = 0.
gs_finaltable-matnr = gs_table-matnr
etc...
and finally append gs_finaltable to gt_finaltable.
there u go ur final table has all the data u want.
regards
Edited by: BrightSide on Apr 2, 2009 3:49 PM -
Select from nested table in a nested table security problem
please help
running Oracle 9.2.0.3.0 on RH AS 2.1
I can select the inner most nested table as the creator, but can't use the same select statement as USER2.
ORA-00942: table or view does not exist
-- begin make of objects and tables
create or replace type mydata_t as object ( x float, y float);
create or replace type mydata_tab_t as table of mydata_t;
create or replace type mid_t as object (
graphname varchar2(12),
datapoints mydata_tab_t );
create or replace type mid_tab_t as table of mid_t;
create or replace type top_t as object (
someinfo int,
more_mid mid_tab_t );
create table xyz (
xyzPK int,
mainstuff top_t )
nested table mainstuff.more_mid store as mid_nt_tab
(nested table datapoints store as mydata_nt_tab)
-- grants
grant all on mydata_t to user2;
grant all on mydata_tab_t to user2;
grant all on mid_t to user2;
grant all on mid_tab_t to user2;
grant all on top_t to user2;
grant all on xyz to user2;
-- insert
insert into xyz values (1, top_t(22,mid_tab_t(mid_t('line1',mydata_tab_t(
mydata_t(0,0),
mydata_t(15,15),
mydata_t(30,30))))));
commit;
-- select fails as user2
select * from table(select Y.datapoints as DP_TAB
from table(select X.mainstuff.more_mid as MORE_TAB
from scott.xyz X
where X.xyzPK=1) Y
where Y.graphname='line1') Z;
-- select works as user2, but i need individual lines
select Y.datapoints as DP_TAB
from table(select X.mainstuff.more_mid as MORE_TAB
from scott.xyz X
where X.xyzPK=1) Y
where Y.graphname='line1';Thank you for your reply.
I have tried
select value(t) from table t;
but it is still not working. I got almost the same answer as before.
Anyway thank you very much again.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by MARCELO OCHOA ([email protected]):
Originally posted by meimei wu ([email protected]):
[b]I created a nested object-relational table using REF type in oracle8i. when I tried to select * from the table, I got lots of number as the ref type values, but actually, the value in ref type should be of type varchar2 and number. The number I got looked like following code:
JARTICLE_REF_TYPE(000022020876108427C2FE0D00E0340800208FD71F76103B99B12009C0E0340800208FD71F,
Does anyone know how I can get the actual value that I inserted into the nested table?
your help is appreciated.<HR></BLOCKQUOTE>
Try this:
select value(t) from table t;
Best regards, Marcelo.
null -
How to avoid ORA-3113 when selecting from XMLTYPE table
Hi,
If I register an XML-schema, Oracle automatically creates a table xxxxxx_tab of XMLTYPE. (I use Oracle 9.2.0.1)
When I do a DESCRIBE or a SELECT from this table I get the error: 'ORA-03113:
end-of-file on communication channel' and my connection is dropped.
I opened a TAR for this and Oracle says: 'It is an internal bug so cannot be viewed in metalink. This is fixed in release 10i.' (do they mean oracle DB rel 10i, or a new version of XDK?)
I saw an example in Oracle Magazine (Jan
2003) "Make XML Native and Relative" about Oracle 9i Rel 2 and XML. As you can see in codeListing 7, the author also does a select from such a
table (CD331_tab): Why doesn't he have any problems?
Is there a workaround for this bug? What's the purpose of being able to automatically upload XML-data to a registered schema if you can't do a select of the data?
Thank you!It appears that the XML Schema is not entirely valid. Specifically, the definition of element "DeviceCategory" has two definitions of element "Audio" appearing within a <choice> model i.e. something like :
<element name="DeviceCategory">
<choice>
<sequence>
<element name="Audio">
</sequence>
<sequence>
<element name="Audio">
</sequence>
</choice>
This is disallowed by XML Schema spec per. the Unique Particle Attribution Constraint. The general idea is that a XML Schema describes a determinstic content model i.e. schema processor can always unambiguosly determine the matching declaration when it encounters an element. However that's not the case with the declaration above. On encoutering "Audio", it could match either the first or the second declaration of the element. Hence the error.
You will have to rework the schema to avoid this constraint. One mechanism could be to define complexType and their restrictions.
- Ravi -
Select from a table from other schema
Hi,
I want to make a select from a table how is into other Schema and into other instance.
form example, if I have _2 schemas (in diferent instances)_:
SCHEMA1 =
*(DESCRIPTION =*
*(ADDRESS =*
*(PROTOCOL = TCP)*
*(HOST = XXX.XXX.XXX.XX1)*
*(PORT = 1560)*
*(CONNECT_DATA =*
*(SERVER = DEDICATED)*
*(SERVICE_NAME = SCHEMA1)*
SCHEMA2 =
*(DESCRIPTION =*
*(ADDRESS =*
*(PROTOCOL = TCP)*
*(HOST = XXX.XXX.XXX.XX2)*
*(PORT = 1560)*
*(CONNECT_DATA =*
*(SERVER = DEDICATED)*
*(SERVICE_NAME = SCHEMA2)*
and into SCHEMA2 there is a table TABLE_A.
If I`m connected into SCHEMA1:
how can I do to make a select from the TABLE_A?
thanks very much.1) Referring to an entry in the tnsnames.ora file as a "schema" as you have here with schema1 and schema2 is likely to be confusing. You have multiple schemas in the same database-- in this case, you appear to be trying to query tables in a different database. If we try to answer using your TNS aliases "schema1" and "schema2", there is likely to be a great deal of confusion between schemas/ databases/ and TNS aliases. So I will assume that your tnsnames.ora file actually reads
TNS_ALIAS1 =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = HOST1)
(PORT = 1560)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DB1)
TNS_ALIAS2 =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = HOST2)
(PORT = 1560)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DB2)
)2) Given the TNS aliases above, assuming that we are talking about the tnsnames.ora file on HOST1, you would need to create a database link from DB1 to DB2. You can either specify a fixed username and password for the database link or you can specify that the connection happens as the current user (which assumes that the passwords are synchronized between the databases).
CREATE DATABASE LINK to_db2
CONNECT TO username_on_db2
IDENTIFIED BY password_on_db2
USING 'TNS_ALIAS2'3) Assuming the database link is in place
SELECT *
FROM schema2.table_name@to_db2Justin -
PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables
Dear ALL,
My O/S is Redhatlinux 5.2 and i had Migrated my Oracle databse to 11g2. But after that while i am retrieving records through dblinks from one of my other Oracle 9.2.0.8 databse it's throwing the error : PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables.* This error i am getting in TOAD as well as SQL Developer.
Can anybody tell me how to fix this error ? Because am not able to get the records.
Also am getting another error during retrieving data from some of my tables after migrating i.e the table which having CLOB data type while am accessing to retrieve the records using select query it's throwing the error :
+(The following error has occurred:+
A query with LOB's requires OCI8 mode, but OCI7 mode is used.)
If anyone having any idea kindly share.
Thanks and Regards
BiswaHi,
Ya what u sent that is fine. But already am using one procudure which is accessing LOB data from another databse through DBlink and working fine. But there Both the databse are 9.2.0.8.
But while am executing the same procedure in oracle 11g where the Dblink accessing the data from Oracle 9i , there am getting this error.
Kindly tell if u know any resolution.
Thanks -
Select from multiple tables without join statement
Hey Gurus,
I would like to make a select from a multiple tables to check if there is any reference to my data. I would like to do it with some elegancy, but I don't know how.
Is in abap sql possible to do it only with the select statement?
Or I was also think about a solution that I should fill some data structure with all of the tables which I want to select from and then just loop that data structure and do the select seperately from all of the tables. I just need to check if it founds some results, so no need to store it. If this solution would be fine what data structure should I use?
Or can tell me what would be the best for this?
My code for select from one table, which I want to make for multiple tables:
SELECT SINGLE id_kniznice FROM zbr_t_autori INTO wa_id
WHERE id_kniznice EQ ls_extract-zview-id_kniznice.
IF sy-dbcnt > 0.
MESSAGE i000(zbr_msgc_lib).
ls_extract-flags-vim_mark = '*'.
MODIFY extract FROM ls_extract.
ENDIF.
Thank you for any posts.
Regards,
RobertAnd there we go again...
Read this topic:
For All Entries is NOT better than INNER JOIN in most cases
And this one:
inner join vs for all entries
Also that one:
Re: LOOP AT vs INNER JOIN
JOINs are really better than for all entries in most cases. Problem is people tend to ignore basic things like using pks or indexes while making them. -
Dynamic SQL select from unknown table until runtime
I need to do a select from a table that is unknown until runtime. Is there any good examples of this. The Store Procedure will take in the table name and return a row.
I am not using inline SQL because there is a lot more complexity involved . What I need to do is understand how to reference this unknown table.
Here is an example of what I have written so far.
PACKAGE pk_LoadNativeDataItems IS
PROCEDURE version;
TYPE RowDataCur IS REF CURSOR;
PROCEDURE pr_LoadNativeDataItems(p_flag IN NUMBER
p_how_many_rows_to_fetch IN NUMBER,
p_row_data OUT RowDataCur);
PROCEDURE pr_LoadNativeDataItems(p_flag IN NUMBER
p_how_many_rows_to_fetch IN NUMBER,
p_table_name IN VARCHAR,
p_row_data OUT RowDataCur) IS
BEGIN
OPEN p_row_data FOR
SELECT * from ||p_table_name||;
END pr_LoadNativeDataItems;
END pk_LoadNativeDataItems;
Thanks for any help
TonyHere is example for similar question:
Using variables for tables and columns -
Help with SELECT - selecting range of numbers
Hi,
I need a help with SELECT statement. I want to select Dates starting from today and ending 30 days back. So the result would be like:
TRUNC(SYSDATE)
TRUNC(SYSDATE) - 1
TRUNC(SYSDATE) - 2
TRUNC(SYSDATE) - 3
TRUNC(SYSDATE) - 30I was thinking to simply select truncated SYSDATE in first column, and in second column numbers 0, 1, 2, ... 30. Then I would simply do a difference first column - second column. But how to select such sequence of numbers? I don't want to select each number (date) in separate select statement and then unioning them.
Does anybody have an idea?
Thanks for help, DanSQL> select trunc(sysdate) - level + 1 as dt
2 from dual
3 connect by level <= 31
4 ;
DT
07/01/2013
06/01/2013
05/01/2013
04/01/2013
03/01/2013
02/01/2013
01/01/2013
31/12/2012
30/12/2012
29/12/2012
28/12/2012
27/12/2012
26/12/2012
25/12/2012
24/12/2012
23/12/2012
22/12/2012
21/12/2012
20/12/2012
19/12/2012
DT
18/12/2012
17/12/2012
16/12/2012
15/12/2012
14/12/2012
13/12/2012
12/12/2012
11/12/2012
10/12/2012
09/12/2012
08/12/2012
31 rows selected
Maybe you are looking for
-
What is the safest way to move iPad iTunes sync from an old laptop to a new one?
-
Can't make lines on After Effects CC (Pen Tool)
Im having trouble making lines with the pen tool I made a quick video showing what happens
-
How to 'DESCRIBE' a XMLType table
Hi, When I describe a XMLType table, the output is truncated as follow : SQL> desc scott.purchaseorder Name Null? Type TABLE of SYS.XMLTYPE(XMLSchema "http://localhost:8080/home/SCOTT/poSource/xsd/purchaseOrder.xsd" Ele Is there any way to show the c
-
Inserting blockquote tags into a HTMLDocument
G'Day, I'm having a bit of trouble inserting <blockquote> tags into a HTMLDocument. Basically I want the blockquote tags to implement an indent feature. ie, you click a button and all the text in the current paragraph gets surrunded by blockquote tag
-
Change hostname on Cisco devices that are in production
I'm new to Cisco devices and to my current job as network analyst. Mostly in an attempt to establish consistency and to ease identification, I'd like to change the hostname of most of our Cisco switches and routers. However, I don't want to create an