Need a procedure to check reserve words are in uppercase or not?

Hi All,
i am using oracle 11g,
my question is  i wanted to create procudure and i  am passing a sql query as input parameter  and there i am using lots of oracle reserve keywords. but i need to check if  those reserve keywords are  not in uppercase
it should show error message and error line.  suppose my query is like below and it should show which line error is?
SELECT FINDING_LEVEL_ID 
,PROTOCOL_SETUP_ID
,FLV_LAST_MODIFIED_BY
,FLV_LAST_MODIFIED_ON
  FROM empb
Where EXISTS (SELECT 1
          FROM dept  a
         Where a.PROTOCOL_SETUP_ID = b.PROTOCOL_SETUP_ID
           AND PROTOCOL_LAST_MODIFIED_ON >
               to_date(ms_sra_get_max_date_fnc('N'
                                              ,'SGMGBI')
                      ,'DD-MON-YYYY HH24:MI:SS'));
suppose error is there in where key word  so it should show errorline and error message, but error message is common for every line.
please help me
Thanks
Damby

913349 wrote:
Hello Ramin,
but i need as dyanamic,i cant write always select exist from dual or select 'select' where  from dual .
anyway i need to pass as parameter.
Thanks
Damby
I don't read other posts , I gave you only example... If you have table  with this words you should replace RS to your table name. And write pl/sql code for procedure.
with rs(a) as
select 'WHERE' FROM DUAL UNION ALL
select 'FROM' FROM DUAL UNION ALL
select 'EXISTS' FROM DUAL UNION ALL
select 'SELECT' FROM DUAL
select a.a,
       substr(s,REGEXP_instr(upper(s),a,1,column_value),length(a)) error_word,
       REGEXP_instr(upper(s),a,1,column_value) err_line
from(
select rownum n, q.*, rs.*, regexp_count(upper(q.s), rs.a) cnt from (    
select
'SELECT FINDING_LEVEL_ID,
       PROTOCOL_SETUP_ID,
       FLV_LAST_MODIFIED_BY,
       FLV_LAST_MODIFIED_ON
  froM empb
Where exists (SELECT 1
          FROM dept a
         Where a.PROTOCOL_SETUP_ID = b.PROTOCOL_SETUP_ID
           AND PROTOCOL_LAST_MODIFIED_ON > to_date(ms_sra_get_max_date_fnc(''N'', ''SGMGBI''),''DD-MON-YYYY HH24:MI:SS''));' s
           from dual) q, RS) a, table(select collect(rownum) from dual connect by level <= a.cnt)
where a != substr(s,REGEXP_instr(upper(s),a,1,column_value),length(a))
A
ERROR_WORD
ERR_LINE
WHERE
Where
121
WHERE
Where
175
FROM
froM
111
EXISTS
exists
127
Ramin Hashimzade

