Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 436
  • Last Modified:

PROC email contents

DECLARE
c_rc  constant integer :=0;
c_reason constant varchar2(10) := 'success';
o_rc         NUMBER := c_rc;
o_reason      VARCHAR2(200) := c_reason;

BEGIN
o_email_subject          VARCHAR2(100) := 'Your Approved Non-Standard Deal will expire in 5 days';
o_email_text               CLOB := 'BOOST IS THE SECRET OF MY ENERGY';

DBMS_OUTPUT.enable(1000000);
CQ_PDR_SEND_EMAIL_NOTIFY_PKG.get_email_contents(o_rc, o_reason, NULL, NULL, 'DEAL_EXPIRE_5_DAYS', 'sthota', 1, 'en-US',
                                                                    'sthota@cisco.com',
                                                                     'kpasam@cisco.com',
                                                                     'sthota@cisco.com',
                                                                      o_email_subject,
                                                                      NULL,
                                                                       o_email_text,
                                                                        NULL,
                                                                        NULL,  
                                                                        NULL,
                                                                         NULL);
DBMS_OUTPUT.PUT_LINE(o_email_from ||'  '||o_email_to||' '||o_email_cc||' '||o_email_text);

END;
/

im getting error

Execution (27: 26): ORA-06550: line 8, column 26:
PLS-00103: Encountered the symbol "VARCHAR2" when expecting one of the following:

   := . ( @ % ;
The symbol ":=" was substituted for "VARCHAR2" to continue.
ORA-06550: line 8, column 40:
PLS-00103: Encountered the symbol "=" when expecting one of the following:

   . ( * % & = - + ; < / > at in is mod remainder not rem
   <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
   LIKE4_ LIKEC_ between || multiset me
0
thota198
Asked:
thota198
  • 4
  • 2
1 Solution
 
theKashyapCommented:
Move variable declarations into the DECLARE section:

DECLARE
c_rc  constant integer :=0;
c_reason constant varchar2(10) := 'success';
o_rc         NUMBER := c_rc;
o_reason      VARCHAR2(200) := c_reason;
o_email_subject          VARCHAR2(100) := 'Your Approved Non-Standard Deal will expire in 5 days';
o_email_text               CLOB := 'BOOST IS THE SECRET OF MY ENERGY';

BEGIN
-- Shouldn't declare here..
-- o_email_subject          VARCHAR2(100) := 'Your Approved Non-Standard Deal will expire in 5 days';
-- o_email_text               CLOB := 'BOOST IS THE SECRET OF MY ENERGY';

DBMS_OUTPUT.enable(1000000);
CQ_PDR_SEND_EMAIL_NOTIFY_PKG.get_email_contents(o_rc, o_reason, NULL, NULL, 'DEAL_EXPIRE_5_DAYS', 'sthota', 1, 'en-US',
                                                                    'sthota@cisco.com',
                                                                     'kpasam@cisco.com',
                                                                     'sthota@cisco.com',
                                                                      o_email_subject,
                                                                      NULL,
                                                                       o_email_text,
                                                                        NULL,
                                                                        NULL,  
                                                                        NULL,
                                                                         NULL);
DBMS_OUTPUT.PUT_LINE(o_email_from ||'  '||o_email_to||' '||o_email_cc||' '||o_email_text);

END;
/

Open in new window

0
 
thota198Author Commented:
DECLARE
c_rc  constant integer :=0;
c_reason constant varchar2(10) := 'success';
o_rc         NUMBER := c_rc;
o_reason      VARCHAR2(200) := c_reason;
o_email_from VARCHAR2(100) := 'sthota@cisco.com';
o_email_to VARCHAR2(200) := 'kpasam@cisco.com';
o_email_cc VARCHAR2(400) := 'sthota@cisco.com';
o_email_subject          VARCHAR2(100) := 'Your Approved Non-Standard Deal will expire in 5 days';
o_email_text               CLOB := 'BOOST IS THE SECRET OF MY ENERGY';
o_file_name  VARCHAR2(100) :='TIMESNOW';
o_file_data    BLOB :=<4000>;
BEGIN

DBMS_OUTPUT.enable(1000000);
CQ_PDR_SEND_EMAIL_NOTIFY_PKG.get_email_contents(o_rc, o_reason, NULL, NULL, 'DEAL_EXPIRE_5_DAYS', 'sthota', 1, 'en-US',
                                                                     o_email_from,
                                                                     o_email_to,
                                                                      o_email_cc,
                                                                      o_email_subject,
                                                                       NULL,
                                                                       o_email_text,
                                                                        NULL,
                                                                        o_file_name,  
                                                                        o_file_data,
                                                                        NULL);
DBMS_OUTPUT.PUT_LINE(o_email_from ||'  '||o_email_to||' '||o_email_cc||' '||o_email_text);

END;
/
  after changing i get this error

Execution (31: 23): ORA-06550: line 12, column 23:
PLS-00103: Encountered the symbol "<" when expecting one of the following:

   ( - + case mod new not null <an identifier>
   <a double-quoted delimited-identifier> <a bind variable> avg
   count current exists max min prior sql stddev sum variance
   execute forall merge time timestamp interval date
   <a string literal with character set specification>
   <a number> <a single-quoted SQL string> pipe
   <an alternatively-quoted string literal with character set specification>
   <an alternatively-quoted S

0
 
theKashyapCommented:
Initializing a blob is a bit tricky.. What exactly are you trying to store in that column? If it's a number just name the column type NUMBER instead of BLOB. If it's really a blob then the initialization would depend on what exactly are you trying to store there.
Just to make this compile clean you can init the variable to an empty blob.
o_file_data    BLOB := EMPTY_BLOB();

Open in new window

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
thota198Author Commented:
DECLARE
c_rc  constant integer :=0;
c_reason constant varchar2(10) := 'success';
o_rc         NUMBER := c_rc;
o_reason      VARCHAR2(200) := c_reason;
o_email_from VARCHAR2(100) := 'sthota@cisco.com';
o_email_to VARCHAR2(200) := 'kpasam@cisco.com';
o_email_cc VARCHAR2(400) := 'sthota@cisco.com';
o_email_reply_to VARCHAR2(40) :='sthota@cisco.com';
o_email_subject          VARCHAR2(100) := 'Your Approved Non-Standard Deal will expire in 5 days';
o_email_text               CLOB := 'BOOST IS THE SECRET OF MY ENERGY';
o_file_name  VARCHAR2(100) :='TIMESNOW';
o_file_data    BLOB := EMPTY_BLOB();
BEGIN

DBMS_OUTPUT.enable(1000000);
CQ_PDR_SEND_EMAIL_NOTIFY_PKG.get_email_contents(o_rc, o_reason, NULL, NULL, 'DEAL_EXPIRE_5_DAYS', 'sthota', 1, 'en-US',
                                                                     o_email_from,
                                                                     o_email_to,
                                                                      o_email_cc,
                                                                      o_email_subject,
                                                                       o_email_reply_to,
                                                                       o_email_text,
                                                                        NULL,
                                                                        o_file_name,  
                                                                        o_file_data,
                                                                        NULL);
DBMS_OUTPUT.PUT_LINE(o_email_from ||'  '||o_email_to||' '||o_email_cc||' '||o_email_text);

END;
/

after i generated the above procedure the procedure ran successfully but the output was not generated
0
 
theKashyapCommented:
after i generated the above procedure the procedure ran successfully but the output was not generated

Of course. As I said this is only to make the code compile cleanly. To actually put the correct data, you must initialize the variable correctly. What do you want to put in the blob? What're you trying to achieve?
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now