Fetch records
hi chaps,
I have a table say
cluster
cluster_id org_id cluster_name
52808095 -1 ORG1
52808096 29660826 ORG1
52808097 29660827 ORG1
area
area_id org_id cluster_id
52808102 -1 52808097
52808103 29660826 52808097
52808104 29660827 52808097
I need to insert into area tabl with the correct cluster id by looping....can u suggest how to do thsi in PL/SQL procedure
Edited by: user13029871 on May 20, 2010 10:10 PM
Although the requirement is not very clear but it seems that something like this.
SQL> select * from cluster_tbl;
CLUSTER_ID ORG_ID CLUS
52808095 -1 ORG1
52808096 29660826 ORG1
52808097 29660827 ORG1
SQL> select * from area_tbl;
AREA_ID ORG_ID CLUSTER_ID
52808102 -1 52808097
52808103 29660826 52808097
52808104 29660827 52808097
SQL> ed
Wrote file afiedt.buf
1 update area_tbl a set cluster_id=(select c.CLUSTER_ID
2 from cluster_tbl c where
3* c.ORG_ID=a.org_id)
SQL> /
3 rows updated.
SQL> select * from area_tbl;
AREA_ID ORG_ID CLUSTER_ID
52808102 -1 52808095
52808103 29660826 52808096
52808104 29660827 52808097
SQL>
Similar Messages
-
PDE-PLI031 Unable to fetch record from table tool_modulre
Dear ALL
I am creating PL/SQL Libraries in report builder.
but When I try to save the Library to database, a error
PDE-PLI031 Unable to fetch record from table tool_modulre.
Would you please tell me how to solve this problem
and why it coming
thankyou very much
pritam singhHi ,
Saving a library (.pll) to database would store the object inside specific tables that are to be created.
If you are using 6i, then you should find toolbild & toolgrnt.sql files which you have to run in the order specified. The above scripts creates the necessary tables and henceforth you won't get those errors while saving.
Hope this helps.
Thanks,
Vinod. -
How to fetch records from the database into a combo box?
Hi:
I´m really new with ABLBPM and I´m trying to fetch records from the database to display them into a combo box as valid values for a presentation but I´m using a dynamic method with this code:
<em>for each row in SELECT campo1, campo2 from TABLE</em>
<em>do</em>
<em>solicitudes[] = [row.campo1, row.campo2]</em>
<em>end</em>
<em>return solicitudes
</em>And the debugger says that SQL instructions can be used only in fuctions and procedures that are executed on the server.
Do you know another way to do it?
P.D. Sorry for my terrible english
GreetingsHi Steve,
Thank you, your idea is perfect, but when I try to run the screenflow where the combo should be filled I get this error:
fuego.lang.ComponentExecutionException: No se ha podido ejecutar correctamente la tarea.
Motivo: 'java.lang.NullPointerException'.
at fuego.web.execution.InteractiveExecution.setExecutionError(InteractiveExecution.java:307)
at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:166)
at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
at fuego.webdebugger.servlet.DebuggerServlet.redirect(DebuggerServlet.java:136)
at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:85)
at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at fuego.web.execution.servlet.ServletExternalContext.forwardInternal(ServletExternalContext.java:197)
at fuego.web.execution.servlet.ServletExternalContext.processAction(ServletExternalContext.java:110)
at fuego.webdebugger.servlet.DebuggerExecution.dispatchComponentExecution(DebuggerExecution.java:64)
at fuego.web.execution.InteractiveExecution.invokePrepare(InteractiveExecution.java:351)
at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:192)
at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:223)
at fuego.webdebugger.servlet.DebuggerServlet.doDebug(DebuggerServlet.java:148)
at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:82)
at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
Any ideas??
Thanks and greetings -
Sender JDBC Adapter : Fetch records from multiple tables
Hi Friends,
I am using sender JDBC adapter to select few records from DB2 database table.
This scenario is working fine.
Now my requirement is to fetch records from 3 tables. These table are independent to each other. There is no primary key or foreign key.
Please let me know how to write the sql in sender JDBC adapter to fetch records from these 3 tables.
Thanks,
Sandeep Mauryahi sandeep...
if the tables are completely independent and do not share any primary / foreign key relation ship...
why dont u think towards creating a seperate interface for each of them..
or if u still want to select from multiple table at once..the best way would be to write a stored procedure on the sender side which do all the fetching n processing and pass the final resultset to PI
or u can think towards fetching the data from 1 table and then in UDF do lookup from other tables..which again is tricky and performace intensive -
JDBC Sender Adapter - NOT FETCHING RECORDS...
Hello Experts,
I know this was answered in a separate thread (JDBC Sender Adapter - NOT FETCHING RECORDS -PROCESSING STARTED).
However, my question is, Is there a way that we can be notified if a channel has stopped fetching records?
or is there a reporting tool that can be used to check/monitor if a channel is not processing any messages?
Thanks & Kregards,
allarHi Sreedhar,
Thanks for your reply.
These case is not being captured by our alert configuration because its not throwing any error.
in the communication channel monitoring, we see only something like this..:
3/16/09 8:25:19 PM Processing started
3/16/09 8:34:20 PM Processing started
3/16/09 8:33:55 PM Processing started
3/16/09 8:32:54 PM Processing started
but no error is being displayed nor sent.
Also, there was a case that the channel just stopped fetching, even though everything is active.
example log:
3/12/09 8:32:54 PM Processing started
We're looking for ways on how we can trap these scenarios as early as possible, get us notified and perform adapter-lock release when needed.
Regards,
allar -
Time out error while fetching records from table BKPF
Hi,
I am fetching records from table BKPF using BUKRS & AWKEY in where clause. Query is as follows:
SELECT BELNR XBLNR AWKEY
FROM BKPF
INTO TABLE L_I_BKPF_TEMP
PACKAGE SIZE 500
WHERE BUKRS LIKE L_C_EG
AND AWKEY IN L_R_AWKEY .
APPEND LINES OF L_I_BKPF_TEMP TO I_BKPF .
ENDSELECT .
Program is giving time out error. There are 25628 records in range L_R_AWKEY , i m fetching 500 records at a time using PACKAGE SIZE. But the execution of prog stops on this query.
Please suggest something to overcome this problem.Hi
Rui is right,
if you need to get the data by operation parameters u have to use the fields AWTYP and AWKEY.
In this selection u can omit the company code.
SELECT BELNR XBLNR AWKEY FROM BKPF
INTO TABLE L_I_BKPF_TEMP
PACKAGE SIZE 500
WHERE AWTYP = <......> "<------------
AND AWKEY IN L_R_AWKEY .
APPEND LINES OF L_I_BKPF_TEMP TO I_BKPF .
ENDSELECT .
Max -
How can i fetch records from 3 tables in a single query without using join
Hi.
Can any body please tell me <b>How can i fetch records from 3 tables with a single query without using joins</b>
Thanx
prabhuduttaHi Prabgudutta,
We can fetch the data by using the views concept.
Go throuth this info we can know the how to create view and same like database table only we can fetch the data.
Views conatin the data at runtime only.
Four different view types are supported. These differ in the
way in which the view is implemented and in the methods
permitted for accessing the view data.
Database views are implemented with an equivalent view on
the database.
Projection views are used to hide fields of a table (only
projection).
Help views can be used as selection method in search helps.
Maintenance views permit you to maintain the data
distributed
on several tables for one application object at one time.
step by step creation of Maintenance view:
With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.
It can be set in transaction SE11 - Tools - Table maintenance generator.
Table maintanance Generator is used to manually input values using transaction sm30
follow below steps
1) go to se11 check table maintanance check box under attributes tab
2) utilities-table maintanance Generator-> create function group and assign it under
function group input box. Also assign authorization group default &NC& .
3) select standard recording routine radio in table table mainitainence generator to move table
contents to quality and production by assigning it to request.
4) select maintaience type as single step.
5) maintainence screen as system generated numbers this dialog box appears when you click on create button
6) save and activate table
One step, two step in Table Maintenance Generator
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
SM30 is used for table maintenance(addition or deletion of records),
For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30
Sm30 is used to maintain the table ,i.e to delete ,insert or modify the field values and all..
It creates the maintenance screen for u for the aprticular table as the maintenance is not allowed for the table..
In the SE11 delivery and maintenance tab, keep the maintenance allowed..
Then come to the SM30 and then enter the table name and press maintain..,
Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..
Then create,,,
Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...
We use SM30 transaction for entering values into any DB table.
First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.
Then it will create a View.
After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.
Hope this resolves your query.
Reward all the helpful answers.
Rgds,
P.Naganjana Reddy -
Writing OR query for fetching records
Hi,
I have dowloaded a custom wsdl and generated a java client from it using Jdeveloper.
I have a method named customObject1QueryPage(QueryInputObj) which is used to query the CRM oD to fetch records.
I have successfully queried using the above method for one condition:-
QueryInputObj param= new QueryInputObj();
QueryType q = new QueryType();
q.set_value("='" + "ABC'");
//q.set_value("LIKE 'A*'");
param.setAccountName(q);
customObject1QueryPage(param);
But now I want to query using "OR" condition with multiple names in the condition and I don't know how to
write query for that.
SQL query would be like "Select * from table where name='ABC' OR name='PQR' OR name ='XYZ' ";
I want to execute same query for CRM oD but have no idea how to write it.
Can somebody please help me as soon as possible.
Thanks.Hi,
If your intent to Use OR Condition on a field with multiple Values
say, AccountName = 'xyz' OR AccountName= 'abc' the syntax would be *(='xyz') OR (='abc')*
say, AccountName = 'xyz' OR AccountName= 'abc' OR AccountName = 'pqr' the syntax would be *((='xyz') OR (='abc'))OR(='pqr')*
You can find similar example under On Demand Web Service Documentation
Regards
Deepak H Andeli -
SQL query to fetch records from 26 onwards
Want to know SQL query to fetch records from 26 onwards.
See the fifth entry on the FAQ page:
Re: How to attach a java bean in forms6i -
Fetch records from Database based on Input value
Hi Experts,
In my mobile application, I have designed one input field with F4 help or input assist. I need to fetch records from database based on that input and need to display records in table.
My question is:
How to fetch the records from database/back end based on the input value and display them as table format as we are doing in SAP ABAP?
Here, I need to fetch the records based on input value available in the UI screen and pass that value to gateway, fetch the records from database and need to bind with table in SAPUI5.
Kindly share the whole process flow with sample code for this requirement. Hope I have explained the requirement in detail.
Thanks In Advance..
Regards,
Arindam Samanta.Hi,
Try something like this.
In this, I am passing From date, To date, RelGrp, RelStr, Uname as input. Then I am storing those values in variables and passing this data in Odata request.
OData.read({ requestUri: "http://xxxx:8000/sap/opu/odata/sap/Z188_PO_SRV/pos?$filter=Docdate le datetime'"
+ todateformat+"T00:00:00' and Docdate ge datetime'"
+ fromdateformat+"T00:00:00' and RelGrp eq '"
+ relcode +"'and RelStr eq '"
+ relstg +"'and Uname eq '"
+ username+ "' "},
function (data) {
console.log(data);
When we are giving correct inputs it will goes to Success function and get the data from back end.
In console we can see the data.
Hope this will helps to you.
Thanks&Regards
Sridevi -
How to fetch records with two recordset
i want fetch records from the table using two recordset like
ResultSet r1=stmt.executeQuery("select * from pf_data");
i want to take another recodeset
ResultSet r2=stmt.executeQuery("select * from finyr");
I am using Microsoft SQL server as my database.
I am also closing the recordset like r1.close();
then i cannot take two recordset at the same time.Hi,
This is an example of a Top-N problem, and here's one way to do it:
WITH got_r_num AS
SELECT item_id, supp_id, rnk -- RANK is not a good column name
, DENSE_RANK () OVER ( PARTITION BY item_id -- Just guessing
ORDER BY rnk
) AS r_num
FROM table_x
WHERE item_id = 2 -- If desired
SELECT item_id, supp_id. rnk
FROM got_r_num
WHERE r_num <= 2
RANK is the name of a built-in function in Oracle, so it will cause lots of trouble if you use it as a column name. (The RANK function is closely related to DENSE_RANK, used above.)
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Point out where the query above is giving the wrong results, and explain, using specific examples, how you get the correct results from the given data in those places. If you changed the query at all, post your code.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
How to notify in case SQL query(JDBC sender adapter) does not fetch records
hi,
How can we notify(by alerts or something) in case SQL query(JDBC sender adapter) does not fetch records? In channels logs it only says processing started & finished(no message is created for same).
Thanks,
MayankHi,
1 ) What is exact audit log message ?
2) Try fetching the count in SQL statement if there are any valid records it will give the count.
May for testing you can use <TEST> in update statement.
3) Have you used taskTimeout parameter ?
4) Are multiple channels polling on same table ?
regards
Ganga -
hi guruz,
i have requirement something like that in a table more than 3 lakh record are there.
i want to fetch records in a block of 1000 . how can i achive this.
i already implemented one way that fetch all records (3 lakhs) one time , and process those in internal table .
But selecting 3lakhs records at one time abap application server giving timeout error.
some cofigraution required or what.
please guide me.
warm regards.Hi,
what about doing it package by package ( 1 package = 1000 rows) and process the int. table as you like:
DATA: itab TYPE STANDARD TABLE OF SCARR WITH NON-UNIQUE
DEFAULT KEY INITIAL SIZE 10.
FIELD-SYMBOLS: <FS> TYPE scarr.
SELECT * INTO TABLE itab PACKAGE SIZE 1000 FROM scarr.
LOOP AT itab ASSIGNING <FS>.
... process it
ENDLOOP.
ENDSELECT.
Set the package size high enough that you have not many additional selects
(10.000 or 50.000 should be also ok).
Please be aware that the int. table is only defined inside the SELECT / ENDSELECT.
bye
yk -
List Of Value not fetching records
I have a ViewObject (VO1) with a ListOfValue that points to a ViewObject (VO2), and fetches records from VO2. There is no ViewCriteria added on VO2.
When testing in the BC tester, the LOV works fine. Both on editing a row in VO1, and when creating a row in VO1.
Using the LOV in a jspx page, the LOV works fine when editing a row in VO1. But when I'm creating a new row in the jspx page, the LOV doesn't fetch any records. Just an empty list.
I can't figure out what is wrong, or why it doesn't work. I have created several LOV all working like a charm, but this one is making me tear my hair out.
Anyone else experienced a similar scenario where a LOV only works upon editing a row?
Any ideas what can be wrong?
(I am using JDeveloper 11.1.1.5.0 - Build JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013 - Running on a Windows 7 64bit)
Edited by: hogni89 on May 3, 2012 4:01 AMThe SOC on the jspx page:
<af:selectOneChoice value="#{row.bindings.IdSosBasGrantType.inputValue}"
label="#{row.bindings.IdSosBasGrantType.label}"
required="#{bindings.SosBasCaseGrantPerCaseType.hints.IdSosBasGrantType.mandatory}"
shortDesc="#{bindings.SosBasCaseGrantPerCaseType.hints.IdSosBasGrantType.tooltip}"
id="soc12" autoSubmit="true">
<f:selectItems value="#{row.bindings.IdSosBasGrantType.items}" id="si11"/>
</af:selectOneChoice>
The iterator binding:
<tree IterBinding="SosBasCaseGrantPerCaseTypeIterator" id="SosBasCaseGrantPerCaseType">
<nodeDefinition DefName="fo.att.alm.sos.model.bas.views.SosBasCaseGrantVO" Name="SosBasCaseGrantPerCaseType0">
<AttrNames>
<Item Value="Seq"/>
<Item Value="IdSosBasGrantType"/>
<Item Value="IdSosBasGrantVariant"/>
<Item Value="RuleType"/>
<Item Value="Status"/>
<Item Value="IdAplCfgPartyType"/>
</AttrNames>
</nodeDefinition>
</tree>
The ViewAttribute:
<ViewAttribute
Name="IdSosBasGrantType"
LOVName="LOV_IdSosBasGrantType"
IsUnique="true"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="IdSosBasGrantType"
EntityUsage="SosBasCaseGrantEO"
AliasName="ID_SOS_BAS_GRANT_TYPE">
<Properties>
<SchemaBasedProperties>
<CONTROLTYPE
Value="choice"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
The ListBinding:
<ListBinding
Name="LOV_IdSosBasGrantType"
ListVOName="SosBasGrantTypeUsgLOV"
ListRangeSize="-1"
NullValueFlag="none"
NullValueId="LOV_IdSosBasGrantType_LOVUIHints_NullValueId"
MRUCount="0">
<AttrArray Name="AttrNames">
<Item Value="IdSosBasGrantType"/>
</AttrArray>
<AttrArray Name="ListAttrNames">
<Item Value="GrantTypeId"/>
</AttrArray>
<AttrArray Name="ListDisplayAttrNames">
<Item Value="ObjectTypeDisplayName"/>
</AttrArray>
<DisplayCriteria/>
</ListBinding>
The ViewAccessor
<ViewAccessor
Name="SosBasGrantTypeUsgLOV"
ViewObjectName="fo.att.alm.sos.model.bas.views.SosBasGrantTypeUsgRO"
RowLevelBinds="true"/> -
Query - to fetch records - before particular date
I need to retrive last analyzed table prior to 28/Nov/2010 - to put into simple wanted to fetch records from a table which are created before the above mentioned date.
Thanks,
SteveSpade wrote:
I need to retrive last analyzed table prior to 28/Nov/2010 - to put into simple wanted to fetch records from a table which are created before the above mentioned date.
Thanks,
SteveYou want to fetch the rows which were "inserted" before that date?
Then you either:
a) Need to have a timestamp column on the row or
b) Use ORA_ROWSCN pseudo-column if you created your table(s) with row-level dependency tracking or
c) Install log miner and query the necessary archive logs.
:p -
Hi All,
I have a table and i want to fetch records where rownum>20 and rownum<31(i.e records from 21 to 30).
What will be sql query for this.Kindly suggest.
Thanks,
VineetFor what its worth I'll throw in my 2 cents. I see this question a lot on forums.
In a relational DB like Oracle, row numbers dont really have much significance. If you query the table, there is no guarantee Oracle will return the results in the order you loaded them in.
So what may be in rows 21-30 now could change tomorrow if you added or deleted more rows. If you wanted say the top 10 records (based on a specific condition) that would be one thing.
There must be some criteria for wanting to pull back only those rows. Instead of naming the rows specifically, you should look into setting a condition in your WHERE clause which pulls back those records.
In Oracle, if you are going to explicity name rownums, you better have an ORDER BY clause, or you will not be guaranteed of any actual order.
Personally speaking, using rownum as criteria except for a TOP N query is not great practice.
Hope that helps!
Maybe you are looking for
-
Hi I have created a sales order type (XXX)which I only use as template for creating other order types. How du I ensure that orders of type XXX is not relevant for billing. this also means that I don't want it to be a part of vf04 or any other sap rep
-
My name is Vibhor and i have multiple opening in NYC please let me know if anyone of you will be interested in it. I can be reached on eMail [email protected] Regards Vibhor
-
Solution Manager on 32-Bit for ECC-6
Hi Gurus, We need to bring our 32-Bit ECC-6 system on EhP4 as soon as possible. From installtion documents I found that its two step installation. First install EhP3 and then EhP4 using SAINT. To install EhP we need use Solution Manager. Currently we
-
How to unlock firmware for the Intex Cloud Fx (Spreadtrum sc6821 chipset)?
I was looking for an update for the past few months for my Intex Cloud Fx , which is up-to-date to 1.3 I then realized that a new version is under development (Firefox OS 2.0 unstable), still I am stuck with the same touch lagging operating system ev
-
hi all i have a page report that can print single rows and print the entire table, my problem is my boss wants me to put an option in the page report where in i can select multiple rows and be able to print then at once. i read a portion pertaining t