Similar Messages

  • In APP i need to send a check thourgh business area

    Dear Gurus,
    please tel me In APP F110 i need to send a check thourh business area
    please help me
    Regards,
    Shekar.

    Hi Anil,
    while running APP F110 in the Free Selection Screen Select Business Area
    through that Business Area you can pay checks

  • How to check IN paramers are oracle keywords or not

    Hello
    i am new in oracle word and i want to know, how i will check IN parameters are oracle keywords or not. if client using orale key wors as parameters then i will geneate error and exit from procedure..............
    Regards.
    Edited by: user13478428 on Dec 14, 2010 10:07 AM

    dear sir
    i am new already told. and i had write this dynamic procedure for a very good application.
    i am using on front end dotnet and backend oracle 10g. so i write a dynamic procedure which is using to delete record. but now i want check from frontend, user sen me exact parameters or used oracle keyword like /*, */, //, drop and many more. if user send me such (oracle reserved word) parameters then it will destory my datbase and slowdown my application working.
    so to stop such (oracle reserved word) as parameters , i check these parameters and stop my procedure execution.
    please any help,
    thanks,
    Edited by: user13478428 on Dec 14, 2010 10:07 AM

  • Pl/sql stored procedure code2 check the emial id is correct or not

    if the mail id is [email protected]@.com
    then how we do validations means
    there must be only one @
    i wnat all tghis type of validations 2 check the email id is correct or not?
    the procedure that i wnat to validate akll the validations

    This appears to be a duplicate of your existing thread
    pl/sql stored procedure for email id validations
    I'll answer there.
    Justin

  • Oracle Reserved Words in EJB Implementations

    Hello Everybody!
    Suppose there is a table in Oracle , say Account which has a column, say comment. comment is a reserved word in Oracle. I would like to know how Oracle reserved words are handled in EJB implementation. For example, suppose there is an enterprise application that accesses such a table using CMP beans, how would we specify the <field-map>
    <field-map>
    <cmp-field>comment</cmp-field>
    <dbms-column>COMMENT</dbms-column>
    </field-map>
    This doesnt work because COMMENT is a reserved word in Oracle. In Oracle,
    if we use comment as a column name, it has to be represented in double quotations.
    for example, this select query doesnt work
    select COMMENT from account;
    these select queries works
    select "COMMENT" from account;
    select A."COMMENT" from account A;
    Regarding the current EJB implementations, the question is whether they support Oracle reserved words in their mappings??
    "COMMENT"s welcome
    Thanks!
    Manu Ramakrishnan

    >
    This doesnt work because COMMENT is a reserved word in
    Oracle. In Oracle,
    if we use comment as a column name, it has to be
    represented in double quotations.
    Did you try it?
    Did you try it with double quotes?
    The specs I looked at do not discuss this(jdbc, ejb, j2ee.) The ejb spec reserves as part of EJB QL some standard ANSI SQL reserved words and specifically suggests that other ANSI SQL reserved words should not be used.
    And if I am reading the EJB QL section correctly identifiers (which would be a table, field names) do not allow quoted identifiers. Or at least they specifically do not allow fields with, for example, a space. This sort of name is specifically allowed for in ANSI SQL and has been since the first version of ANSI SQL. They also do not allow for case sensitive names, which again is allowed in ANSI SQL as part of a quoted identifier.
    That suggests to me that you use reserved words that either you going to be using a non-J2EE feature of a container or it simply won't work in the first place.

  • Sales area data view is not visible

    Hi All,
    the salea area data view  is not visible for  all BP roles in BP master data
    please help me how can i need to put in a visible

    hi
    sales area data tab is not visible for each and every BP role,
    it is visible for sold to party,ship to party roles,
    there is aview associated with this role that is CRM 000
    if you want to have sales area data tab visible in the role like BP general you have to assign this view to your role
    but i should make you one thing very clear that sales area data tab is meant for the customer who has purchased the order and final order has been given and within this tab you have each and every info regarding the sales office,sales group etc that where the order is to be delieverd or purchased from,
    once a final order is given it can be sold to party role,ship to party role or bill payable role ,u urself tell in the role of customer how can u see the sales info if the customer hasnt purchased the order ,
    likewise the consumer role also has sales data info so sales area data tab is visible in this role too
    hope it clears all your doubt,
    in case of any doubt do revert back
    best regards
    ashish

  • I need to use a reserved word as parameter name in proc called from URL

    Let me preface this post by saying I already know this is terrible to attempt, but it's short term fix only.
    Ok, so I have to create a procedure that will be called by a vendors application via a API that calls our URL to send data over. The terrible part is
    that the API they have uses the parameter FROM=vendor_data A change is on the way so in the future the API won't use FROM as a paramter, so this isn't something I want to do, but it's a workaround.
    So the nastiness is this..., I can create a procedure that'll compile when I enclose FROM in double quotes "FROM" as my input parameter
    but if I try to call my procedure via URL (as their application will do) the procedure isn't working. I searched for someway to do an inline
    replace of the FROM parameter to something else, but no luck. I'm open to all positive comments. I cannot go outside of Oracle
    to do this, so I can't call a shell script and replace. Basically I need some way to use a reserved word as a parameter name, and then be able to call
    that proc from a URL, or someway to change the FROM in the URL inline. Any help on this admittedly whacky situation would be appreciated much.
    I tried ...\myproc?from=text
    ...\myproc?"from"=text
    ...\myproc?'from'=text
    proc is simple test procedure
    create or replace procedure myproc
    ("from" in varchar2 default 0)
    is
    v_from varchar2(30);
    begin
    v_from:="FROM";
    insert into test(col1) values(v_from);
    end;
    **** Update
    I didn't get any more replies but came to a solution that I thought I'd post. It's much better, more elegant and maybe can help others.
    So instead of using FROM as the parameter name I did some research and decided I can use flexible parameters. Basically you end up having
    2 input parameters for a procedure, one holds a parameter name the other holds the parameter value. They get loaded into arrays
    and you access the values with regular name_array(1), value_array(1), etc. ?v=parameter&v2=value
    Once I figued I could use flexible parameter it took me tons of research to find out the actual syntax. I'll post some examples for others
    later, but was suprised with the lack of resources consideriing how "flexible" they are.
    Thanks again for the replies. Cheers.
    Edited by: Mitz on Jul 29, 2009 11:37 PM

    Scott,
    Thanks for the reply. I'm not familiar with the wwv_flow_epg_include_mod_local, however I know that the
    myproc is available via URL. I passed the my procedure name(myproc) on to the dba a while back to make it "accessible" so, I'm assuming that he
    added it to this the www_flow_epg_mod_local (assuming this has something to do with access control).
    If I modify myproc procedure and remove "FROM" as the input variable, and replace with say,
    IN_FROM I can then call the procedure via the URL ./myproc?in_from=test without any problems.
    I'm pretty confident that it's the "FROM" that is the hurdle and not a security or setup issue. The proc is fine to call from the URL until I got the curveball that the only available parameter was FROM. How the URL should be when inputing to that parameter?
    Edited by: Mitz on Jul 25, 2009 7:36 PM
    Edited by: Mitz on Jul 25, 2009 9:16 PM

  • The pdfs that are produce in Word are very large. I need a method of compressing them variably - not just a quick reduction using the quartz filter.  Is their a suitable free compression programme,

    The pdfs that I produce in Word are very large. I need a method of compressing them variably - not just a quick reduction using the quartz filter.  Is their a suitable free compression programme,

    PDF Shrink for Mac
    Compress PDF – Reduce your PDF Online
    PdfCompress for Mac

  • Need to add a check in between the stored procedure

    Hi Team, I am new to pl/sql and need to add a check in between the below procedure such that, Only if the Insert is successfull the delete should execute, if not the loop should be ended.
    Please help me.
    CREATE OR REPLACE PROCEDURE Archive_psuser_grants AS
    i NUMBER:=1;
    CURSOR c IS SELECT * FROM ps_user_grants1 WHERE DATABASE = 'F90PRD';
    BEGIN
    FOR records IN c loop
    INSERT INTO ps_user_grants_archive VALUES (records.DATABASE,records.username,records.level_type,records.privilege,records.grantable,records.owner,records.table_name,records.column_name,records.sr_number,records.initially_granted);
    i := i+1;
    IF mod(i, 1000) = 0 THEN -- Commit every 1000 records
    dbms_output.put_line ( '1K records applied into archive table ');
    COMMIT;
    end if;
    end loop;
    COMMIT;
    dbms_output.put_line ( 'Rows successfully Inserted into Archive Table ');
    delete FROM ps_user_grants WHERE DATABASE = 'F90PRD';
    COMMIT;
    dbms_output.put_line ( 'Rows successfully Deleted from Original Table ');
    END Archive_psuser_grants;
    Thanks in advance,
    Sri
    Edited by: user3969470 on Feb 9, 2011 8:50 PM

    ROW by ROW, is SLOW by SLOW.
    COMMIT inside LOOP is a GREAT mechanism for producing ORA-01555; SNAPSHOT TOO OLD, error
    You need to implement EXCEPTION handler(s)
    What should be done where DELETE fails?

  • Need detailed procedure on how to add an item with Item Style Check Box in

    Need detailed procedure on how to add an item with Item Style Check Box in Framework.

    The view instance should be the same as the view instance (view object) specified for your region.
    If the View Attribute already that you need already exists in the View Object then you can use it.
    Otherwise you have to extend the View Object and add the new attribute to it.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I need help with storage.    5 GB are free.   So iCloud sends an email that I need more.   So I purchase 20GB and now I want to downgrade back to the 5GB.   I can check the 5GB box, but no DONE button appears.   Anyone have an answer?

    I Need help with iCloud storage.   5gb are free, so I get an email, that mine is just about full.   So I upgraded to 20gb and now I want to downgrade back to 5gb.
    tthe DONE button doesn't highlight, so my requested can't be completed.   Any help will be appreciated.

    Have you tried rebooting the computer? If not, the next step is to contact iCloud Support. http://www.apple.com/support/icloud/

  • When using facebook my words are really small so i need to know how i can make them back larger

    Somehow I changed the size of my characters only when using facebook, so I would like to know how to change them back to regular size because they are really small. It's only like this when using facebook on firefox because I tried on internet explorer and it's fine.

    ctrl-+ is the easiest way (as in, hold down ctrl and press the + key, multiple times if needed). It might be [mac button]-+ on macs, I'm not sure.

  • Friends,  i  have a problem with safari . Whenever i am typing in the safari main bar , so in the halfway through the typing my sentence/words are shifting to another main google search and in the end i have to type again in google

    Friends, 
    i  have a problem with safari . Whenever i am typing in the safari main bar , so in the halfway through the typing my sentence/words are shifting to another main google search and in the end i have to type again in google. I have attached a sample screenshot of the safari problem which i am facing. In this particular example i wanted to write Print Screen, however halfway,my typing automatically shifted to google bar?? can you guys help me.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of this test is to determine whether the problem is localized to your user account. Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault in OS X 10.7 or later, then you can’t enable the Guest account. The "Guest User" login created by "Find My Mac" is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.

  • Need a procedure to make minus query as output for 2 tables

    Can anybody help me to create a procedure so that I could get minus query of 2 table as a result.
    Requirement:
    I have two table 1- src_table_list ,2- tgt_table_list both tables have 2 columns : serial_no,table_name and 100 records each. and details mentioned in column "table_name" are actually tables name which present in my testing database.
    so I need one procedure which will pick one table_name from src_table_list and one table_name from tgt_table_name each time recursively and provide minus query as a result. as below.
    select c1,c2,c3,c4 from table1 --(fetched from src_table_list)
    minus
    select b1,b2,b3,b4 from table2 --(fetched from tgt_table_list)
    Can any body give or help me to create the procedure..as I have to prepare minus query for more than 200 tables and then I need to test them for integration testing..
    Edited by: 974253 on Nov 30, 2012 5:39 AM

    select 'select '||chr(39)||src_table_list.tblname||chr(39)||','||chr(39)||trg_table_list.tblname||chr(39)||',count(*) from '||' ( select * from '||src_table_list.tblname||'minus select * from '||trg_table_list.tblname||');'
    from src_table_list, trg_table_list
    WHERE src_table_list.serial_no = tgt_table_list.serial_no
    The above statement should give output similar to below code and will list down all the table names in the 2 tables(i.e. above src and trg) -
    select 'src_table_list.tbl1','trg_table_list.tbl1',count(*) from
    (select col1, col2 from src_table_list.tbl1 minus select col1, col2 from trg_table_list.tbl1 );
    select 'src_table_list.tbl2','trg_table_list.tbl2',count(*) from
    (select col1, col2 from src_table_list.tbl2 minus select col1, col2 from trg_table_list.tbl2 );
    Now atleast you can run these statements as script and get to know what all tables are having count differences.
    I might have missed out on some syntax part in above code but hope to have helped you in some way as you will be specific with number of tables to check for differences.

  • SQL Developer 1.5 migration issue with MS use of reserved words

    In version 1.2 the was and advanced option that allowed the use of reserved words for column names, I can not find that option in 1.5. What happened to this option? I can not find it and I need to port those applications with out changing the column names. I know I can hand edit the scripts but I did not have to do that with 1.2.
    Any one know if this can still be done?

    n 1.2 iIt was under preferences - > Migration -> Advanced, in version 1.5 no advanced options and I searched around and could not find it else where. gulp as for the reserved words ( don't laugh I am just migrating under orders) there are date, number and some columns with embedded / that it barfs on. I am under orders to do it the way it is written.

Maybe you are looking for

  • Can't connect to itunes with my iPod (touch).

    My IPod is disabled (I haven't used it in quite awhile, don't know why it's disabled) and is asking me to connect to itunes. When I try to, I get an error on itunes saying "iTunes could not connect to the iPod "Nathan's IPod" because it is locked wit

  • Macbook only works with charger plugged in

    Not been on my macbook for a week however I realised I left it on sleep for the week... When I have gone to put it on charge it won't charge up and only stays on if the adapter is plugged in?! I really need to get this sorted as I use it a lot for wo

  • Query_only and no_query_only

    Hi How do I know when I am in a called form that this form was called in query_only or no_query_only mode? Is there a property that one can retrieve? I need to determine this in a when-new-form-instance trigger. Thanks Francois

  • Best Practices using trace?

    I've been using trace() on all my functions so when I debug I can read which functions are running and what order. I like it, but is there a more efficient way or a best practice on tracing? I google "Best Practices Trace() Flex" but found nothing.

  • How to map this scenario..?

    Hi, I have one requirement to map in SAP, Scenario: 1)PO will be raised for a material A. 2)Material A contains 5 different component materials( ie by assembling 5 components we will get Material A) 3)When I do GR for Material A against that PO, stoc