PLSQL


 
Thread Tools Search this Thread
Top Forums Programming PLSQL
# 1  
Old 05-17-2011
PLSQL

HI,

When am creating one package body,its throwing error,
Code which am using to create is:

Code:
CREATE OR REPLACE PACKAGE BODY "MAMPROD"."PKG_QS_ADMIN"                 AS
-- ============================================================================
PROCEDURE CREATE_PARAMETERS
IS
BEGIN
  -- must log on as owner, aka: MAM PROD_ OR MAMP ROD_PHOTO!!!!
  -- must edit using NOTEPAD !!!
  -- ---------------------------------------------------
  -- ---------------------------------------------------
  BEGIN
        ctx_ddl.drop_preference         ('QS_TEXT_STORAGE_'||UPPER(USER));
  EXCEPTION
        WHEN OTHERS THEN
                NULL;
  END;
  -- ---------------------------------------------------
  BEGIN
        ctx_ddl.create_preference       ('QS_TEXT_STORAGE_'||UPPER(USER), 'BASIC_STORAGE');
        ctx_ddl.set_attribute           ('QS_TEXT_STORAGE_'||UPPER(USER), 'I_TABLE_CLAUSE','tabl
espace '||UPPER(USER)||'_QS_INDEX_1 storage (initial 400M next 30m)');
        ctx_ddl.set_attribute           ('QS_TEXT_STORAGE_'||UPPER(USER), 'K_TABLE_CLAUSE','tabl
espace '||UPPER(USER)||'_QS_INDEX_1 storage (initial 20M  next 10m)');
        ctx_ddl.set_attribute           ('QS_TEXT_STORAGE_'||UPPER(USER), 'R_TABLE_CLAUSE','tabl
espace '||UPPER(USER)||'_QS_INDEX_1 storage (initial 20M  next 10m)');
        ctx_ddl.set_attribute           ('QS_TEXT_STORAGE_'||UPPER(USER), 'N_TABLE_CLAUSE','tabl
espace '||UPPER(USER)||'_QS_INDEX_1 storage (initial 1M   next 1m)');
        ctx_ddl.set_attribute           ('QS_TEXT_STORAGE_'||UPPER(USER), 'I_INDEX_CLAUSE','tabl
espace '||UPPER(USER)||'_QS_INDEX_1 storage (initial 10M  next 10m)');
  END;
  -- ---------------------------------------------------
  -- ---------------------------------------------------
  BEGIN
        ctx_ddl.drop_preference         ('QS_TEXT_DATASTORE_'||UPPER(USER));
  EXCEPTION
        WHEN OTHERS THEN
                NULL;
  END;
  -- ---------------------------------------------------
  BEGIN
        ctx_ddl.create_preference       ('QS_TEXT_DATASTORE_'||UPPER(USER), 'DETAIL_DATASTORE
');
        ctx_ddl.set_attribute           ('QS_TEXT_DATASTORE_'||UPPER(USER), 'binary'            , 'FALSE')
;
        ctx_ddl.set_attribute           ('QS_TEXT_DATASTORE_'||UPPER(USER), 'detail_table'      , UPP
ER(USER)||'.QS_TEXT_DTL');
        ctx_ddl.set_attribute           ('QS_TEXT_DATASTORE_'||UPPER(USER), 'detail_key'        , 'RECO
RD_ID');
        ctx_ddl.set_attribute           ('QS_TEXT_DATASTORE_'||UPPER(USER), 'detail_lineno'     , 'S
EQ_ID');
        ctx_ddl.set_attribute           ('QS_TEXT_DATASTORE_'||UPPER(USER), 'detail_text'       , 'TXT
');
  END;
  -- ---------------------------------------------------
  -- ---------------------------------------------------
  BEGIN
        ctx_ddl.drop_stoplist           ('QS_TEXT_STOPLIST_'||UPPER(USER));
  EXCEPTION
        WHEN OTHERS THEN
                NULL;
  END;
  -- ---------------------------------------------------
  BEGIN
        ctx_ddl.create_stoplist         ('QS_TEXT_STOPLIST_'||UPPER(USER), 'BASIC_STOPLIST');
  END;
  -- ---------------------------------------------------
  -- ---------------------------------------------------
  BEGIN
        ctx_ddl.drop_preference         ('QS_TEXT_WORDLIST_'||UPPER(USER));
  EXCEPTION
        WHEN OTHERS THEN
                NULL;
  END;
  -- ---------------------------------------------------
  BEGIN
        ctx_ddl.create_preference       ('QS_TEXT_WORDLIST_'||UPPER(USER) ,'BASIC_WORDLIST');
        ctx_ddl.set_attribute           ('QS_TEXT_WORDLIST_'||UPPER(USER), 'WILDCARD_MAXTERMS'
, 15000);
  END;
  -- ---------------------------------------------------
  -- ---------------------------------------------------
END;
-- ============================================================================
PROCEDURE CREATE_INDEX
IS
BEGIN
        -- ---------------------------------------------------
        BEGIN
                EXECUTE IMMEDIATE 'DROP INDEX '||UPPER(USER)||'.QS_TEXT_MST_IXCON' ;
        EXCEPTION
                WHEN OTHERS THEN
                        NULL;
        END;
        -- ---------------------------------------------------
        EXECUTE IMMEDIATE 'CREATE INDEX '||UPPER(USER)||'.QS_TEXT_MST_IXCON'
                ||' ON '||UPPER(USER)||'.QS_TEXT_mst (UPD_FLG)'
                ||' INDEXTYPE IS CTXSYS.CONTEXT'
                ||' PARAMETERS'
                ||' ('''
                ||' STORAGE     QS_TEXT_STORAGE_'       ||UPPER(USER)
                ||' MEMORY      50m'
                ||' DATASTORE   QS_TEXT_DATASTORE_'     ||UPPER(USER)
                ||' STOPLIST    QS_TEXT_STOPLIST_'      ||UPPER(USER)
                ||' WORDLIST    QS_TEXT_WORDLIST_'      ||UPPER(USER)
                ||''')';
        -- ---------------------------------------------------
END;
-- ============================================================================
PROCEDURE ALTER_INDEX_REBUILD
IS
BEGIN
        -- ---------------------------------------------------
        EXECUTE IMMEDIATE 'ALTER  INDEX '||UPPER(USER)||'.QS_TEXT_MST_IXCON REBUILD ONL
INE'
                ||' PARAMETERS'
                ||' ('''
                ||' REPLACE'
                ||' MEMORY      50m'
                ||''')';
        -- ---------------------------------------------------
        RETURN;
--      -- ---------------------------------------------------
--      EXECUTE IMMEDIATE 'ALTER  INDEX '||UPPER(USER)||'.QS_TEXT_MST_IXCON REBUILD O
NLINE'
--              ||' PARAMETERS'
--              ||' ('''
--              ||' REPLACE'
--              ||' STORAGE     QS_TEXT_STORAGE_'       ||UPPER(USER)
--              ||' MEMORY      50m'
--              ||' DATASTORE   QS_TEXT_DATASTORE_'     ||UPPER(USER)
--              ||' STOPLIST    QS_TEXT_STOPLIST_'      ||UPPER(USER)
--              ||' WORDLIST    QS_TEXT_WORDLIST_'      ||UPPER(USER)
--              ||''')';
--      -- ---------------------------------------------------
END;

And the ERROR is:-
Code:
Warning: Package Body created with compilation errors.
 
LINE/COL ERROR
-------- -----------------------------------------------------------------
45/1 PLS-00103: Encountered the symbol "ER" when expecting one of the
following:
. ( ) , * @ % & | = - + < / > at in is mod remainder not
range rem => .. <an exponent (**)> <> or != or ~= >= <= <>
and or like LIKE2_ LIKE4_ LIKEC_ between || multiset member
SUBMULTISET_
The symbol "." was substituted for "ER" to continue.
124/6 PLS-00103: Encountered the symbol "
-- ||" when expecting one of the following:
:= . ( @ % ;
LINE/COL ERROR

-------- -----------------------------------------------------------------
Please sugggest a solution

Moderator's Comments:
Mod Comment By now you should be familiar with [CODE] tags. Please use them...

Last edited by pludi; 05-17-2011 at 11:23 AM..
# 2  
Old 05-17-2011
Seems like the keyword UPPER has been split.
The code has been mangled by word wrapping.
# 3  
Old 05-19-2011
If you just want to try Oracle, then you can use a prebuilt virtual machine.

VirtualBox VMs for Developers
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Checking plsql flag status in UNIX

Hi,I have a stored procedure to verify no of months since current fiscal.I want a shell script to exit with returtn code when the verification fails,I have shell script below but this doesnt work sqlplus / << EOF WHENEVER SQLERROR exit 1 WHENEVER OSERROR exit 2 DECLARE v_time_period... (2 Replies)
Discussion started by: haadiya
2 Replies

2. Shell Programming and Scripting

Connecting+Firing plsql to Oracle DB in one go

Hi, I am using the below command to connect to a remote Oracle DB from my unix shell script. sqlplus -s user1/password1@remotedbhost:1252/demo @/tmp/PROC_MS.prc But I get the below error. 1. Can you confirm if my code is correct ? 2. Can you help me overcome the error ? (3 Replies)
Discussion started by: mohtashims
3 Replies

3. Solaris

Please help me how to administrate Oracle/plsql server

I previously worked for the L1 support on DNS/Apache servers in solaris10...... Now our team lead wants me to work on Oracle/plsql server for our new client.... I've to work without training... How can we know that Oracle/plsql server running in our machine ?? How to Administrate... (1 Reply)
Discussion started by: vamshigvk475
1 Replies

4. Shell Programming and Scripting

Script to give plsql procedure output

##Execute the EDW_MEM_KEY_UPDATE procedure ext_sta=`sqlplus -s ${Connstr} <<eof set heading off; set pagesize 0; set feedback off; set serveroutput on; execute EDW_MEM_KEY_UPDATE ; quit; here` vara="ORA-" var=`echo $ext_sta | grep -c $vara ` Hi All, above is a part of my unix... (7 Replies)
Discussion started by: iamnoone
7 Replies

5. Shell Programming and Scripting

Pass a value from Unix to PLSQL

Hi all, I need to pass a value from Unix to plsql block so that i can use the variable to in where caluse to get the desired output. I tried useing $variable_name, but it doesn't work. Any kind of help is appreciated. Thanks in advance. (3 Replies)
Discussion started by: bankimmehta
3 Replies

6. Programming

Executing shell script from PLSQL

Hi All, I have a requirement to mv a file in unix from plsql procedure. for that i have created a java host procedure, a host_command, given all grants as per ORACLE-BASE - Oracle8i Shell Commands From PL/SQL but i am getting an error ""Process err :/bin/sh: mv Not Found"" kindly let me... (1 Reply)
Discussion started by: aryan_styles
1 Replies

7. Shell Programming and Scripting

To get value from Oracle Anonymous PLSQL block

Hi All, i need you help while accessing the value from anonymous PL/SQL block. Initially our requirement was to get the value from SQL statement. I was doing like... But now i need to use dbms_application_info.set_module in it. So i have planned to use anonymous block instead of SQL... (2 Replies)
Discussion started by: Amit.Sagpariya
2 Replies

8. IP Networking

Sending mails using plsql program

I am trying to send an email to personal id using plsql program. I have written a code in plsql using UTL_TCP package where opens the connections and then senda a mail. But when i execute the program mails are not being sent. I typed "mail" command on the unix box and got the below result... (5 Replies)
Discussion started by: amol_mudholkar
5 Replies

9. UNIX for Dummies Questions & Answers

Receiving Value from plsql package.

Hi, I am working on a shell script that fires a plsql package. I would like the package to return a value to the shell script and then the shell script to return it to the javascript. Is it possible for the shell script to accept the return status from the plsql package and then pass it back... (4 Replies)
Discussion started by: akpopa
4 Replies
Login or Register to Ask a Question