Record set
Hi
I come from VB background and very new to java.
Is it possible to return a record set from call method like in VB?
AP
Yes.
Similar Messages
-
Using a session object to hold the value of a record set?
Hi,
I'm trying to hold the value of a record set (or literally the content of a column in a query in a db) in a session variable so that I can call on this later and insert into another table.
I'm not sure of the correct syntax, I've already made a connection to the DB. I'm trying the following but it doesnt seem to like the code:
<% session.setAttribute("code",rs("column_name")); %>
<%String attrib =
String.valueOf ( session.getAttribute("code")); %>
Hello <%= attrib %>
Any ideas, I dont know how to reference the record set, I declared the recordset previously as rs. Help! Can't find examples anywhere on the net!So just to recap. I appear to be seeing the column name "custorderno" within the Microsoft Access query "lastcust". But I get "no data found" when I run the following code (which I have sectioned off)
<!-- connect to database and lastcust query --!>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/Tomcat/jakarta-tomcat-4.1.31/webapps/ROOT/Oatcake.mdb","","");
Statement statement = conn.createStatement();
String sql = "SELECT * FROM lastcust";
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
%>
<TR><TD><%= rs.getString("custorderno") %></TD>
</TR>
<% session.setAttribute("code",rs.getString("custorderno")); %>
<% String attrib =
String.valueOf ( session.getAttribute("code") ); %>
Hello <%= attrib %> [B]
<%
%>
</TABLE>
<%
if (statement != null)
statement.close();
if (conn != null)
conn.close();
catch (Exception e) {out.print(e);}
%>
</BODY>
</HTML>
No as mentioned I am (as you can see) declaring everything as a string when in actual fact the contents of the "custorderno" within the query is set to a autonumber within MS Access.
The while loop does work by returning the contents but the session object part is not working correctly with the following result returned:
[B]java.sql.SQLException: No Data Found
Help please! -
How to get the record set into array?
Hi,
I want to get the record set into array in the procedure and do the processing of the array later in procedure.
below is the stored procedure i am working on:
procedure bulk_delete_group(p_group_id in Array_GroupListID) as
begin
for i in p_group_id.first..p_group_id.last loop
--Here I have to get the list of user id before deleting group
SELECT user_id into *<SOME ARRAY>* FROM group_members WHERE group_id = p_group_id(i);
DELETE group WHERE group_id = p_group_id(i);
--Process the user id array after group deletion..
end loop;
end bulk_delete_group;
Thanks in advance
AdityaSomething like this ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.20
satyaki>
satyaki>
satyaki>select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
9999 SATYAKI SLS 7698 02-NOV-08 55000 3455 10
7777 SOURAV SLS 14-SEP-08 45000 3400 10
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 4450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 7000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
13 rows selected.
Elapsed: 00:00:02.37
satyaki>
satyaki>create type np is table of number;
2 /
Type created.
Elapsed: 00:00:03.32
satyaki>
satyaki>Create or Replace Procedure myProc(myArray np)
2 is
3 i number(10);
4 rec emp%rowtype;
5 Begin
6 for i in 1..myArray.count
7 loop
8 select *
9 into rec
10 from emp
11 where empno = myArray(i);
12
13 dbms_output.put_line('Employee No:'||rec.empno||' Name:'||rec.ename);
14 end loop;
15 End myProc;
16 /
Procedure created.
Elapsed: 00:00:00.88
satyaki>
satyaki>
satyaki>declare
2 v np:=np(9999,7777);
3 begin
4 myProc(v);
5 end;
6 /
Employee No:9999 Name:SATYAKI
Employee No:7777 Name:SOURAV
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.30
satyaki>Regards.
Satyaki De. -
By which method,i can get the no of rows in the record set?
Does anyone help me that by which method,i can get the no of rows in the record set?
now i use next() to check whether the next record is available or not?shashi_rajak wrote:
under Practice Exercise #1 heading :
there is a statement.
"Now, the COUNT function does not need to retrieve all of the fields from the table (ie: employee_number, employee_name, and salary), but rather whenever the condition is met, it will retrieve the numeric value of 1. Thus, increasing the performance of the SQL statement."And have you ever tried it? Or do you simply blindly believe everything you read? And what sort of "authority" is "tech on the net"?
P.S. A quick test on Oracle (and you must do each query at least twice throwing away the first result, as Oracle always caches things which will have an effect, and averaging the remaining attempts).
count(*) -- 1 min 17 secs for 35,311,978 rows
count(1) -- 1 min 19 secs for 35,311,978 rows
Edit: And the table has 46 columns. -
Doubt on Record set in File Content Conversion
Hi
Please give me the procedure for Deleting record set in file conet conversion means hoe can i delete Recordset(tag) using File conent conversion.
Thankshi
<documentName>...
<recordset>
<NameA>
<field-nameA1>field-value</field-nameA1>
<field-nameA2>field-value</field-nameA2>
<field-nameA3>field-value</field-nameA3>
</NameA>
<NameB>
<field-nameB1>column-value</field-nameB1>
<field-nameB2>column-value</field-nameB2>
<field-nameB3>column-value</field-nameB3>
</NameB>
</recordset>
<recordset>
</recordset>
</documentName>...
In above file record set i want to delete usind sender side.
Thanks -
File content conversion record set per message
Dear All,
Problem:- File is of huge size because of which file content conversion is taking longer time and is failing.
File format:-
Header
Detail
Detail
Header
Detail
Detail
Detail
Detail
Header
Detail
Detail
Trailer
Trailer has total count of all detail record,header record and there are few checks as well as wrt other fields.
We need to do all the above validation on the file and if it successful it shud process it otherwise alert shud be raised.
As a step:-
I have used record set per message for splitting up the file because of huge size this functionality is working fine but because of spitting of file i am not able to do trailer validation as XI is creating multiple records with different message ID's
Is any other approch which will help to achieve both Spliting as well as validation
chiragChirag,
simplest scenario I can think of is splitting the 2 reqs.
1. create 2 folders, one for "in process" files and other for "validated" files.
2. create 2 scenarios:
2.1. your current sender system to in process folder (whatever to File).
=> In this you just do the validation, without FCC. You could create a simple module for that or even do it at mapping runtime, as you said (mapping may be easier to handle errors), and throw a runtime exception (which will eventually trigger an alert).
=> At the end, only files that go successfully throug the validation will be located in the "In Process" folder.
2.2. do a simple file to file scenario (from "In Process" to "Validated" folder), this time executing FCC & splitting messages if necessary.
Of course, this will only work if the module/mapping is able to process the large file anyway (hopefully yes, since it will still be a flat file and not XML yet).
BR,
Henrique. -
Using the follwing query
select distinct code from oalr where code > '" & AlertCode & "' and code<=('" & code & "') "
i got 5 records eg :5603,5604,5605,5606,5607
record set fetching
Ocode = CStr(rs4.Fields.Item(0).Value)
Here Ocode get only last record eg :5607, i want to take this 5 records in the loop how can i write the codingThank for ur reply,
But i not passing this in to matrix , i m going to pass the value in to anothe record set
eg
Ocode = CStr(rs4.Fields.Item(0).Value)
select A.code,A.MsgData,B.UserSign,C.Portnum as MobileNum from OALR A inner join ALT1 B on A.Tcode=B.code inner join OUSR c on C.UserID=B.UserSign where A.code='" & Trim(Ocode) & "' ")
I want to pass the Ocode value in to the loop.becoz only one value pass this query next time pass means duplicate value prob occure so i want to pass the Ocode value up to EOF. Give some solution -
Reg: When trying for [Record Set Per Message] Payload not generating MONI
Hi,
Can you please change the value of FCC parameters from
Record Set Per Message:: 1
Key Field Value: KF
Key Field Type: Case Sensitive
Record Set Per Message:: 1
Key Field Value: K01
Key Field Type: Case Sensitive
Regards,
ChandraHi,
If you want to split file according to Record set per message, check below settings with your configuration.
Ex file:
Amarsrinivas,Eli,4444,XYZ,3
Sachin,Tendulkar,29564,ABC,9
Ajay,Jadeja,5555,PQR,5
*IR PART*
See this is the Outbound Data type I have created::
*ADT_Record_Outbound Complex Type *
Record Element 0..unbounded(This is used for if Record set per message more then one.Structure Occurance.Not the message type)
First_Name Element xsd:strin 1
Last_Name Element xsd:string 1
EMP_ID Element xsd:string 1
Project_Status Element xsd:string 1
Experience Element xsd:string 1
THis is the Inboudn Data type I have created::
ADT_Record_Inbound
*ADT_Record_Inbound Complex Type *
Record Element 0..unbounded(This is used for if Record set per message more then one.Structure Occurance.Not the message type.One to one mapping done)
FullName Element xsd:string 1
Global_ID Element xsd:string 1
Project Element xsd:string 1
IT_Exp Element xsd:string 1
This is the Mapping I have done.....
ForSource Message TYpe I kep Occurancs as 1
For Target Message Type as I kept Occurances as 1
ID Part::
CONTENT CONVERSION PARAMETERS::
Document Name:: AMT_Record_Outbound
Document Namespace:: http://xxxxxxxxxxxxxxxxxxxxx
Document Offset::
RecordSet Name::Record
RecordSet Structure: ---:Record,*
Recordset Sequence,* ::: Assensding
Record Set Per Message:: (As you required)(According to that target file and message will create)(If you mention 2 each 2 structure one message will flow in SXMB_MONI)
Key Field Value:
Key Field Type: Case Sensitive
Record.fieldSeparator= ,
Record.endSeparator= nl
Record.fieldNames= First_Name,Last_Name,EMP_ID,Project_Status,Experience
ignoreRecordsetName= true
Regards,
Prakasu.M -
We're using a function to return a ref cursor back to VB.
Works great until we try and update it. As soon as we try and update the record set we're getting an error "Multi-step operation generated errors. ". It looks to us like the record set is read-only. We've tried using an in-out parameter to a procedure - same problem. However, it works fine as long as we pass the sql instead of a call to a function or procedure.
We don't really want to have to pass the sql.
Can anyone help with this ?
Thanks,
Tricia.Ref cursors that are returned to an application from a stored procedure are read-only if you're using ODBC or OLE DB. I believe that the beta .NET native provider will allow you to update returned ref cursors, however.
The reason it works when you issue straight SQL is that the driver actually modifies your SQL statement to get the ROWID's for all the rows. Then, it's able to update rows by building its own SQL insert statement.
Justin -
Can we enable "Select record Set Message choice" of Table in left side
Hi ,
I have requirement to set the "Select Record Set " Message choice of a table region on left side.
Ex:If there are more records in a table region and message choice available to select next set of records.
You can chk in Workflow Status Monitor function.
Its the Navigation Bar to be @ left side on the table Region whcih allows you to navigate the records set.
Thanks,Sarath.
Edited by: SarathL on Dec 13, 2011 4:59 PMHi,
Not sure what exactly you are looking for.
The Next link and option to select next set of rows comes to your OA Table by default .. isn't it?
-Idris -
Nested sort order for record set?
I've set up a record set using the Dreamweaver server behaviour wizard, and have sorted the records (a list of names) alphabetically. However I need to do what I would describe as a nested sort order: I want to sort firstly by a flag, and then in alphabetical orde by name.
Here's my code:
$query_artists = "SELECT artist_id, artist_name, `new` FROM artists WHERE setting_flag = 'S' ORDER BY artist_name ASC";
So I want to order by a field called 'new' (and alphabetically for all records with the flag), and then the remainder alphabetically.
Is this possible?
ThanksThat's great, thankyou so much. I thought it would be something simple but hadn;t been able to find it by googling it. Working perfectly.
SW -
Record set size in Gantt Chart
Hi all,
I am developing an application that has a Gantt Chart.
The tree drawn is a 2 level tree. I have two VOs.
The second VO (Child) has more than 20 rows. I want to show only 10 child at once.
Record set size attribute is the one that is used to restrict the size of the number of nodes displayed. Just like in HGRID.
But when the graph is rendered the values that I give are being ignored and the entire graph is rendered.
Any pointers or suggestions on this will be really helpful.
Regards,
Santhosh.Hi Santosh,
As Anand suggested to add the "rownum <= 10" condition to limit the record set.
But this condition should be set in View Link SQL(Query where clause).
I hope this will work.
Thanks
Renu -
User selection to return filtered record set
Hi,
I want to create a JSP which allows a user to enter search criteria for several columns of a table. I will use the entered values to set the sql where clause and produce the filtered record set. (eg the user enters a particular customer code and status code in order to see a list of orders placed by that customer which have the selected status code.)
The problem I have is this: I want the input fields for the selection criteria to be combo boxes populated with values from the database.
What is the best way to do this?Hi,
I want to create a JSP which allows a user to enter search criteria for several columns of a table. I will use the entered values to set the sql where clause and produce the filtered record set. (eg the user enters a particular customer code and status code in order to see a list of orders placed by that customer which have the selected status code.)
The problem I have is this: I want the input fields for the selection criteria to be combo boxes populated with values from the database.
What is the best way to do this? -
How to build dynamic databases(record set) for mobile?
Hi All ,
i have an applocation that needs to personalize the data for users .
i have the data available , but dont know how to personalize it fot users to download special version of my application.
how to build dynamic databases(record set) for mobile?In the load rule in the dimension build settings you would need to go to the tab dimension definition, choose the time dimension and right click on it. Select Edit properties. If you have not done so, set the dimension to be the time dimension. Then go to the generations/levels tab and set the generation names you need. For example if you want YTD, you would set the generation name to Year, if you want QTD set it to Quarter. You would set the number to the generation number that coorisponds to the generation. The DBAG has the list of names for all of the DTS members.
-
Return a record set from a procedure
I am building an application for my company.
Before oracle I had used MS SQL Server for a long time.
I build a procedure as following
CREATE OR REPLACE PROCEDURE YBP.ReturnSet
-- Return a record set from a procedure
IS
BEGIN
SELECT * FROM fdbase;
END;
But the complier show me a error message:
<font color="#0000FF">PLS-00428 an INTO clause is expected in this SELECT statement</font>
I read the error details
<font color="#0000FF">"In PL/SQL, only a subquery is written without an INTO clause."</font>
But I know that this procedure can run well in <font color="#0000FF">MS SQL Server .</font>
How I can do this thing in Oracle
Any help will be appreciate!I have a stored proc that is defined as
CREATE or REPLACE
PROCEDURE ABC
(linkid IN CHAR,
Year_in IN DATE,
Method_in IN CHAR,
Date_out OUT DATE,
average_out OUT NUMBER)
is
begin
.. Date_out := ...;
average_out := ...;
end;
another partially completed stored proc that returns a ref
cursor defined as follows:
create or replace package zzz
as
type cursorType is ref cursor;
end;
create or replace function test return zzz.cursortype
as
date_OUT date;
Average_OUT number;
l_cursor zzz.cursorType;
CURSOR temp_cur is
SELECT l.linkid, L.routenumber, ABC(l.linkid,
to_date('01/01/2000', 'mm/dd/yyyy'),
'2',
date_OUT,
average_OUT)
FROM LINK l
WHERE l.LINKID <= '010999';
begin
open temp_cur;
end;
inside test (which I need help completing), how can I refer to
the date_out and the average_out params returned by ABC() so
that these values are in turn passed to the cursortype defined
in package zzz?
Thanks in advance. -
I have a record set that has the following MYSql statement
SELECT *
FROM Tickets p JOIN Customer c ON p.Cust_Num = c.Cust_Num
WHERE p.Location_Code = '" & strloc3 &"'
ORDER BY Ticket_No DESC
I have a repeat region that show 10 rows of data.
I have on my form some tabs labeled ticket No date make etc (
these are all
fields in the table)
I need the following to happen when a client clicks on say
the Date radio
button
SELECT *
FROM Tickets p JOIN Customer c ON p.Cust_Num = c.Cust_Num
WHERE p.Location_Code = '" & strloc3 &"'
ORDER BY Date DESC
How do I get the action on a radio button click.
How do I then change the MYSql statement in the record set
and run the
statement.
The client should then see all records sorted by date...
Cheers
SteveWAre you sure you want to sort this on the database? Depending
on how many rows are returned and query performance, you might want
to just use jscript/dom to sort the rows.
Maybe you are looking for
-
Firefox won't open links from Mac Mail
Like everyone else Apple Mail links will not open in Firefox if it is already open. Clicking a link brings FF to the front but no page loads. Links work if FF is not open. Links work if command is pressed whilst clicking the link (opens in new tab in
-
Empty file handling in file?
hi Q: how to handle empty file in sender/reciver file adapter? Thanks&Regards upendra kumar
-
Error in FTXP -Calculation procedure not maintained correctly for level 000
Hi Guru I am creating a new tax code A7 through trx. FTXP. It is a copy of another code A1 and only percentage needs to change for eg. from 60% to 25%. After changing while saving i get error - 'Calculation procedure not maintained correctly for leve
-
Hi guys, I need information on OIM 9i to 11g migration tool. Can anyone provide me documentation on the same? Many thanks, Gyan
-
ihave a problem regarding the firmware update of my N85. when updating (via pc suit) in between the phone gets switched off by itself , nd in pc it shows cable disconnected . i've tried too many times by refering troubleshoot but update failed . pl