Sending a parameter to a Oracle view
I want to create a oracle view with a variable and i want to change the value of variable according to my needs.
Can i Do This.
Query of view is a complex one assume as like this
SELECT ........ FROM
( SELECT ........ FROM .............
WHERE tempDate=TO_DATE('2007/2/23', 'YYYY/MM/DD')
WHERE ...............................Date should be a variable.
Variable should in a sub query.
Pls Help as soon as possible
Try using a PreparedStatement and insert a parameter placeholder ("?") instead of "TO_DATE('2007/2/23', 'YYYY/MM/DD')".
Pls Help as soon as possibleUsually I don't, good you told me ...
Similar Messages
-
Question on using a Parameter against an Oracle date field
Post Author: klkemp100
CA Forum: Data Connectivity and SQL
newbie here just getting started in Crystal Reports v11.0
writing a report to go against an oracle view. i need the report to use a parameter that the user enters to select a specific date.
i went through the database expert and keyed in my own sql since i first tested this via TOAD and know that the sql works fine with a hard-coded date etc.
next i created a parameter and set it first up as a DATE but got the message that FAILED TO RETRIEVE DATA FROM THE DATABASE, even though I know that there is data to retrieve and i have previously retrieved it when the selection date is hard-coded in the query.
i then changed the field type in the view to be a VARCHAR2 and changed the parameter to be a STRING, but am still getting the same thing.
is there something special about using dates and parameters within crystal against oracle?
thanks in advance for your help.Post Author: amr_foci
CA Forum: Data Connectivity and SQL
you also may check the date format , oracle maybe excpecting you to send the parameter in some format and you are sending it into another format
if both are type dates in report and database you can use this
where to_date(to_char(mytable.my_date_field,'dd/mm/yyyy'),'dd/mm/yyyy') = to_date(to_char(,'your_format'),'dd/mm/yyyy')
you may use this in a free hand SQL
good luck -
How to create view object for a predefined Oracle view
Trying to create an entity object with no success,,,
I have an Oracle view(complex query in PL/SQL) that I need to encapsulate as a View Object then represent a column from this view as a '' | | linkcolumn | | ''
then get a reference of the requestParameter "p" in this case that I need to use as whereclause parameter on another view object that is part of the ListPage.jsp.
The application is basically a page of organization links that when click filters their reports as a list,
In Jdeveloper's context webBean(RowSetBrowser list [org links] to RowSetBrowser [org report list])
Can I implement this functionallity using the wizards or possibly writing custom code using the standard webBeans.Jerry,
First, you can create an entity object based on an Oracle view. If you check the "Views" checkbox in the EO wizard, you'll see a list of database views. Then you can create a view object based on your entity object, and use it like any other view object.
As for getting the page into the format you want, I suggest you start by generating your page using the BC4J JSP wizard, then customize the generated JSP.
Thanks
Blaise -
How to send/keep parameter
Hi,
I have a classic report and I linked col1 by another page page3. I have here an text_item that show me this parameter. I try to send this parameter to a procedure and it is not working. How can I keep this parameter in a variable?
Thank youCoco,
in an APEX PL/SQL Process, you can reference Page Items by using the colon-Notation:
BEGIN
MyProcedure (
p_param1 => :P2_ITEM1,
p_param2 => :P2_ITEM38 );
END;brgds,
Peter
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
BuilderPlugin: http://builderplugin.oracleapex.info
Work: http://www.click-click.at -
Sending Unicode HTML email from Oracle
Dear All,
How we can send the HTML email from Oracle in Unicode format (I am using Arabic Language, to be specific). So far I have tried the following solutions (using utl_smpt) without any success (either i see junk characters in the email or see question marks). Would you please help me in solving this?
Options Tried*
Option 1
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE p_send_mail_test (
2 sender IN VARCHAR2,
3 recipient IN VARCHAR2,
4 subj IN VARCHAR2,
5 message IN VARCHAR2)
6 IS
7 mailhost VARCHAR2(30) := '<smtp Server>';
8 c utl_smtp.connection;
9 PROCEDURE send_header( name IN VARCHAR2, header IN VARCHAR2) AS
10 BEGIN
11 utl_smtp.write_data(c, name || ': ' || header || utl_tcp.CRLF);
12 END;
13 BEGIN
14 c := utl_smtp.open_connection(mailhost,25);
15 utl_smtp.helo(c, mailhost);
16 utl_smtp.mail(c, sender);
17 utl_smtp.rcpt(c, recipient);
18 utl_smtp.open_data(c);
19 send_header('From', sender);
20 send_header('To', recipient);
21 -- If you need to send mail to more than one receipient, uncomment the
22 -- following line(s) as appropriate. Please don't forget the ","
23 -- in the "To" line before the next receipient's email id. You can't
24 -- use a comma separated list in the receipient parameter.
25 -- For variable number of "To"'s and "Cc"'s have multiple calls to
26 -- "send_header" function inside a cursor for loop.
27 -- Similar comments apply for "Cc" too.
28 -- send_header('To', ',<email@domain>');
29 send_header('Cc', ',<email@domain>');
30 send_header('Subject', subj);
31 utl_smtp.write_data(c, utl_tcp.CRLF || message);
32 utl_smtp.close_data(c);
33 utl_smtp.quit(c);
34 EXCEPTION
35 WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
36 utl_smtp.quit(c);
37 raise_application_error(-20000,
38 'Failed to send mail due to the following error: ' || sqlerrm);
39* END;
SQL>
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 p_send_mail_test('<email@domain>','<email@domain>','Hello',email_text);
8* end;
SQL> /
PL/SQL procedure successfully completed.
Result_
<div align="right"><font size="4"><b>????? Riaz ???????</b>
???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
.???? ???? ????? ???????? </font></div>
[Question marks along with all tags; this OTN page is converting that to HTML output]
Option2
SQL> ed
Wrote file afiedt.buf
1 create or replace procedure html_email(
2 p_to in varchar2,
3 p_from in varchar2,
4 p_subject in varchar2,
5 p_text in varchar2 default null,
6 p_html in varchar2 default null
7 )
8 is
9 l_boundary varchar2(255) default 'a1b2c3d4e3f2g1';
10 l_connection utl_smtp.connection;
11 l_body_html clob := empty_clob; --This LOB will be the email message
12 l_offset number;
13 l_ammount number;
14 l_temp varchar2(32767) default null;
15 l_smtp_hostname varchar2(50) := '<smtp Server>';
16 begin
17 l_connection := utl_smtp.open_connection( l_smtp_hostname, 25);
18 utl_smtp.helo( l_connection, l_smtp_hostname );
19 utl_smtp.mail( l_connection, p_from );
20 utl_smtp.rcpt( l_connection, p_to );
21 l_temp := l_temp || 'MIME-Version: 1.0' || chr(13) || chr(10);
22 l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);
23 l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);
24 l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
25 l_temp := l_temp || 'Reply-To: ' || p_from || chr(13) || chr(10);
26 l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
27 chr(34) || l_boundary || chr(34) || chr(13) ||
28 chr(10);
29 ----------------------------------------------------
30 -- Write the headers
31 dbms_lob.createtemporary( l_body_html, false, 10 );
32 dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
33 ----------------------------------------------------
34 -- Write the text boundary
35 l_offset := dbms_lob.getlength(l_body_html) + 1;
36 l_temp := '--' || l_boundary || chr(13)||chr(10);
37 l_temp := l_temp || 'content-type: text/plain;charset=utf-8' ||
38 chr(13) || chr(10) || chr(13) || chr(10);
39 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
40 ----------------------------------------------------
41 -- Write the plain text portion of the email
42 l_offset := dbms_lob.getlength(l_body_html) + 1;
43 dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
44 ----------------------------------------------------
45 -- Write the HTML boundary
46 l_temp := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
47 chr(13) || chr(10);
48 l_temp := l_temp || 'content-type: text/html;charset=utf-8' ||
49 chr(13) || chr(10) || chr(13) || chr(10);
50 l_offset := dbms_lob.getlength(l_body_html) + 1;
51 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
52 ----------------------------------------------------
53 -- Write the HTML portion of the message
54 l_offset := dbms_lob.getlength(l_body_html) + 1;
55 dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
56 ----------------------------------------------------
57 -- Write the final html boundary
58 l_temp := chr(13) || chr(10) || '--' || l_boundary || '--' || chr(13);
59 l_offset := dbms_lob.getlength(l_body_html) + 1;
60 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
61 ----------------------------------------------------
62 -- Send the email in 1900 byte chunks to UTL_SMTP
63 l_offset := 1;
64 l_ammount := 1900;
65 utl_smtp.open_data(l_connection);
66 while l_offset < dbms_lob.getlength(l_body_html) loop
67 utl_smtp.write_data(l_connection,
68 dbms_lob.substr(l_body_html,l_ammount,l_offset));
69 l_offset := l_offset + l_ammount ;
70 l_ammount := least(1900,dbms_lob.getlength(l_body_html) - l_ammount);
71 end loop;
72 utl_smtp.close_data(l_connection);
73 utl_smtp.quit( l_connection );
74 dbms_lob.freetemporary(l_body_html);
75* end;
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 html_email(p_to=>'<email@domain>',p_from=>'<email@domain>',p_subject=>'Hello',p_text=>'Hi', p_html=>email_text);
8* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
????? Riaz ???????
???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
Option3
SQL> ed
Wrote file afiedt.buf
1 create or replace procedure p_html_email_riaz(
2 p_to in varchar2,
3 p_from in varchar2,
4 p_subject in varchar2,
5 p_text in varchar2 default null,
6 p_html in varchar2 default null
7 )
8 is
9 l_boundary varchar2(255) default 'a1b2c3d4e3f2g1';
10 l_connection utl_smtp.connection;
11 l_body_html clob := empty_clob; --This LOB will be the email message
12 l_offset number;
13 l_ammount number;
14 l_temp varchar2(32767) default null;
15 l_smtp_hostname varchar2(50) := '<smtp Server>';
16 begin
17 l_connection := utl_smtp.open_connection( l_smtp_hostname, 25);
18 utl_smtp.helo( l_connection, l_smtp_hostname );
19 utl_smtp.mail( l_connection, p_from );
20 utl_smtp.rcpt( l_connection, p_to );
21 l_temp := l_temp || 'MIME-Version: 1.0' || chr(13) || chr(10);
22 l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);
23 l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);
24 l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
25 l_temp := l_temp || 'Reply-To: ' || p_from || chr(13) || chr(10);
26 l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
27 chr(34) || l_boundary || chr(34) || chr(13) ||
28 chr(10);
29 ----------------------------------------------------
30 -- Write the headers
31 dbms_lob.createtemporary( l_body_html, false, 10 );
32 dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
33 ----------------------------------------------------
34 -- Write the text boundary
35 l_offset := dbms_lob.getlength(l_body_html) + 1;
36 l_temp := '--' || l_boundary || chr(13)||chr(10);
37 l_temp := l_temp || 'content-type: text/plain; charset=UTF-8' ||
38 chr(13) || chr(10) || chr(13) || chr(10);
39 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
40 ----------------------------------------------------
41 -- Write the plain text portion of the email
42 /**
43 l_offset := dbms_lob.getlength(l_body_html) + 1;
44 dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
45 **/
46 ----------------------------------------------------
47 -- Write the HTML boundary
48 l_temp := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
49 chr(13) || chr(10);
50 l_temp := l_temp || 'content-type: text/html;' ||
51 chr(13) || chr(10) || chr(13) || chr(10);
52 l_offset := dbms_lob.getlength(l_body_html) + 1;
53 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
54 ----------------------------------------------------
55 -- Write the HTML portion of the message
56 l_offset := dbms_lob.getlength(l_body_html) + 1;
57 dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
58 ----------------------------------------------------
59 -- Write the final html boundary
60 l_temp := chr(13) || chr(10) || '--' || l_boundary || '--' || chr(13);
61 l_offset := dbms_lob.getlength(l_body_html) + 1;
62 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
63 ----------------------------------------------------
64 -- Send the email in 1900 byte chunks to UTL_SMTP
65 l_offset := 1;
66 l_ammount := 1900;
67 utl_smtp.open_data(l_connection);
68 while l_offset < dbms_lob.getlength(l_body_html) loop
69 utl_smtp.write_raw_data(l_connection,
70 utl_raw.cast_to_raw(
71 dbms_lob.substr(l_body_html,l_ammount,l_offset ) ) );
72 l_offset := l_offset + l_ammount ;
73 l_ammount := least(1900,dbms_lob.getlength(l_body_html) - l_ammount);
74 end loop;
75 utl_smtp.close_data(l_connection);
76 utl_smtp.quit( l_connection );
77 dbms_lob.freetemporary(l_body_html);
78* end;
SQL>
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 p_html_email_riaz(p_to=>'<email@domain>',p_from=>'<email@domain>',p_subject=>'Hello',p_text=>'Hi', p_html=>email_text);
8* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
GaSmO Riaz GacMJQc
mQLl GaJ_Qc HGaZac Cd GaZ^O GaNGU H_c SmdJem HJGQmN 12-07-2011
. fZame mQL\l GaJ_\Qc HE]GOI EOGQI GacfGQO GaHTQmI ]m MGa ZOc Q[HJ_c HJLOmO GaZ^O NaGa cOI C^UeG CSHfZmd cd Gamfc fPa_ aaCecmI Ga^Ufl
.fa_c LRma GaT_Q fGaJ^OmQ
*Option4*
[code]
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE send_email_html_test(
2 pi_from IN Varchar,
3 pi_to IN VARCHAR,
4 pi_cc IN Varchar,
5 pi_subj IN VARCHAR,
6 pi_msg CLOB
7 )
8 IS
9 conn utl_smtp.connection;
10 lv_mailhost varchar2(1000);
11 lv_port number;
12 BEGIN
13 lv_mailhost := '<smtp Server>';
14 lv_port := 25;
15 conn := utl_smtp.open_connection(lv_mailhost, lv_port);
16 utl_smtp.helo(conn, lv_mailhost);
17 utl_smtp.mail(conn, pi_from);
18 utl_smtp.rcpt(conn, pi_to);
19 IF pi_cc is not null THEN
20 utl_smtp.rcpt(conn, pi_cc);
21 END IF;
22 utl_smtp.open_data(conn);
23 utl_smtp.write_data(conn, 'MIME-version: 1.0' || utl_tcp.CRLF);
24 utl_smtp.write_data(conn, 'Content-Type: text/html; charset=iso-8859-6' ||
25 utl_tcp.CRLF);
26 utl_smtp.write_data(conn, 'Content-Transfer-Encoding: 8bit' ||
27 utl_tcp.CRLF);
28 utl_smtp.write_data(conn, 'From:' ||pi_from || utl_tcp.CRLF);
29 utl_smtp.write_data(conn, 'To:' ||pi_to || utl_tcp.CRLF);
30 utl_smtp.write_data(conn, 'Cc:' ||pi_cc || utl_tcp.CRLF);
31 utl_smtp.write_data(conn, 'Reply-To:' ||pi_from || utl_tcp.CRLF);
32 utl_smtp.write_data(conn, 'Subject:' ||pi_subj|| utl_tcp.CRLF);
33 utl_smtp.write_data(conn, utl_tcp.crlf);
34 utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(pi_msg));
35 utl_smtp.close_data(conn);
36 utl_smtp.quit(conn);
37 EXCEPTION WHEN others THEN
38 dbms_output.put_line(sqlerrm);
39* END;
40 /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='
<div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b>
يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'
. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى
.ولكم جزيل الشكر والتقدير </font></div>';
7 send_email_html_test('<email@domain>',
8 '<email@domain>',
9 '<email@domain>',
10 'Hello',email_text);
11* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
Riaz افكحترك
ٍرجٌ افترك بافغفك أل افغد افخاص بك سٍلتمٍ بتارٍخ 12-07-2011
. نغفٍم ٍرجٌ افترك بإادة إدارة افكنارد افبشرٍة ٍ حاف غدك ربتك بتجدٍد افغد خفاف كدة أصما أسبنغٍل كل افٍنك نذف ففأمكٍة افصنٌ
.نفك جزٍف افشر نافتدٍر
Option5
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE send_mail_test1 (p_to IN VARCHAR2,
2 p_from IN VARCHAR2,
3 p_subject IN VARCHAR2,
4 p_text_msg IN VARCHAR2 DEFAULT NULL,
5 p_html_msg IN VARCHAR2 DEFAULT NULL,
6 p_smtp_host IN VARCHAR2,
7 p_smtp_port IN NUMBER DEFAULT 25)
8 AS
9 l_mail_conn UTL_SMTP.connection;
10 l_boundary VARCHAR2(50) := '----=*#abc1234321cba#*=';
11 BEGIN
12 l_mail_conn := UTL_SMTP.open_connection(p_smtp_host, p_smtp_port);
13 UTL_SMTP.helo(l_mail_conn, p_smtp_host);
14 UTL_SMTP.mail(l_mail_conn, p_from);
15 UTL_SMTP.rcpt(l_mail_conn, p_to);
16 UTL_SMTP.open_data(l_mail_conn);
17 UTL_SMTP.write_data(l_mail_conn, 'Date: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') || UTL_TCP.crlf);
18 UTL_SMTP.write_data(l_mail_conn, 'To: ' || p_to || UTL_TCP.crlf);
19 UTL_SMTP.write_data(l_mail_conn, 'From: ' || p_from || UTL_TCP.crlf);
20 UTL_SMTP.write_data(l_mail_conn, 'Subject: ' || p_subject || UTL_TCP.crlf);
21 UTL_SMTP.write_data(l_mail_conn, 'Reply-To: ' || p_from || UTL_TCP.crlf);
22 UTL_SMTP.write_data(l_mail_conn, 'MIME-Version: 1.0' || UTL_TCP.crlf);
23 UTL_SMTP.write_data(l_mail_conn, 'Content-Type: multipart/alternative; boundary="' || l_boundary || '"' || UTL_TCP.crlf || UTL_TCP.crlf);
24 IF p_text_msg IS NOT NULL THEN
25 UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || UTL_TCP.crlf);
26 UTL_SMTP.write_data(l_mail_conn, 'Content-Type: text/plain; charset="utf-8"' || UTL_TCP.crlf || UTL_TCP.crlf);
27 UTL_SMTP.write_data(l_mail_conn, p_text_msg);
28 UTL_SMTP.write_data(l_mail_conn, UTL_TCP.crlf || UTL_TCP.crlf);
29 END IF;
30 IF p_html_msg IS NOT NULL THEN
31 UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || UTL_TCP.crlf);
32 UTL_SMTP.write_data(l_mail_conn, 'Content-Type: text/html; charset="utf-8"' || UTL_TCP.crlf || UTL_TCP.crlf);
33 UTL_SMTP.write_data(l_mail_conn, p_html_msg);
34 UTL_SMTP.write_data(l_mail_conn, UTL_TCP.crlf || UTL_TCP.crlf);
35 END IF;
36 UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || '--' || UTL_TCP.crlf);
37 UTL_SMTP.close_data(l_mail_conn);
38 UTL_SMTP.quit(l_mail_conn);
39* END;
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 send_mail_test1('<email@domain>',
8 '<email@domain>',
9 'Hello',
10 'msg',
11 email_text,
12 '<smtp Server>',
13 25);
14* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
????? Riaz ???????
???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
.???? ???? ????? ????????I worked with Oracle support and was able to find solution. The helping document ids were: 752309.1 & 404389.1
-
Find out the name of parameter file while oracle is running
can any one please tell me how can i find the name of oracle parameter file while oracle is running, i mean is there any parameter that specifies this thing, or is there any data dictionary view
second thing i want to change the default database i mean istead of starting the default database at startup the oracle should start the database that i specify,
i would be greatfull if any one could answer my questionsOk, so you're running with SPFILE in default location. The file you speak about is used during the database create phase.
Just having a look at the file:
c:\oracle\admin\orcl\pfile\init.ora.1142006183316I can say that:
. The SID is ORCL
. You used DBCA to create the database
. DBCA started creating the database: Saturday 11 of February 2006 at 18:33
This file is used by the DBCA because when you create a database, you must have a parameter file in order to start the instance. This file is easily created as a text file (PFILE) first, then the instance is started. Once the database creation is over, the SPFILE is created from this PFILE. If you check the database create logs (in the %ORACLE_BASE%\admin\ORCL\* directory) you'll see a "CREATE SPFILE FROM PFILE" is ran after the database creation, or before, it depends, and the instance restarted in order for it to use the newly created SPFILE. After that, this file is useless.
HTH,
Yoann. -
ORA-02070: Error when updating a SQL Server table thru an Oracle View
I have a SQL Server table TIMESHEET which contains a number of VARCHAR and NUMERIC columns plus a DATETIME column.
Only the DATETIME column is giving me trouble.
On the ORACLE side I have a view which selects from the SQL Server table but in order to get the SELECT to work, I had to either put a CAST or TO_DATE function call around the DATETIME field
Below is the relevant part of the 2 view definitions I have tried
create view TIMESHEET as
SELECT
"TsKeySeq" as TS_KEY_SEQ,
"EmployeeNo" as EMPLOYEE_NO,
CAST("PeriodEnding" AS DATE) as PERIOD_ENDING,
. . . (more columns - not relevant)
FROM [email protected];
An update to the view generates this message
ORA-02070: database OLEMSQLPSANTDAS6 does not support CAST in this context
create view TIMESHEET as
SELECT
"TsKeySeq" as TS_KEY_SEQ,
"EmployeeNo" as EMPLOYEE_NO,
TO_DATE("PeriodEnding") as PERIOD_ENDING,
. . . (more columns - not relevant)
FROM [email protected];
An update to the view generates this message
ORA-02070: database OLEMSQLPSANTDAS6 does not support TO_DATE in this context
If I don't include either the TO_DATE() or CAST() then I get
Select Error: ORA-28527: Heterogeneous Services datatype mapping error
ORA-02063:preceding line from OLEMSQLSANTDAS6
Does anyone have any idea how to update a SQL Server DATETIME column thru an ORACLE view?You can't cast accross heterogenious databases and there is no need to. HSODBC treats SQL Server DATETIME column as DATE. For example, I have SQL Server table:
CREATE TABLE [Ops].[T_JobType](
[JobType] [varchar](50) NOT NULL,
[JobDesc] [varchar](200) NULL,
[InsertDt] [datetime] NOT NULL CONSTRAINT [InsertDt_00000006] DEFAULT (getdate()),
[InsertBy] [varchar](128) NOT NULL CONSTRAINT [InsertBy_00000006] DEFAULT (user_name()),
[LastUpdated] [datetime] NOT NULL CONSTRAINT [LastUpdated_00000006] DEFAULT (getdate()),
[LastUpdatedBy] [varchar](128) NOT NULL CONSTRAINT [LastUpdatedBy_00000006] DEFAULT (user_name()),
CONSTRAINT [T_JobType_PK] PRIMARY KEY CLUSTERED
[JobType] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [DATA01FG]
) ON [DATA01FG]Now on Oracle side I do:
SQL> desc "Ops"."T_JobType"@pbods
Name Null? Type
JobType NOT NULL VARCHAR2(50)
JobDesc VARCHAR2(200)
InsertDt NOT NULL DATE
InsertBy NOT NULL VARCHAR2(128)
LastUpdated NOT NULL DATE
LastUpdatedBy NOT NULL VARCHAR2(128)
SQL> select "InsertDt" from "Ops"."T_JobType"@pbods;
InsertDt
18-AUG-08
09-OCT-08
22-OCT-09
18-AUG-08
19-NOV-08
SQL> SY. -
Hi Experts ,
We have Oracle View . There is no primary key is defined in this view. I need to join this view with some table in OBIEE physical layer.
1. I have created one opaque view with query
SELECT 'YES' PRESERVE FROM DUAL (Dummy table)
and make the join ..and report is also working fine...
So is this correct method.
2. Can we define Key at OBIEE level.(Make an alias and do self join)
If we define key at obiee level the key should be uniqe and for that we need to make all the view column as key.
please suggest..which method is good.
Thanks.
Sso can i create my key on any column and do the self join by creating alias...
I just want to give a join to my view so that obiee will not give any warning...
report is coming from view only...no fact and dimension here...view is on OLTP system -
How to pass in a parameter into a report viewer on a jsp - and hidden
Hi, I've built a php application and am using the java environment to enable the crystal report/viewer. The developer was looking how to pass in a parameter into a report viewer on a jsp. Ultimately the end product we need is to get an HTML report viewer loading a report file with hidden parameters so to not expose other customer data (it's a shared database for multiple customers) preferably loaded from php using maybe the php java bridge. Would anyone happen to have any sample code or any guidance?
<%@ page contentType="text/html; charset=UTF-8"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer"%>
<%
// just a test to grab rpt name from GET
String rptFile = "report_files/" + request.getParameter("rpt");
%>
<crviewer:viewer reportSourceType="reportingComponent" viewerName=""
isOwnPage="true">
<crviewer:report reportName="<%= rptFile %>" />
</crviewer:viewer>
Many thanks in advance!
MarkI am not aware of any html tags you can pass to the viewer for parameter values. Normally, you would load the report in code and then use the SDK with the report object to pass parameter values.
-
Parameter Form in Oracle Report!!
Dear Oracle Users' Group:
I have problem with "Parameter Form" in Oracle Report.
The Report that I created has the SQL:
"SELECT A.FIELD1, A.FIELD2
FROM MYDATABASE.MYTABLE A
WHERE
A.FIELD1 = :P_1";
When the report is run, it asks for the parameter
and generates the report based on the runtime
parameter. Works perfect on Oracle8i database's
Report front end.
The PROPERTY PALETTE for the FIELD (Field that
takes the runtime parameter) is:
====================
General Information
Name: PF_P_1
Comments:
Parameter Form Field
Source: P_1
Parameter
Datatype: Character
Width: 40
Initial Value:
Validation Trigger:
List of Values:
(For the list of values, I have put the SQL:
"SELECT DISTINCT A.FIELD1 from
MYDATABASE.MYTABLE A", Also I had
tried with list of fixed values like A, B, C)
Web Setting
Additional Attributes (HTML):
================
But the report does NOT work when called from the Web.
(This is only because of the problem with this Parameter
Form in my report. If I get rid of the parameter form by
changing the last line of my SQL to: "A.FIELD1 = 'Chicago'",
it works fine from the Web).
When accessed the report from the Web, the error I get
is:
Oracle Reports Server CGI - Report Job has terminated with this error.
Reports Server Replies:
REP-0788: Warning: The value of restricted LOV parameter P_1 is not among the selectable values.
I do not know what is the error with this simplest Parameter Form based Report!!
In the Property Palette (above) of the Field, there was a field named "Additional Attributes (HTML)"
under "Web Setting" heading.
Do I need to write something there!!
Please help!!
thanks.
kimmyHi, Kimmy
Try: ¶mform=yes]http://webserver.com:80/dev60cgi/rwcgi60.exe?server=repserver&report=rep1&userid=scott/tiger@orcl&destype=cache&desformat=htmlcss¶mform=yes
I've also sent you an email about key maps.
Enjoy! Web Reporting is a great feature.
Pedro. -
Sending mails with attachments using oracle 8i
Hi,
Could anybody please send a sample code for sending mails
with attachments using oracle 8i.
Thanks in advanceFor oracle8i there is an example package from OTN:
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
You have to re-write the package a bit to work it with BLOBs instead of RAW attachments, but that should be no problem
Hop this helps,
Michiel -
Note 830576 - Parameter recommendations for Oracle 10g
hi all DBA experts.
I am not good familiar with Oracle database while i read a Note 830576 - Parameter recommendations for Oracle 10g. in which SAP General Recommendation:
You should delete obsolete initialization parameters from the profile.
To determine which obsolete parameters are currently set, proceed as follows:
SQL> SELECT NAME FROM V$OBSOLETE_PARAMETER WHERE ISSPECIFIED = 'TRUE';
when i execute above command then result is no rows selected
while there are many parameters in above SAP Note which are already obsolete and not set in initSID.ora file.
for exp. the parameter OPTIMIZER_INDEX_COST_ADJ is showing
#### OPTIMIZER MODE
#optimizer_index_cost_adj = 10
as you know that this parameter is very important regarding System Performance.
now please guide me . I have to set these parameter or no need while there is not showing any parameters against obsolete command.
waiting you valuable reply.
Regards,hi both,
thanks for knowledge sharing with me other SDN users,
Dear Orkun,
Ok. At this stage, I can recommend you that apply what they have suggested,
in the message. So, you already did a part of it by configuring
Oracle parameters, already.
SAP support sent me this file (PRD_Parameters)
*** INFORMATION 1 ***
*** INFORMATION 2 ***
*** INFORMATION 3 ***
*** INFORMATION 4 ***
*** INFORMATION 5 ***
*** INFORMATION 6 ***
*** INFORMATION 7 ***
*** INFORMATION 8 ***
*** INFORMATION 9 ***
*** INFORMATION 10 ***
*** INFORMATION 11 ***
_b_tree_bitmap_plans
_fix_control (4728348)
event (10753)
event (38087)
event (10183)
optimizer_index_cost_adj
star_transformation_enabled
event (10027)
event (10028)
event (10411)
event (10629)
event (14532)
_fix_control (5705630)
_fix_control (5765456)
_optimizer_mjc_enabled
_sort_elimination_cost_ratio
event (10091)
event (10142)
event (38068)
event (38085)
event (44951)
parallel_execution_message_size
parallel_threads_per_cpu
query_rewrite_enabled
log_archive_dest_1
log_archive_format
max_dump_file_size
optimizer_features_enable
log_archive_dest
_push_join_union_view
_cursor_features_enabled
_first_spare_parameter
event (10049)
db_writer_processes
parallel_max_servers
db_cache_size
pga_aggregate_target
processes
sessions
dml_locks
job_queue_processes
log_checkpoint_interval
remote_login_passwordfile
sga_max_size
shared_pool_reserved_size
sort_area_retained_size
sort_area_size
statistics_level
workarea_size_policy
they only highlighted these following parameters from above
**** INFORMATION 8 *** DB Patchset: 10.2.0.4.0
**** INFORMATION 9 *** DB Mergefix: 0 (released before 2008-07-11)
FYI... recently, i applied the Oracle Patches 10.2.0.4 in this sequence
MS Windows x86-64 (64-bit)
Patchset_10204_MSWIN-x86-64aa.bin
Patchset_10204_MSWIN-x86-64ab.bin
Patchset_10204_MSWIN-x86-64ac.bin
OPatch
OPatch_10205_Generic_v0.zip
Generic (32-bit / 64-bit)
p8350262_10204_Generic.zip
p7592030_10204_WIN_GENERIC.zip
p9254968_10204_WIN_GENERIC.zip
10204_Patch44_MSWIN-x86-64.zip
p9584028_102040_Generic.zip
p9843740_10204_Generic.zip
and please tell me , still i have to apply highlighted parameters or now no need.
Regards, -
Rebuilding of the InforSource of DBCONNECT to Oracle View
Hello,
following problem:
I use DB connect to an Oracle Database to an View
It works fine.
I change the View in the Oracle Database and recompile it.
I get an Error while loading with an InfoPackage.
I have to drop the regenerate the Datasource and
I must Drop ! the InfoSource and
rebuild it completly again to be able to load again !
This stemms due to the fact that BW seems to protocol the internal state of the Oracle View, like displayed in the Oracle Dictionnary views user_views, all_views
or dba_views.
This is an inacceptable BW system behaviour and impossible for day to day
business, development and much work, espescially if You develop a 12 or more
DBConnect View interfaces !
Does anybody out there know how to make BW a more pleasent thing , customize it better to avoid this burden ?
Thank You !
Martin Sautter, Munich / Essen> Hi,
>
> when changing the view in Oracle it isn't necessary
> to drop and recreate the ISource and DSource!!
>
> Proceed as follows:
> - change your view (of course you can't rename it!)
> - regenerate your datasource with tcode RSDBC
> - open your TRules and maintain your TStructure
> (change tab)
> - maintain your TRules
> - finally activate
>
> this is definitively enough.
>
> hope this helps...
>
> Olivier.
>
> Message was edited by:
> Olivier Cora
> Hi,
>
> when changing the view in Oracle it isn't necessary
> to drop and recreate the ISource and DSource!!
>
> Proceed as follows:
> - change your view (of course you can't rename it!)
> - regenerate your datasource with tcode RSDBC
> - open your TRules and maintain your TStructure
> (change tab)
> - maintain your TRules
> - finally activate
>
> this is definitively enough.
>
> hope this helps...
>
> Olivier.
>
> Message was edited by:
> Olivier Cora
> Hi,
>
> when changing the view in Oracle it isn't necessary
> to drop and recreate the ISource and DSource!!
>
> Proceed as follows:
> - change your view (of course you can't rename it!)
> - regenerate your datasource with tcode RSDBC
> - open your TRules and maintain your TStructure
> (change tab)
> - maintain your TRules
> - finally activate
>
> this is definitively enough.
>
> hope this helps...
>
> Olivier.
>
> Message was edited by:
> Olivier Cora
> Hi,
>
> when changing the view in Oracle it isn't necessary
> to drop and recreate the Source and DSource!!
>
> Proceed as follows:
> - change your view (of course you can't rename it!)
> - regenerate your datasource with tcode RSDBC
> - open your TRules and maintain your TStructure
> (change tab)
> - maintain your TRules
> - finally activate
>
> this is definitively enough.
>
> hope this helps...
>
> Olivier.
>
> Message was edited by:
> Olivier Cora
> Hi,
>
> when changing the view in Oracle it isn't necessary
> to drop and recreate the ISource and DSource!!
>
> Proceed as follows:
> - change your view (of course you can't rename it!)
> - regenerate your datasource with tcode RSDBC
> - open your TRules and maintain your TStructure
> (change tab)
> - maintain your TRules
> - finally activate
>
> this is definitively enough.
>
> hope this helps...
>
> Olivier.
>
> Message was edited by:
> Olivier Cora
Hello,
in all its ok, except You change the format ( number to char or char to number etc.) or the column name of DBConnect's View or Table.
In this case You have do delete the BW Datasource and rebuild it.
It is advisable to name the DBConnect View or Table exactly as
in BW. This makes setting up of the InfoSource very easy.
Thank You
Martin Sautter -
SAP Note 830576 - Parameter recommendations for Oracle 10g
As per SAP Note 830576 - Parameter recommendations for Oracle 10g, I have tried to change the value for
parameter "db_file_multiblock_read_count".
In sql prompt it shows:
SQL> show parameter DB_FILE_MULTIBLOCK_READ_COUNT
NAME TYPE VALUE
db_file_multiblock_read_count integer 128
and in brtools it shows:
58 - db_file_multiblock_read_count both no * yes 128
But I got the following error, when i tried to set it null
1 * Parameter description (desc) ..... [db block to be read each IO]
2 * Parameter type (type) ............ [integer]
3 * Current parameter value (parval) . [128]
4 * Value in spfile (spfval) ......... []
5 # New parameter value (value) ...... [null]
6 - Scope for new value (scope) ...... [both]
7 # Database instance (instance) ..... []
8 ~ Comment on update (comment) ...... []
9 - SQL command (command) ............ [alter system reset db_file_multiblock_read_count scope = spfile sid = '*'; alter system reset db_file_multiblock_read_count scope = memory sid = 'MBD']
BR0662I Enter your choice:
c
BR0280I BRSPACE time stamp: 2008-08-14 18.19.22
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0280I BRSPACE time stamp: 2008-08-14 18.19.23
BR0301E SQL error -32010 at location BrSqlExecute-1, SQL statement:
'/* BRSPACE / alter system reset db_file_multiblock_read_count scope = spfile sid = '''
ORA-32010: cannot find entry to delete in SPFILE
BR1017E Execution of SQL statement 'alter system reset db_file_multiblock_read_count scope = spfile sid = '*'; alter system reset db_file_multiblock_read_count scope = memory sid = 'MBD'' failed
BR0669I Cannot continue due to previous warnings or errors - you can go back to repeat the last action
BR0280I BRSPACE time stamp: 2008-08-14 18.19.23
BR0671I Enter 'b[ack]' to go back, 's[top]' to abort:
Kinldy let me know, what could me wrong.Hi Markus,
As per your suggestion we have downloaded the files from UCLIB_3-20000978.SAR. But now getting the error as
sapccmsr -DCCMS -j2ee pf=profile value
INFO: use SAPLOCALHOST hostname
INFO: CCMS agent sapccmsr working directory is /usr/sap/ccms/XX1_00/sapccmsr
INFO: CCMS agent sapccmsr config file is /usr/sap/ccms/XX1_00/sapccmsr/csmconf
INFO: Central Monitoring System is [XX1]. (found in config file)
INFO: additional Central Monitoring System is [AS2]. (found in config file)
ERROR: Cannot open Monitoring Segment 0 rtc = 245
Last reported error: [249] CCMS monitoring segment has wrong EYE CATCH. It seems to be created as non-unicode segment.
This program runs as unicode. Please use non-unicode version
Please suggest
Thanks,
Anu -
How to change timeout parameter value in Oracle 10g R2
Anyone knows how to change timeout parameter value in Oracle 10g Database R2?
Waheed Azhar wrote:
actually i am getting ORA-01013 exception which directly relates to the timeout value but i think it's hidden parameter...What makes you think it's a hidden parameter?
A search of MetaLink for that error turns up a number of hits, most of which a very situational specific. Exactly what are you doing when you get this error? Are you connecting over an ODBC connection? Are you getting it on a connection request? At db shutdown? During a long-running query?
Maybe you are looking for
-
Plug-Ins and Extractors - Related to Upgrade of Source system
Hi, We are upgrading from R3 to ECC. Can I say that, if the Plug-in in current R3 system and the new system(post upgrade)(ECC) are same then, the extractors will also remain same ? hence, nothing will be affected in BW ? For example, if the current s
-
MAC Authentication does not work
My MAC Authentication does not work. I have a ACS 3.0 server set. the MAC address is set in the user name field and in the password field. I can ping the ACS, I can ping my AP, I can ping my client. I don't want WEP and I don't want LEAP just MAC. So
-
I added a route in solaris by command--> route add 10.224.86.10 -netmask 255.255.255.224 10.224.8.10 it gave the prompt--add net 10.224.56.0: gateway 10.224.8.10 I checked the routing table by netstat -r 10.224.86.10 10.224.8.10 UG 1 0 which shows th
-
It is the latest version of iTunes btw.
-
Why is my Macbook Pro 2.33 so hot and why are my fans on so high?
So, I'm sitting here with just Safari 3.1.1 open with just this single page, nothing else running on my machine, 3GB of RAM, and activity monitor reports a total 3.5% CPU usage. Why is my Macbook Pro hot like it's really working (not something-is-bro