How to fetch rows using exec_sql
hello to all
i want to open a cursor and fetch some field values dynamically."the fields to be fetched will be selected by the user" i.e i have to get the data of the fields selected by the user.
for this i am using the exec_sql method.
its giving a message as 'FRM-01747: invalid user.table.column,table.column or column specification"
i don't where i am wrong in the code.
this is my code to fetch the values
Declare
Con_id EXEC_SQL.CONNTYPE;
Cur_id EXEC_SQL.CURSTYPE;
sqlstr varchar2(3000);
fld1 number(20,2);
fld2 number(20,2);
fld3 number(20,2);
fld4 number(20,2);
fld5 number(20,2);
fld6 number(20,2);
fld7 number(20,2);
fld8 number(20,2);
nEmpno number(10,4);
nIgn PLS_INTEGER;
totRows number(5);
a number;
Begin
--1
Con_id := EXEC_SQL.DEFAULT_CONNECTION;--('scott/tiger@siil');
go_block('BlkDet');
Cur_id := EXEC_SQL.OPEN_CURSOR();
sqlstr := 'Select A.EmpNo,A.'||:BlkMain.LstFld1||',A.';
sqlstr := sqlstr||:BlkMain.LstFld2||',A.';
sqlstr := sqlstr||:BlkMain.LstFld3||',A.';
sqlstr := sqlstr||:BlkMain.LstFld4||',B.';
sqlstr := sqlstr||:BlkMain.LstFld1||',B.';
sqlstr := sqlstr||:BlkMain.LstFld2||',B.';
sqlstr := sqlstr||:BlkMain.LstFld3||',B.';
sqlstr := sqlstr||:BlkMain.LstFld4;
sqlstr := sqlstr||' from Tempsalmast A, SalMast B';
sqlstr := SqlStr||' where A.EmpNo=B.EmpNo';
Message(SqlStr);
Message(SqlStr);
EXEC_SQL.DEFINE_COLUMN(Con_id,Cur_id,1,nEmpNo);
EXEC_SQL.DEFINE_COLUMN(Con_id,Cur_id,2,Fld1);
EXEC_SQL.DEFINE_COLUMN(Con_id,Cur_id,3,Fld2);
EXEC_SQL.DEFINE_COLUMN(Con_id,Cur_id,4,Fld3);
EXEC_SQL.DEFINE_COLUMN(Con_id,Cur_id,5,Fld4);
EXEC_SQL.DEFINE_COLUMN(Con_id,Cur_id,6,Fld5);
EXEC_SQL.DEFINE_COLUMN(Con_id,Cur_id,7,Fld6);
EXEC_SQL.DEFINE_COLUMN(Con_id,Cur_id,8,Fld7);
EXEC_SQL.DEFINE_COLUMN(Con_id,Cur_id,9,Fld8);
EXEC_SQL.PARSE(Con_id,Cur_id,sqlstr,EXEC_SQL.V7);
nIgn:=EXEC_SQL.EXECUTE(Con_id,Cur_id);
while (EXEC_SQL.FETCH_ROWS(Con_id,Cur_id)>0) Loop
EXEC_SQL.COLUMN_VALUE(Con_id,Cur_id,1,nEmpNo);
EXEC_SQL.COLUMN_VALUE(Con_id,Cur_id,2,Fld1);
EXEC_SQL.COLUMN_VALUE(Con_id,Cur_id,3,Fld2);
EXEC_SQL.COLUMN_VALUE(Con_id,Cur_id,4,Fld3);
EXEC_SQL.COLUMN_VALUE(Con_id,Cur_id,5,Fld4);
EXEC_SQL.COLUMN_VALUE(Con_id,Cur_id,6,Fld5);
EXEC_SQL.COLUMN_VALUE(Con_id,Cur_id,7,Fld6);
EXEC_SQL.COLUMN_VALUE(Con_id,Cur_id,8,Fld7);
EXEC_SQL.COLUMN_VALUE(Con_id,Cur_id,9,Fld8);
:BlkDet.TxtEmpNo:=nEmpNo;
:BlkDet.DisFld1 :=Fld1;
:BlkDet.DisFld2 :=Fld2;
:BlkDet.DisFld3 :=Fld3;
:BlkDet.DisFld4 :=Fld4;
:BlkDet.TxtFld1 :=Fld5;
:BlkDet.TxtFld2 :=Fld6;
:BlkDet.TxtFld3 :=Fld7;
:BlkDet.TxtFld4 :=Fld8;
next_record;
end Loop;
--next_record;
end;
exception
when others then
Message(Dbms_Error_Text);
Message(Dbms_Error_Text);
can any body pls. help me out
aditya
Fetching rows to display them is a task for the client tool. You need to define a ref cursor therefore.
If you just want to play around, here we go
SQL> DECLARE
2 type t1 is table of emp%rowtype index by binary_integer;
3 var1 t1;
4 v_counter number:=0;
5 BEGIN
6 select * bulk collect into var1 from emp;
7 for vr in 1..var1.count loop
8 dbms_output.put_line(var1(vr).ename);
9 update dept set deptno=var1.deptno Here also Error occured.
10 end loop;
11 END;
12 /
SCOTT
ADAMS
PL/SQL procedure successfully completed.
SQL>
Similar Messages
-
How to add rows using DefaultTableModel?
I'm trying to figure out the ins-and-outs of creating a dynamic table.
I looked for a tutorial, but none of the example programs I found dealt with my particular issue, nor did they explain anything.
For instance, most of the examples looked like this:
table = new JTable();
defaultModel = new DefaultTableModel(10,5);
setModel(defaultModel);But that doesn't work for me -- I'm creating a class that EXTENDS DefaultTableModel, and so if I want to send in parameters, I have a problem.
public MyTableModel() {
super(data, columnNames);
...The above code complains that "you can't access data or columnNames until you call super()!"
But I've seen plenty of example code that DOES send in parameters to super(). How do they get away with that? Is it because they are parameters to the constructor, whereas private/public members of the class are somehow different?
I thought a variable is a variable -- why is one allowed but not the other?
Lastly, I'm trying to figure out, practically speaking, how to load a database with X items, and be able to add rows later. Does that mean I need to use a vector for my data instead of Object[][]?
I've seen BOTH AbstractDataModel and DefaultTableModel used with dynamic tables -- is there any difference between them as far as dynamic tables are concerned?
I was under the impression that I needed to "switch" from ADM to DTM if I wanted to be able to add rows to my table at runtime.
Here are some references to previous discussions I found/participated in on this topic:
http://forum.java.sun.com/thread.jspa?threadID=5224966
http://forum.java.sun.com/thread.jspa?threadID=439141&start=0&tstart=0
Thanks in advance for any help,
Matthew-> I'm creating a class that EXTENDS DefaultTableModel, and so if I want to send in parameters, I have a problem
Well, you would pass in the data and columnNames as parameter when you create your table model.
-> Lastly, I'm trying to figure out, practically speaking, how to load a
-> database with X items, and be able to add rows later. Does that
-> mean I need to use a vector for my data instead of Object[][]?
You just said you extended DefaultTableModel. Well you don't need to do anything it already manages the data for you. You just use the methods provided to update and change the data.
-> I've seen BOTH AbstractDataModel and DefaultTableModel used with dynamic tables
No you haven't. You really don't understand what an AbstractDataModel is do you? Its nothing. You can't use it. It doesn't have any storage for the data, and since there is no data storage you can't access the data or change it. You can't even create an AbstractTableModel. Read your Java text on what an Abstract class it.
The DefaultTableModel extends the AbstractTableModel to provide data storage and ways to get the data and change the data. It notifies the table when any change is made to the data so the table can repaint itself.
-> How to add rows using DefaultTableModel?
Finally, the DTM provides methods that make the model dynamic. Methods for adding and removing rows or adding and removing columns. Read the API for more information.
If you still don't understand how how the methods work then search the forum for examples that use the methods you don't understand. I've posted an example the uses the methods required to add rows or columns. -
How to fetch rows from PL/SQL table(Collections)
Hi,
I retrived rows from the table and stored in to table type.
Now I want fetch these rows and display on the screen. Pls guide me.
following code is my code:
DECLARE
type t1 is table of emp%rowtype index by binary_integer;
var1 t1;
v_counter number:=0;
BEGIN
select * bulk collect into var1 from emp;
for vr in var1.first..var1.last
loop
dbms_output.put_line(var1(1)); --Got an Error Here. Acually I don't Know how to fetch.
update dept set deptno=var1.deptno --Here also Error occured.
end loop;
END;Fetching rows to display them is a task for the client tool. You need to define a ref cursor therefore.
If you just want to play around, here we go
SQL> DECLARE
2 type t1 is table of emp%rowtype index by binary_integer;
3 var1 t1;
4 v_counter number:=0;
5 BEGIN
6 select * bulk collect into var1 from emp;
7 for vr in 1..var1.count loop
8 dbms_output.put_line(var1(vr).ename);
9 update dept set deptno=var1.deptno Here also Error occured.
10 end loop;
11 END;
12 /
SCOTT
ADAMS
PL/SQL procedure successfully completed.
SQL> -
How to fetch rows from a table like search engines do?
Is it possible to fetch rows from a table like Google does? I want to fetch row number 20-40 after the select has ordered the rows.
Pseudo code: select * from log where rownum > 20 and rownum < 40 order by date;
Rownum doesn't work with ordering so I tried:
select * from log where (select * from log order by date) and rownum <20;
But that still doesn't do what I want. I get the "top 20" rows but I can't get rows 20-40.
My real table has 70000 rows and I want to select 69000-70000 so I really need a SQL do fetch only the rows I need.
Any help would be very appreciated!
Best regards,
Christer NordvikSELECT alias_for_rownum, column_names
FROM (SELECT ROWNUM AS alias_for_rownum, column_names
FROM (SELECT column_names
FROM table_name
ORDER BY columns_to_order_by)
WHERE ROWNUM <= last_row_you_want)
WHERE alias_for_rownum >= first_row_you_want
Example:
-- (This example uses the Oracle dept demo table.
SET AUTOTRACE ON EXPLAIN
SELECT rn, deptno, dname, loc
FROM (SELECT ROWNUM AS rn, deptno, dname, loc
FROM (SELECT deptno, dname, loc
FROM dept
ORDER BY deptno)
WHERE ROWNUM <= 3)
WHERE rn >= 2
RN DEPTNO DNAME LOC
2 20 RESEARCH DALLAS
3 30 SALES CHICAGO -
Add Column Delete in report, How to delete row using this delete Option
Hi Friends,
i have a report ,iwant to add an option DELETE in last column.When i click on DElete then respective id sholund be deleted.
My Table Is
CREATE TABLE "DUMY_FILE"
( "ID" NUMBER,
"NAME" VARCHAR2(500),
"FILE_OBJ_ID" NUMBER,
"MIME_TYPE" CLOB,
"DOC_SIZE" NUMBER,
"BLOB_CONTENT" BLOB,
"DESCRIPTION" VARCHAR2(500),
"UPLOAD_DATE" CHAR(25)
How can i do this.
Thanks
Edited by: 805629 on Nov 16, 2010 11:51 PMTrent,
Thanks for you suggestions. .. Let me explain my problem a little better ...
I have a report that lists fields associated with a report ... I have a delete icon which deletes a row and removes it from the underlying table ... however, I am trying to implement a Before header process which runs a pl/sql process that checks if the selected field is the last field in the report ... if so, I want a confirmation dialog to pop up ... if they click cancel .. then the deletion is aborted, else the field is deleted (which triggers other status changes).
Based on this logic if there is a way to implement this based on your suggestion I would appreciate it ...
Here is the process I was trying to use .... but the I have a few issues with this approach
declare
-- cursor to check if this is the last field
cursor fld_cnt is
select count(*) from prm_ptnr_rpt_fields
where report_uid = :P22_REPORT_UID;
num_flds number;
msg varchar2(300);
begin
open fld_cnt;
fetch fld_cnt into num_flds;
If num_flds > 1 then
delete from prm_ptnr_rpt_fields
where report_uid = :P22_REPORT_UID
and field_user_key = :P9_DELETED_FLD;
commit;
:P9_DELETED_FLD := NULL;
msg := :P9_FIELD_NAME || ' Field Excluded From Report' ;
apex_application.g_print_success_message := msg;
else
htp.p('<script type="text/javascript">');
htp.p('
var r=confirm("This is the last field included in this report .. \n Deleting it will Inactivate the report and remove it from schedule (if scheduled) ...\n Do you want to proceed?");
if (r==true)
{ delete from prm_ptnr_rpt_fields
where report_uid = :P22_REPORT_UID
and field_user_key = :P9_DELETED_FLD;
:P9_DELETED_FLD := NULL;
commit;
msg := :P9_FIELD_NAME || ' Field Excluded From Report' ;
update prm_ptnr_rpts
set report_status = 'INCOMPLETE',
active_report = 'N'
where report_uid = :P22_REPORT_UID;
msg := msg || ' and Report Status changed to INCOMPLETE';
apex_application.g_print_success_message := msg;
htp.p('}else {
alert("Delete Action Aborted");
htp.p('</script>');
End if;
Close fld_cnt;
end;
a) Even if I click cancel ... the field still gets deleted ...
b) :P9_DELETED_FLD is the id for the selected field ... I am setting it on the link attributes which places it on the URL ... I would rather user javascript (but not exactly sure how).
Thanks,
Gerald
Edited by: user5459177 on Feb 22, 2011 2:45 PM -
How to fetch messages using IMAPFolder ?
Dear Friends,
Anybody knows how to show messages with IMAPFolder ?
Thank u.
Chirag PatelI have never seen the class IMAPFolder. Here is a class I wrote that returns a table row that has message information from a folder.
Use the messagelist method and pass in the folder you want along with the connection url to your server.
=======================================================================
=======================================================================
import java.util.*;
import java.util.Properties;
import java.net.*;
import java.io.*;
import java.lang.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class EmailListMessages {
static String outputString = "";
public String timeoutVal = "5000";
public String messagelist(String mbox, String url, int timeout) throws Exception {
timeoutVal = timeout + "";
return messagelist(mbox,url);
public String messagelist(String mbox, String url) throws Exception{
int optind;
int port = -1;
boolean verbose = false;
boolean debug = false;
boolean showStructure = false;
Store store = null;
outputString = "";
try {
// Get a Properties object
Properties props = System.getProperties();
props.put("mail.imap.connectiontimeout",timeoutVal);
props.put("mail.imap.timeout",timeoutVal);
// Get a Session object
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);
// Get a Store object
URLName urln = new URLName(url);
store = session.getStore(urln);
store.connect();
} catch (Exception e) {outputString = "Error:Host Connection";}
// Open the Folder
Folder folder = store.getDefaultFolder();
if (folder == null) {
outputString = "No default folder error";
return outputString;
folder = folder.getFolder(mbox);
if (folder == null) {
outputString = "Invalid folder error";
return outputString;
// try to open read/write and if that fails try read-only
try {
folder.open(Folder.READ_WRITE);
} catch (MessagingException ex) {folder.open(Folder.READ_ONLY);}
int totalMessages = folder.getMessageCount();
if (totalMessages == 0) {
outputString = "(No Messages)";
folder.close(true);
store.close();
return outputString;
// Attributes & Flags for all messages ..
Message[] msgs = folder.getMessages();
// Use a suitable FetchProfile
FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.ENVELOPE);
fp.add(FetchProfile.Item.FLAGS);
fp.add("X-Mailer");
folder.fetch(msgs, fp);
for (int i = 0; i < msgs.length; i++) {
dumpEnvelope(msgs,mbox);
folder.close(false);
store.close();
return outputString;
public static void dumpEnvelope(Message m, String mbox) throws Exception {
String fromString = "";
String subjectString = "";
String dtString = "";
String flagString = "";
Address[] a;
int msgNumber = m.getMessageNumber();
if (mbox.equals("Sent"))
// TO
if ((a = m.getRecipients(Message.RecipientType.TO)) != null) {
for (int j = 0; j < a.length; j++)
fromString = a[j].toString();
fromString = ("<td><a href='EmailViewMessage.jsp?messageNumber=" + msgNumber + "&folderName=" + mbox + "'>" + fromString + "</a></td>");
else
// FROM
if ((a = m.getFrom()) != null) {
for (int j = 0; j < a.length; j++)
fromString = a[j].toString();
fromString = ("<td><a href='EmailViewMessage.jsp?messageNumber=" + msgNumber + "&folderName=" + mbox + "'>" + fromString + "</a></td>");
// SUBJECT
subjectString = m.getSubject();
subjectString = ("<td>" + subjectString + "</td>");
// DATE
Date d = m.getSentDate();
dtString = "UNKNOWN";
if (d != null) dtString = d.toString();
dtString = ("<td>" + dtString + "</td>");
// FLAGS
Flags flags = m.getFlags();
StringBuffer sb = new StringBuffer();
Flags.Flag[] sf = flags.getSystemFlags(); // get the system flags
boolean first = true;
for (int i = 0; i < sf.length; i++) {
String s;
Flags.Flag f = sf[i];
if (f == Flags.Flag.ANSWERED)
s = "\\Answered";
else if (f == Flags.Flag.DELETED)
s = "\\Deleted";
else if (f == Flags.Flag.DRAFT)
s = "\\Draft";
else if (f == Flags.Flag.FLAGGED)
s = "\\Flagged";
else if (f == Flags.Flag.RECENT)
s = "\\Recent";
else if (f == Flags.Flag.SEEN)
s = "\\Seen";
else
continue; // skip it
if (first)
first = false;
else
sb.append(' ');
sb.append(s);
String[] uf = flags.getUserFlags(); // get the user flag strings
for (int i = 0; i < uf.length; i++) {
if (first)
first = false;
else
sb.append(' ');
sb.append(uf[i]);
flagString = sb.toString();
String testString = "\\Seen";
if (!flagString.equals(testString))
flagString = ("<td>New</td>");
else
flagString = ("<td> </td>");
outputString = (outputString + "<tr bgcolor='#a9a9a9'>" + fromString + subjectString + dtString + flagString + "</tr>"); -
How to fetch substring using regular expression
Hi,
I am new to using regular expression and would like to know some basic details of how to use them in Java.
I have a String example= "http://www.google.com/foobar.html#*q*=database&aq=f&aqi=g10&fp=c9fe100d9e542c1e" and would like to get the value of "q" parameter (in bold) using regular expression in java.
For the same example, when we tried using javascript:
match = example.match("/^http:\/\/(?:(?!mail\.)[^\.]+?\.)?google\.[^\?#]+(?:.*[\?#&](?:as_q|q)=([^&]+))?/i}");
document.write('
' + match);
We are getting the output as: http://www.google.com/foobar.html#q=database,*database* where the bold text is the value of "q" parameter.
In Java we are trying to get the value of the q parameter separately or atleast resembles the output given by JavaScript. Please help me resolving this issue.
Regards
PraveenBalusC wrote:
Regex is a cumbersome solution for fixed patterns like URL's. String#substring() in combination with String#indexOf would most likely already suffice.I usually agree, although, in this case, finding the exact parameter might be difficult without a small regex, perhaps:
"\\wq=\\s*"in conjunction with Pattern/Matcher, used similarly to an indexOf() to find the start of the parameter value.
Winston -
How to fetch rows from multiple tables
I have a page with items from 3 tables. I need to populate these items with values from the database. The page does not allow me to use multiple automated fetches. So instead I decided to use a pl/sql page process that runs a cursor to get my field values and the uses apex_util.set_session_state to set the field item values. IS there any isues with doing this? Is there a better way?
These tables are not really related so I gues I will stick with the pl/sql to populate and then page process to insert/update/delete. Here is the code I'm using.
Chris
DECLARE
CURSOR get_info IS
select A.FK_STU_BASE, A.FK_CONTACT, A.FK_RELATION, A.PRIORITY, A.CAN_PICK_UP_STUDENT,
A.GETS_STX, A.GETS_STG, A.GETS_STA, A.GETS_DIS, A.GETS_THX, A.GETS_MED,
A.GETS_MAIL, A.NOTES as STUDENT_NOTES, A.USER_FLD1, A.USER_FLD2, A.USER_FLD3,
A.USER_FLD4, A.USER_FLD5, A.LAST_UPDATE_DATE, A.LAST_UPDATE_USER,
B.PK_ID as CONTACT_PK_ID, B.FIRST_NAME, B.LAST_NAME, B.MIDDLE_INIT, B.PREFIX,
B.SUFFIX, B.FK_LANGUAGE, B.PHONE, B.PHONE_UNLISTED, B.PHONE_EXTENSION,
B.PHONE_DESCRIPTION, B.EMERGENCY_PHONE, B.EMERGENCY_UNLISTED, B.EMERGENCY_EXTENSION,
B.EMERGENCY_DESCRIPTION, B.CELL_PHONE, B.CELL_UNLISTED, B.CELL_EXTENSION,
B.CELL_DESCRIPTION, B.CELL2_PHONE, B.CELL2_UNLISTED, B.CELL2_EXTENSION,
B.CELL2_DESCRIPTION, B.WORK1_PHONE, B.WORK1_UNLISTED, B.WORK1_EXTENSION,
B.WORK1_DESCRIPTION, B.WORK2_PHONE, B.WORK2_UNLISTED, B.WORK2_EXTENSION,
B.WORK2_DESCRIPTION, B.FAX_PHONE, B.FAX_DESCRIPTION, B.EMAIL1, B.EMAIL2,
B.NOTES as CONTACT_NOTES, B.FK_LODGING, B.FK_EDUCATION_LEVEL,
C.PK_ID as LODGING_PK_ID, C.FK_ZIP, C.FK_DISTRICT, C.HOUSE_NO, C.LETTER,
C.DIRECTION, C.STREET, C.STREET2, C.PLUS4, C.APT, C.FK_GRIDCODE,
C.FK_MUNICIPALITY, C.OPTIONAL_INFO1, C.OPTIONAL_INFO2, C.OPTIONAL_INFO3,
C.FK_DWELLING, C.OPTIONAL_ZIPCODE
from contact_link A,
contact B,
lodging C
where A.PK_ID = :P470_CONTACT_LINK_PK_ID and
B.PK_ID (+) = A.FK_CONTACT and
C.PK_ID (+) = B.FK_LODGING;
BEGIN
FOR x in get_info LOOP
-- Set Contact Link Items
APEX_UTIL.SET_SESSION_STATE('P470_FK_STU_BASE',X.FK_STU_BASE);
APEX_UTIL.SET_SESSION_STATE('P470_FK_CONTACT',X.FK_CONTACT);
APEX_UTIL.SET_SESSION_STATE('P470_FK_RELATION',X.FK_RELATION);
APEX_UTIL.SET_SESSION_STATE('P470_PRIORITY',X.PRIORITY);
APEX_UTIL.SET_SESSION_STATE('P470_CAN_PICK_UP_STUDENT',X.CAN_PICK_UP_STUDENT);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_STX',X.GETS_STX);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_STG',X.GETS_STG);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_STA',X.GETS_STA);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_DIS',X.GETS_DIS);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_THX',X.GETS_THX);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_MED',X.GETS_MED);
APEX_UTIL.SET_SESSION_STATE('P470_GETS_MAIL',X.GETS_MAIL);
APEX_UTIL.SET_SESSION_STATE('P470_STUDENT_NOTES',X.STUDENT_NOTES);
APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD1',X.USER_FLD1);
APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD2',X.USER_FLD2);
APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD3',X.USER_FLD3);
APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD4',X.USER_FLD4);
APEX_UTIL.SET_SESSION_STATE('P470_USER_FLD5',X.USER_FLD5);
APEX_UTIL.SET_SESSION_STATE('P470_LAST_UPDATE_DATE',X.LAST_UPDATE_DATE);
APEX_UTIL.SET_SESSION_STATE('P470_LAST_UPDATE_USER',X.LAST_UPDATE_USER);
--Set Contact Items
APEX_UTIL.SET_SESSION_STATE('P470_CONTACT_PK_ID',X.CONTACT_PK_iD);
APEX_UTIL.SET_SESSION_STATE('P470_FIRST_NAME',X.FIRST_NAME);
APEX_UTIL.SET_SESSION_STATE('P470_LAST_NAME',X.LAST_NAME);
APEX_UTIL.SET_SESSION_STATE('P470_MIDDLE_INIT',X.MIDDLE_INIT);
APEX_UTIL.SET_SESSION_STATE('P470_PREFIX',X.PREFIX);
APEX_UTIL.SET_SESSION_STATE('P470_SUFFIX',X.SUFFIX);
APEX_UTIL.SET_SESSION_STATE('P470_FK_LANGUAGE',X.FK_LANGUAGE);
APEX_UTIL.SET_SESSION_STATE('P470_PHONE',X.PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_PHONE_UNLISTED',X.PHONE_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_PHONE_EXTENSION',X.PHONE_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_PHONE_DESCRIPTION',X.PHONE_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_PHONE',X.EMERGENCY_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_UNLISTED',X.EMERGENCY_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_EXTENSION',X.EMERGENCY_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_EMERGENCY_DESCRIPTION',X.EMERGENCY_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_CELL_PHONE',X.CELL_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_CELL_UNLISTED',X.CELL_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_CELL_EXTENSION',X.CELL_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_CELL_DESCRIPTION',X.CELL_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_CELL2_PHONE',X.CELL2_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_CELL2_UNLISTED',X.CELL2_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_CELL2_EXTENSION',X.CELL2_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_CELL2_DESCRIPTION',X.CELL2_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_WORK1_PHONE',X.WORK1_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_WORK1_UNLISTED',X.WORK1_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_WORK1_EXTENSION',X.WORK1_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_WORK1_DESCRIPTION',X.WORK1_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_WORK2_PHONE',X.WORK2_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_WORK2_UNLISTED',X.WORK2_UNLISTED);
APEX_UTIL.SET_SESSION_STATE('P470_WORK2_EXTENSION',X.WORK2_EXTENSION);
APEX_UTIL.SET_SESSION_STATE('P470_WORK2_DESCRIPTION',X.WORK2_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_FAX_PHONE',X.FAX_PHONE);
APEX_UTIL.SET_SESSION_STATE('P470_FAX_DESCRIPTION',X.FAX_DESCRIPTION);
APEX_UTIL.SET_SESSION_STATE('P470_EMAIL1',X.EMAIL1);
APEX_UTIL.SET_SESSION_STATE('P470_EMAIL2',X.EMAIL2);
APEX_UTIL.SET_SESSION_STATE('P470_CONTACT_NOTES',X.CONTACT_NOTES);
APEX_UTIL.SET_SESSION_STATE('P470_FK_LODGING',X.FK_LODGING);
APEX_UTIL.SET_SESSION_STATE('P470_FK_EDUCATION_LEVEL',X.FK_EDUCATION_LEVEL);
--Set Lodging Items
APEX_UTIL.SET_SESSION_STATE('P470_LODGING_PK_ID',X.LODGING_PK_ID);
APEX_UTIL.SET_SESSION_STATE('P470_FK_ZIP',X.FK_ZIP);
APEX_UTIL.SET_SESSION_STATE('P470_FK_DISTRICT',X.FK_DISTRICT);
APEX_UTIL.SET_SESSION_STATE('P470_HOUSE_NO',X.HOUSE_NO);
APEX_UTIL.SET_SESSION_STATE('P470_LETTER',X.LETTER);
APEX_UTIL.SET_SESSION_STATE('P470_DIRECTION',X.DIRECTION);
APEX_UTIL.SET_SESSION_STATE('P470_STREET',X.STREET);
APEX_UTIL.SET_SESSION_STATE('P470_STREET2',X.STREET2);
APEX_UTIL.SET_SESSION_STATE('P470_PLUS4',X.PLUS4);
APEX_UTIL.SET_SESSION_STATE('P470_APT',X.APT);
APEX_UTIL.SET_SESSION_STATE('P470_FK_GRIDCODE',X.FK_GRIDCODE);
APEX_UTIL.SET_SESSION_STATE('P470_FK_MUNICIPALITY',X.FK_MUNICIPALITY);
APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_INFO1',X.OPTIONAL_INFO1);
APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_INFO2',X.OPTIONAL_INFO2);
APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_INFO3',X.OPTIONAL_INFO3);
APEX_UTIL.SET_SESSION_STATE('P470_FK_DWELLING',X.FK_DWELLING);
APEX_UTIL.SET_SESSION_STATE('P470_OPTIONAL_ZIPCODE',X.OPTIONAL_ZIPCODE);
END LOOP;
END; -
How to fetch data using Substring & Instring
Hi ,
I have data like
a_76488b_2780c
a_76488b_2780c_
a_76488b_c2780
a_76488b_c2780
a_31487b_5542
a_76488b_2780
i want to fetch data like last 4 numeric digit only
2780
2780
2780
2780
5542
2780I don't know what you have against rexexp_replace, but this works if you want all the digits after the second underscore:
WITH t AS
(SELECT 'a_76488b_2780c' str FROM DUAL
UNION ALL
SELECT 'a_76488b_2780c_' FROM DUAL
UNION ALL
SELECT 'a_76488b_c2780' FROM DUAL
UNION ALL
SELECT 'a_76488b_c2780' FROM DUAL
UNION ALL
SELECT 'a_31487b_5542' FROM DUAL
UNION ALL
SELECT 'a_76488b_2780' FROM DUAL
SELECT replace(after_second_und
,replace(translate(after_second_und
,'0123456789'
,NULL
,NULL
) your_number
FROM (SELECT SUBSTR(str,instr(str,'_',1,2)+1) after_second_und
FROM t
YOUR_NUMBER
2780
2780
2780
2780
5542
2780 -
Fetch data using structure with full working example
does any body tell me how to fetch data using structure with full working example
the structure name is RSTXT and the field is TXLINE
the data in the form of text is entered from the functional side using t-code ME52N
from there i have to fetch the data
in smartform or in reportusing this code to get text from ME52N this is a structure still not getting output
DATA:BEGIN OF TA_ROW occurs 0,
TXZ01(1000) TYPE C,
END OF TA_ROW.
DATA:BEGIN OF IT_ROW OCCURS 0,
TXZ01(1000) TYPE C,
END OF IT_ROW.
DATA: thread LIKE thead.
DATA: headerid TYPE char24.
DATA: it_text LIKE tline OCCURS 0 WITH HEADER LINE.
data:wa_banfn like eban-banfn.
thread-tdid = 'B01'.
thread-tdname = headerid.
thread-tdobject = 'EBAN'.
select txz01 from eban into corresponding fields of table ta_row
where banfn = wa_banfn.
headerid = ' '.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = thread-tdid
language = sy-langu
name = thread-tdname
object = thread-tdobject
ARCHIVE_HANDLE
= 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
lines = it_text
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
LOOP AT it_text.
CLEAR ta_row.
BREAK-POINT.
FROM THIS POINT TEXT IS COMING
ta_row-txz01 = it_text-tdline.
APPEND ta_row TO it_row.
ENDLOOP. -
SQL Server 2005 64BIT Linked Server Cannot fetch a row using a bookmark
We get the following error SOMETIMES when trying to delete a row from an Oracle 10g database table via the SQL 2005 64BIT linked server.
DELETE [edwdev]..SYSTEM.SAIC_ARTIFACT_LOG FROM tblArtifactLog src WHERE src.source_seq_no = SAIC_ARTIFACT_LOG.art_seq_no and src.source_name = 'edwdev' [SQLSTATE 01000] (Message 0) Cannot fetch a row using a bookmark from OLE DB provider "OraOLEDB.Oracle" for linked server "edwdev". [SQLSTATE 42000] (Error 7333). The step failed.
They keyword here is SOMETIMES. The job would fail 100% of the time before applying ODAC 10.2.0.3.0, after the ODAC install the job fails about 40% of the time. We have this setup in a test enviornment and yes there are rows of data in the table everytime the job runs.
As far as the OraOLEDB10.dll install we have a date of 2/20/07 but a version of 10.2.0.2. I am wondering if this shouldn't be a new version.LearnMoreAgile wrote:
so does that mean no one at oracle can guide me in this issue before i goto microsoft ?How has the Linked Server been created in MSSQL? OraOLEDb.Oracle is the class name for the Oracle OLEDB provider which should appear in your list of OLEDB providers in your favourite windows dev tool or when creating the linked server. If it doesn't appear likely you didn't choose to install it. I don't know if it's a default install with the 64bit client, but the ODAC client contains the .net provider and not the OLEDB provider.
Niall -
How to color a row using REUSE_ALV_HIERSEQ_LIST_DISPLAY
Hi,
I'm able to color a row using REUSE_ALV_GRID_DISPLAY, I tried the same way to color a row at the item level using 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' but I'm not able to get the row color, please let me know how to acheive this.
Thanks in Advnce
Narayanyou need to do 4 things.
1. Add a field in your final internal table which ur going to display.
2.Name the field as----
> color_line(4) TYPE c,
begin of itab,
matnr type mara-matnr,
ernam type mara-ernam,
color_line(4) TYPE c,
end of itab.
3.declare layout ....................> data : it_layout TYPE lvc_s_layo.
4. After filled your fieldcat and before display your ALV
loop at itab assigning to <itab>.
if <itab>-ernam eq 'XYZ'.
<itab>-color_line = 'C600'.
end loop.
it_layout-info_fname = 'COLOR_LINE'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
IS_LAYOUT = it_layout
IT_FIELDCAT = your_fieldcat
and pass ur ITAB. -
How to delete rows in the target table using interface
hi guys,
I have an Interface with source as src and target as tgt both has company_code column.In the Interface i need like if a record with company_code already exists we need to delete it and insert the new one from the src and if it is not availble we need to insert it.
plz tell me how to achieve this?
Regards,
sai.gatha wrote:
For this do we need to apply CDC?
I am not clear on how to delete rows under target, Can you please share the steps to be followed.If you are able to track the deletes in your source data then you dont need CDC. If however you cant - then it might be an option.
I'll give you an example from what im working on currently.
We have an ODS, some 400+ tables. Some are needed 'Real-Time' so we are using CDC. Some are OK to be batch loaded overnight.
CDC captures the Deletes no problem so the standard knowledge modules with a little tweaking for performance are doing the job fine, it handles deletes.
The overnight batch process however cannot track a delete as its phyiscally gone by the time we run the scenarios, so we load all the insert/updates using a last modified date before we pull all the PK's from the source and delete them using a NOT EXISTS looking back at the collection (staging) table. We had to write our own KM for that.
All im saying to the OP is that whilst you have Insert / Update flags to set on the target datastore to influence the API code, there is nothing stopping you extending this logic with the UD flags if you wish and writing your own routines with what to do with the deletes - It all depends on how efficient you can identify rows that have been deleted. -
How to fetch content from UCM in WLP using VCR
Hi,
I configured the connection between weblogic portal v10.3.2 and UCM 11g using VCR adapter guide. But i am struck in how to fetch the content from UCM/VCR and display it in Weblogic portal.
Please guide me on how to fetch the content from UCM/VCR and display it in Weblogic Portlet ( JSF Portlet). is there any api is available to get the content from ucm and display it in portlet.
Appreciate your support here.
Thanks a lot,
SureshSuresh,
Please check the name of the VCR configured in the UCm.
You can use a batch file to load the VCR on to your Weblogic server. Using the name you can retrieve the contents from UCM.
Please let us know other configuration details to help you further -
Hi every one
Can any one help me out, How to Update a Row using ADF.
Thanks in advanceIn addition to Clear to my question
By Using ADF BC How can I update a record in a database.
I have VO and EO associated with a table.
How can I update a record using ADF BC
Message was edited by:
user616296
Maybe you are looking for
-
How to get CRM service order data in R/3
Hi, I want to retrieve service order data from CRM system to R/3, is there any FM for this. Please help as i am new to CRM Thanks Bobby
-
Mail.app crashes on opening - no plist file to delete
This started happening a couple of days ago. Every time I open the mail app, it freezes (spinning beachball) and then crashes. Attached below is the most recent crash report. I apparently don't have the plist file that everyone says to delete. So wha
-
Apple took money out of my account. I canceled my charge card and will not give them another one. Is there anything else I can do? I will cancel my account before I worry with my bank acount all the time. Now I can't even sign in for free apps
-
Error calling DLL in LabVIEW, but works in VC
I compiled a DLL from Matlab, and then compiled a wrapper DLL in VC++. I tested the wrapper DLL in VC++, and it works fine, generating the correct output as in Matlab. But when I call the wrapper DLL in LabVIEW, the first thing I noticed was that it
-
My ipod won't turn on! It told me to come to this website. What does that mean?
I tried to turn on my ipod. It's an 80GB and I think it's a 3rd generation. It told me to go to www.apple.com/support/ipod Please help! My ipod is precious to me and has so much music on it that is not on my itunes yet.