Hashing in PLSQL

Hi
How i can hash a field in a table , to the purpose of encrypting it ?
Thanks

pls see
http://download.oracle.com/docs/cd/B19306_01/network.102/b14268/asotrans.htm
http://decipherinfosys.wordpress.com/2009/03/01/encrypting-a-single-column-in-oracle/

Similar Messages

  • MD5 hash code in PLSQL

    Hi everyone,
    I am building dynamic web pages using Oracle's plsql web
    toolkit. I am building a page that will pass information to a
    credit card authorizer. I need to create a MD5 hash string to
    pass to the credit card company. Is there an Oracle built in
    procedure/function/package to generate a MD5 hash string? If
    not, can anyone recommend a good reference source for generating
    a MD5 hash code in a plsql environment.
    Thanks.
    Dave W.

    This is from the Object API; I think it has the information that explains what's happening (but doesn't resolve your apparent problem)
    public int hashCode()
    Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.
    The general contract of hashCode is:
    Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
    If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
    It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results.
    However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.
    As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

  • How to consume Web Service with Password digest from PLSQL

    We have Oracle 10g (10.2.0.3.0) 64 bit. We have a situation where we need to consume web service whose security header looks like as follow,
    <soapenv:Header>
    <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:UsernameToken wsu:Id="UsernameToken-50">
    <wsse:Username>weblogic</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">d2enK45chjBPVvvukbYU6OX56kI=</wsse:Password>
    <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">YAhEtLJfp4lzycLd3hZYjQ==</wsse:Nonce>
    <wsu:Created>2013-01-22T06:28:38.897Z</wsu:Created>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    Here we need passowrd digest, Nonce and Timestamp.
    How to create password digest from PLSQL? or if any other alternatives available please response soon.

    I do not see why it will not be possible to do digest authentication with a web server using PL/SQL.
    As for the digest password - the web server supplies a token (a nonce) which you need to use for creating the hashed authentication token (the digest password). The URL I posted explains this authentication process.
    As for the technical how-to in PL/SQL - as I mentioned, never had to do this (only dealt with Basic and NTLM authentication thus far). But as other auth methods (such as Microsoft's NTLM) can be implemented, I do not see why digest authentication could not.
    Suggest you spend some time googling for technical articles/sample code on the subject - and try to find specific PL/SQL related sample code too.

  • Regarding PLSQL web services

    I'm calling a plsql stored procedure on PHP. The URL looks something like
    http://<servername><port>/pls/<DAD>/packagename.procedurename
    I get HTTP 404 error if the procedure has a PLSQL table type parameter in it.
    Any ideas why it's so? Has the mod_plsql settings got something to do with this, because this behavior is not seen on all environments?
    DB version: 8.1.7.3.0

    Check SICF that the service is activated.
    Go to ST01, start an authorisation trace. Attempt to use the service, then look at the trace to check if it's an auth issue.
    Check SM21 for any indication of an issue at that time.
    The problems I've encountered have been the service not being activated, the role not having the service included with the correct hash entry as in USOBHASH, or other authorisation errors.
    Finally, go to SMICM, and using one of the options there, up the trace level to 3. But if you get to that stage, you're really getting into networking type knowledge.

  • How to get execution plan from plsql

    i have a nasty sql inside plsql and want to get the execution plan. what is the best way of getting it.
    v_sql:= 'select loop_f1.loopid
             FROM rdw.WDM_Prov seg_f1,
                 rdw.WDM_loop_Prov_association assoc_f1,
                 rdw.WDM_potential_loop_makeup loop_f1,
                 rdw.WDM_Prov seg_fx,
                 rdw.WDM_loop_Prov_association assoc_fx,
                 TABLE(CAST( :loopInfo as ermarc.t_CustomerLoopElement)) input_loop
            WHERE loop_f1.CO_illc =  :f1_co_illc
            AND loop_f1.LOOPID = assoc_f1.LOOPID
            AND  assoc_f1.Prov_NUMBER = :f1_Prov_number
            AND  assoc_f1.Prov_ID = seg_f1.Prov_ID
            AND  Upper(TRIM(LEADING 0 FROM  seg_f1.CABLE))  =:f1_cable
            AND  (seg_f1.low_rep <= :f1_rep AND  seg_f1.high_rep >= :f1_rep)
            AND  seg_f1.TERMSYSID = :f1_termsysid
            AND  assoc_f1.Prov_number = 1
            AND  loop_f1.loopid = assoc_fx.loopid
            AND  assoc_fx.Prov_ID = seg_fx.Prov_id
            AND  assoc_fx.Prov_number = input_loop.Prov_number
            AND   Upper(TRIM(LEADING 0 FROM  seg_fx.CABLE)) = Upper(TRIM(LEADING 0 FROM  input_loop.cable))
            AND  (seg_fx.low_rep <= input_loop.rep and seg_fx.high_rep >= input_loop.rep)
            AND  seg_fx.termsysid = input_loop.termsysid
            GROUP BY loop_f1.loopid
            HAVING MAX(assoc_fx.Prov_NUMBER) = :v_cntProvs
            AND  COUNT(CASE WHEN assoc_fx.Prov_number = input_loop.Prov_number THEN 1 ELSE 0 END) = :v_cntProvs';
    EXECUTE IMMEDIATE v_sql BULK COLLECT  INTO v_looplist
    USING loopInfo,
           loopInfo(1).co_illc,
           loopInfo(1).Prov_number,
           Upper(TRIM(LEADING 0 FROM   loopInfo(1).cable)),
           loopInfo(1).rep,
           loopInfo(1).rep,
           loopInfo(1).termsysid,
           v_cntProvs,
           v_cntProvs;

    Sorry, a tag or a statement_id is a way of identifying a particular SQL statement by an identifier other than its SQL_ID to make getting the plan easier. If I want the plans for two different statements, I can provide a statement_id and use that as an argument for DBMS_XPLAN later on.
    SQL> ed
    Wrote file afiedt.buf
      1  begin
      2    execute immediate
      3      'explain plan set statement_id = ''JCAVE_DEPT'' for select * from dept'
      4    execute immediate
      5      'explain plan set statement_id = ''JCAVE_EMP'' for select * from emp';
      6* end;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> select *
      2    from table( dbms_xplan.display( null, 'JCAVE_DEPT', null ));
    PLAN_TABLE_OUTPUT
    Plan hash value: 3383998547
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     4 |   120 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| DEPT |     4 |   120 |     3   (0)| 00:00:01 |
    Note
    PLAN_TABLE_OUTPUT
       - dynamic sampling used for this statement
    12 rows selected.
    SQL> ed
    Wrote file afiedt.buf
    Wrote file afiedt.buf
      1  select *
      2*   from table( dbms_xplan.display( null, 'JCAVE_EMP', null ))
    SQL> /
    PLAN_TABLE_OUTPUT
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |    14 |  1218 |     3   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| EMP  |    14 |  1218 |     3   (0)| 00:00:01 |
    Note
    PLAN_TABLE_OUTPUT
       - dynamic sampling used for this statement
    12 rows selected.Justin

  • Need help in regarding Oracle PLSQL developer interview questions

    Hi all,
    I am totally new in this field regarding plsql. I have just finished training in oracle plsql and in oracle financials. But for starting career i am looking jobs as:Oracle plsql developer. Can somebody help me what type of questions people going to ask? I am not confident yet, i have made my resume but for submitting resume i just want to be aware for the interview questions. Can somebody help me in telling me good questions and answers as to what to prepare?
    Thanks in advance.

    1.
    Do you have experience in Oracle 10g? If so, what are your favorite new features? (shows depth of experience and how well they are keeping up with technology)
    2.
    Partitioning (Practical Scenarios)
    1.
    Have you ever worked with partitioned tables? Example:
    2.
    What types of partitioning?
    3.
    What types of indexing, global or local? Why did you choose global or local?
    4.
    What do you see in SQL that is accessing partitioned tables that enables Oracle to take advantage of partitioning?
    5.
    What is partition pruning?
    3.
    PL/SQL Bulk Features
    1.
    Have you ever used PL/SQL bulk features? Which ones? Can you provide an example?
    2.
    What makes bulk processing faster?
    3.
    What PL/SQL data constructs are required to use bulk features?
    4.
    Oracle Collections
    1.
    What are the three types of collections?
    2.
    When would you use a varray versus a nested table?
    5.
    Global Temporary Tables
    1.
    Have you ever used Global Temporary Tables? Example:
    2.
    How does Oracle treat Global Temporary Tables differently than regular tables, making them faster?
    6.
    Autonomous Transactions
    1.
    What is an autonomous transaction? Example:
    7.
    SQL Tuning
    1.
    Someone comes to you with a SQL statement that is running slow, what are some potential problems that can be identified just by looking at the SQL statement?
    2.
    What are the steps you follow in the database to tune SQL?
    8.
    Locking Techniques
    1.
    Types of Locks
    1.
    Optimistic
    2.
    Pessimistic
    3.
    Lock Escalation
    9.
    Autonomous transactions, where to use examples if any
    10.
    Difference between Truncate and Delete Statement
    11.
    PL/SQL tables, index by tables, VARRAY, associate arrays, differences and when to use
    12.
    Performance tuning related, Using Explain plan, SQL* Plus auto trace, and using tkprof
    13.
    Different types of joins oracle uses ( Hash join, Merge Join, Nested loop join)
    14.
    Oracle SQL ANSI syntax ( JOIN USING, JOIN ON, LEFT OUTER JOIN,RIGHT OUTER JOIN etc..)
    15.
    dbms_profiler package uses
    16.
    Unit testing approach, if you know and worked on out PLSQL frame work for automatic testing, its big advantageous
    17.
    Oracle approach for read consistency, what is SCN, dirty reads, phantom reads etc..
    18.
    Standards ( Coding standards, naming standards etc.) , There are guidelines and naming standards for variables, package, procedure, function names, database object names etc…( Be prepared what standards you followed in previous projects )
    19.
    Snapshot too old error, fetch out of sequence error when it comes, should be able to explain.
    20.
    Oracle block, what it contains. Row chaining, row migration concepts
    21.
    Version control software’s (experience in clearcase and clearquest is big advantage). If you have not used these, know about the importance of these and be prepared to explain which ones you used in previous projects, and how the PL/SQL code used to deploy.
    22.
    Oracle server architecture, know about oracle memory structures, background processes overview

  • Issue with single table hash cluster

    I'm still learning lots about html db so please do bear with me...
    I have a table that is part of a single table hash cluster. The cluster and table are created like so:
    create cluster webmon.owm_system
      db_id number(3),
      env_id number(3)
    size 171
    hashkeys 1009
    single table
    pctfree 2
    pctused 96;
    create table webmon.owm_system
      tier_id number(3) not null,
      host_id number(3) not null,
      port number(4) not null,
      sid varchar2(8) not null,
      admin_user varchar2(32) not null,
      admin_auth varchar2(48) not null,
      primary_dba_id number(3) not null,
      secondary_dba_id number(3) not null,
      primary_bac_id number(3) not null,
      secondary_bac_id number(3) not null,
      version_id number(3) not null,
      log_mode_id number(3) not null,
      db_id number(3) not null,
      env_id number(3) not null,
      admin_conn varchar2(32) null,
      constraint owm_system_pk primary key (db_id, env_id)
    cluster webmon.owm_system
      db_id,
      env_id
    );I have created a form (and report) to view and edit the data in the table. When I click the "Apply Changes" button on the form after editing data, I get an error. The SQL that is sent to the database is incorrect.
    Here is the (reformatted) incorrect SQL that is sent (captured in a database trace file):
    update
      "WEBMON"."OWM_SYSTEM"
    set
      "SECONDARY_DBA_ID" = :DML_BV0001,
      "DB_ID" = :DML_BV0002,
      "DB_ID" = :DML_BV0003,  /* This should not be here */
      "ENV_ID" = :DML_BV0004,
      "ENV_ID" = :DML_BV0005,  /* This should not be here */
      "HOST_ID" = :DML_BV0006,
      "PORT" = :DML_BV0007,
      "SID" = replace(:DML_BV0008,'%null%',null),
      "ADMIN_USER" = replace(:DML_BV0009,'%null%',null),
      "ADMIN_AUTH" = replace(:DML_BV0010,'%null%',null),
      "ADMIN_CONN" = replace(:DML_BV0011,'%null%',null),
      "VERSION_ID" = :DML_BV0012,
      "LOG_MODE_ID" = :DML_BV0013,
      "TIER_ID" = :DML_BV0014,
      "PRIMARY_DBA_ID" = :DML_BV0015,
      "PRIMARY_BAC_ID" = :DML_BV0016,
      "SECONDARY_BAC_ID" = :DML_BV0017
    where
      "DB_ID" = :p_rowid
    and
      "ENV_ID" = :p_rowid2Why are the DB_ID and ENV_ID columns in the statement twice? That is the error.
    Now, if I create the table as just a basic, non-clustered table like this:
    create table webmon.owm_system
      tier_id number(3) not null,
      host_id number(3) not null,
      port number(4) not null,
      sid varchar2(8) not null,
      admin_user varchar2(32) not null,
      admin_auth varchar2(48) not null,
      primary_dba_id number(3) not null,
      secondary_dba_id number(3) not null,
      primary_bac_id number(3) not null,
      secondary_bac_id number(3) not null,
      version_id number(3) not null,
      log_mode_id number(3) not null,
      db_id number(3) not null,
      env_id number(3) not null,
      admin_conn varchar2(32) null,
      constraint owm_system_pk primary key (db_id, env_id)
    );Everything works as expected. The (correct) SQL sent in this case is:
    update
      "WEBMON"."OWM_SYSTEM"
    set
      "SECONDARY_DBA_ID" = :DML_BV0001,
      "DB_ID" = :DML_BV0002,
      "ENV_ID" = :DML_BV0003,
      "HOST_ID" = :DML_BV0004,
      "PORT" = :DML_BV0005,
      "SID" = replace(:DML_BV0006,'%null%',null),
      "ADMIN_USER" = replace(:DML_BV0007,'%null%',null),
      "ADMIN_AUTH" = replace(:DML_BV0008,'%null%',null),
      "ADMIN_CONN" = replace(:DML_BV0009,'%null%',null),
      "VERSION_ID" = :DML_BV0010,
      "LOG_MODE_ID" = :DML_BV0011,
      "TIER_ID" = :DML_BV0012,
      "PRIMARY_DBA_ID" = :DML_BV0013,
      "PRIMARY_BAC_ID" = :DML_BV0014,
      "SECONDARY_BAC_ID" = :DML_BV0015
    where
      "DB_ID" = :p_rowid
    and
      "ENV_ID" = :p_rowid2The "real" system in question has a fairly large number of single table hash clusters. I'm leary of continuing my explorations if there is a problem with using single table hash clusters. On the other hand, I'm quite open to the idea that I've done something wrong!
    Any pointers? Is there anyway to change the SQL that is being generated when using the single table hash cluster? More information needed?
    Thanks,
    Mark

    Mark,
    Can't help with the hash table problem but as a method of dealing with it you could just make a procedure to manage the table.
    Pass the value of :REQUEST (matches value of button) in and you'll be able to modify the tables.
    procedure manage_owm_system (p_request varchar2,db_id number ...)is
    begin
    case p_request
    when 'CREATE' then
    insert
    into ....
    when 'SAVE' then
    update .....
    else
    raise_application_error(-20001,'Unkown request');
    end case;
    end;
    put that in a plsql reqion after submit
    begin
    manage_owm_system(p_request=>:REQUEST,p_dbid=>:P1_DBID .......);
    end;
    You need to create something similar , with out parameters, to populate the items when the pags loads.
    Chris

  • Converting from JAVA HASHMAP to PLSQL object or CLOB

    Hello All,
    My oracle version in 10.2.0.4 on a solaris V880 machine.
    Our Application Java SDK is 1.4.
    I am trying to pass in a series of XML (considerably huge for XML type column) from java application plsql which stores them into an oracle table with column as external BLOB. Since the contents are so heavy for each objects , using XMLTYPE column is not feasible.
    The xml files comes as either java hash_map or string which i have to pass as parameter to an Oracle stored procedure which stores as external BLOB in OS through a table.
    My first doubt is this the correct approach.
    My second doubt here is how to interpret java hash_map object within PLSQL when it is passed to it.
    Apologies if the question is silly since i am a new comer to java.
    Thanks in advance ,
    Vijay G

    vijay S P G wrote:
    If i have plsql collection with a varchar2 and a blob as record type then can i directly pass the java hash map to the procedure having parameter datatype as the above said record type ?Of course not. Obviously the first reason for that is because the "blob" needs to be a file path and not a blob.
    Second reason is no databases that I know of take a hash data type. Some take arrays. But I doubt that is worth the trouble.
    You have a collection of name value (path) pairs. Iterate over the collection and for each name do an insert of the name and path.

  • Error while trying to access a SSWA PLSQL function

    Hi,
    I am trying to access a report as a web page by defining the function as follows :
    Type : SSWA PLSQL FUNCTION
    HTML Call : OracleOASIS.RunReport
    Parameters : report=EMPDET
    This function is attached to the menu and when I try to access the page I get this error.
    "Error: The requested URL was not found, or cannot be served at this time.
    Incorrect usage."
    The URL that shows in the page is as follows(<server:port> I removed the server name and port) :
    http://<server:port>/dev60cgi/rwcgi60?GDEV_APPS+DESFORMAT=HTML+SERVER=GDEV_APPS+report=EMPDET+p_session_id=A9C71A70B9B1D9BD2DCC0FC3AF9BC324+p_user_id=1133+p_responsibility_id=50230+p_application_id=800+p_security_group_id=0+p_language_code=US+NLS_LANG=AMERICAN_AMERICA+NLS_DATE_FORMAT=DD-MON-RRRR+NLS_NUMERIC_CHARACTERS=.%2C+NLS_DATE_LANGUAGE=AMERICAN+NLS_SORT=BINARY+paramform=NO
    Surprisingly other functions which are defined in this manner work fine. Do I need to register my report anywhere or are there any other settings I need to do for the report to show up.
    Can someone let me know.
    Thanks

    Hi ;
    pelase check below which could be similar error like yours
    Troubleshooting of Runtime Errors of Customer Intelligence Reports [ID 284829.1]
    Regard
    Helios

  • Error while consuming PLSQL Webservice through BPEL

    HI ,
    I have created a simple PLSQL Web service called "HelloWorld" and it got successfully deployed .
    When I tried to test this webservice through BPEL Process Manager , its showing me error everytime that ( Could not create object of class 'dimple.HelloWorldWebServiceUser'; nested exception is: java.lang.ClassNotFoundException: dimple.HelloWorldWebServiceUser</summary> ) .
    Please anyone help me out with this problem .
    Thanks
    Prashant Dwivedi

    HI ,
    I have created a simple PLSQL Web service called "HelloWorld" and it got successfully deployed .
    When I tried to test this webservice through BPEL Process Manager , its showing me error everytime that ( Could not create object of class 'dimple.HelloWorldWebServiceUser'; nested exception is: java.lang.ClassNotFoundException: dimple.HelloWorldWebServiceUser</summary> ) .
    Please anyone help me out with this problem .
    Thanks
    Prashant Dwivedi

  • The simplest way for plsql procedure to return multiple rows

    Hi,
    What is the simplest way for plsql procedure to return multiple rows (records). There are many combination of ways to do it but I am looking for a solution that is appropriate for plsql beginners. Many solutions use cursors, cursor variables, collections and more that kind of things that are complex on the face of it. Is it somehow possible to achieve the same with less effort?
    Sample query would be: SELECT * FROM EMPLOYEES;
    I want to use returned rows in APEX to compose APEX SQL(in that context plsql) report.
    It is enough to use just SELECT * FROM EMPLOYEES query in APEX but I want to use plsql procedure for that.
    Thank you!

    Hi,
    It depends :-).
    With +...that is appropriate for plsql beginners...+ in mind... it still depends!
    The list of techniques (ref cursors, cursor variables, collections, arrays, using explict SQL) you have referenced in your post can be made to work. but...
    +Is it somehow possible to achieve the same with less effort?+ Less effort : That needs to be defined (measured). Especially in the context of pl/sql beginners (who is a beginner?) .
    What is the level of "programming experience" ?
    What is the level of understanding of "Relational Result set" as processible in Oracle?
    If you are looking for
    Process_the_set_of rows_in APEX () kind of capabilitywhich "abstracts/hides" relation database from developers when working on relation database, it may not be the best approach (at least strategically). Because I believe it already is abstracted enough.
    I find REF CUROSOR most effective for such use, when the "begginer" has basic understanding of processing SQL result set .
    So in a nut shell, the techniques (that you already are familiar with) are the tools available. I am not aware of any alternative tools (in pure Oracle) that will simplify / hide basics from develpers.
    vr,
    Sudhakar B.

  • Generate Query in PLSQL to return Well Formed XML with Multiple records

    Hi there
    This is very urgent. I am trying to create a PLSQL query that should retrieve all records from oracle database table "tbl_Emp" in a well formed xml format. The format is given below
    *<Employees xmlns="http://App.Schemas.Employees" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">*
    *<Employee>*
    *<First_Name></First_Name>*
    *<Last_Name></Last_Name>*
    *</Employee>*
    *<Employee>*
    *<First_Name></First_Name>*
    *<Last_Name></Last_Name>*
    *</Employee>*
    *</Employees>*
    To retrieve data in above format, I have been trying to create a query for long time as below
    SELECT XMLElement("Employees",
    XMLAttributes('http://App.Schemas.Employees' AS "xmlns",
    *'http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi"),*
    XMLElement("Employee", XMLForest(First_Name, Last_Name)))
    AS "RESULT"
    FROM tbl_Emp;
    But it does not give me the required output. It creates <Employees> tag with each individual record which I don't need. I need <Employees> tag to be the root tag and <Employee> tag to repeat and wrap each individual record. Please help me in this as this is very urgent. Thanks.

    Hi,
    Please remember that nothing is "urgent" here, and repeating that it is will likely produce the opposite effect.
    If you need a quick answer, provide all necessary details in the first place :
    - db version
    - test case with sample data and DDL
    That being said, this one's easy, you have to aggregate using XMLAgg :
    SELECT XMLElement("Employees"
           , XMLAttributes(
               'http://App.Schemas.Employees' AS "xmlns"
             , 'http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi"
           , XMLAgg(
               XMLElement("Employee"
               , XMLForest(
                   e.first_name as "First_Name"
                 , e.last_name  as "Last_Name"
           ) AS "RESULT"
    FROM hr.employees e
    ;

  • Displaying graphical representation of data in hash tables as bar chart?

    I want to be able to display results in my hash table as a bar chart i don't know how to do it could someone help me I've looked through tutorials couldn't find any information that actually helped.
    In my program it doesnt allow matching the capital and small letters
    so for instance if I already have Mike it allows for me to input mike in again so there are 2 Mikes.
    I also want to do a simple user interface the tutorial for it is not simple to understand could any one tell me how to create a simple user interface like putting a button into a place wher i want it to be.
    im not asking anyone to do it for me i just want people to show me how to do it
    thank you
    Edited by: Tek_Hedef on Dec 1, 2007 4:30 AM

    Thanks for the ideas pal but I did have a go at it but my bit of code is making it crash but i removed it now so here's what I have so far
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class StudentDetails extends JFrame implements ActionListener
         private JTextField StudentNameTxt, StudentMarkTxt;
        private JButton DeleteStudentDetailsBtn, DisplayAllStudentsBtn, SearchStudentBtn, FailedStudentsBtn, PassedStudentsBtn, DistinctionStudentsBtn, AddStudentDetailsBtn, ExitBtn;
        private JPanel DisplayStudentDetailsPnl;
        private JLabel StudentNameLbl, StudentMarkLbl;
        private JTextArea DisplayResultsTxt;
        private Hashtable StudentDetailsTbl;
        private String StudentName, StudentMark;
        public static void main(String[] args)
            StudentDetails frame = new StudentDetails();
             frame.setSize(600,600);
            frame.createGUI();
            frame.setVisible(true);
        public void display(JPanel DisplayStudentDetailsPnl)
            Graphics paper = DisplayStudentDetailsPnl.getGraphics();
            paper.setColor(Color.white);
            paper.fillRect(0, 0, 500, 500);
            paper.setColor(new Color((int)(Math.random()*255),(int)(Math.random()*255),(int)(Math.random()*255) ));
        private void createGUI()
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            Container window = getContentPane();
            window.setLayout(new FlowLayout());
            StudentDetailsTbl = new Hashtable();
            StudentNameLbl = new JLabel("Student Name");
            window.add(StudentNameLbl);
            StudentNameTxt = new JTextField(15);
            window.add(StudentNameTxt);
            StudentMarkLbl = new JLabel("Student Mark");
            window.add(StudentMarkLbl);
            StudentMarkTxt = new JTextField(3);
            window.add(StudentMarkTxt);
            AddStudentDetailsBtn = new JButton("Add Student and Mark");
            window.add(AddStudentDetailsBtn);
            AddStudentDetailsBtn.addActionListener(this);
            DeleteStudentDetailsBtn = new JButton("Delete Student");
            window.add(DeleteStudentDetailsBtn);
            DeleteStudentDetailsBtn.addActionListener(this);
            DisplayAllStudentsBtn = new JButton("Display all Students and Marks");
            window.add(DisplayAllStudentsBtn);
            DisplayAllStudentsBtn.addActionListener(this);
            SearchStudentBtn = new JButton("Search Student");
            window.add(SearchStudentBtn);
            SearchStudentBtn.addActionListener(this);
            FailedStudentsBtn = new JButton("Students which Failed");
            window.add(FailedStudentsBtn);
            FailedStudentsBtn.addActionListener(this);
            PassedStudentsBtn = new JButton("Students which Passed");
            window.add(PassedStudentsBtn);
            PassedStudentsBtn.addActionListener(this);
            DistinctionStudentsBtn = new JButton("Students with Distinction");
            window.add(DistinctionStudentsBtn);
            DistinctionStudentsBtn.addActionListener(this);
            ExitBtn = new JButton("Exit");
            window.add(ExitBtn);
            ExitBtn.addActionListener(this);
            DisplayResultsTxt = new JTextArea();
            DisplayResultsTxt.setPreferredSize(new Dimension(200, 200));
            DisplayResultsTxt.setBackground(Color.white);
            window.add(DisplayResultsTxt);
            DisplayResultsTxt.enable(false);
        public void actionPerformed (ActionEvent e)
             if (e.getSource()== AddStudentDetailsBtn)
                  StudentName = StudentNameTxt.getText();
                   StudentMark = StudentMarkTxt.getText();
                  DisplayResultsTxt.setText("");
                  StudentDetailsTbl.put(StudentName, StudentMark);
                Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                String[] keys = (String[]) StudentDetailsTbl.keySet().toArray(new String[0]);       
                Arrays.sort(keys); 
                    for (String key : keys)
                         DisplayResultsTxt.append(key + " : " + StudentDetailsTbl.get(key)+ "\n");
                    StudentNameTxt.setText("");
                    StudentMarkTxt.setText("");
             if (e.getSource() == DeleteStudentDetailsBtn )
             if (StudentDetailsTbl.containsKey(StudentNameTxt.getText().trim()))
                  DisplayResultsTxt.setText("");     
                  String txt = StudentNameTxt.getText();
                Enumeration enumStudentName = StudentDetailsTbl.keys()  ;                   
                    String currentelement = (String)enumStudentName.nextElement();
                     StudentDetailsTbl.remove(txt);
                     DisplayResultsTxt.append(txt + " has been deleted");  
            if (e.getSource() == SearchStudentBtn)
            if (StudentDetailsTbl.containsKey(StudentNameTxt.getText().trim()))
                 String txt = StudentNameTxt.getText();
                 String result;
                 DisplayResultsTxt.setText("");
                 Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                   while (enumStudentName.hasMoreElements())
                        String currentelement = (String)enumStudentName.nextElement();
                    result = (StudentDetailsTbl.get(currentelement).toString());
                        if (txt.equals(currentelement))
                             DisplayResultsTxt.append(currentelement + " " + result);
                        else JOptionPane.showMessageDialog(null, "Student Name could not be identified");
            if (e.getSource() == DisplayAllStudentsBtn)
                  DisplayResultsTxt.setText("");
                 Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                while (enumStudentName.hasMoreElements())
                DisplayResultsTxt.append(enumStudentName.nextElement()+ " " + enumStudentMark.nextElement()+ "\n");
            if (e.getSource() == PassedStudentsBtn)
                 DisplayResultsTxt.setText("");
                 Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                while (enumStudentName.hasMoreElements())
                     int Mark = Integer.parseInt((String)enumStudentMark.nextElement());
                     String Name = (String)enumStudentName.nextElement();
                     if (Mark >=40)
                          DisplayResultsTxt.append(Name + " " + Mark + "\n");
            if (e.getSource() == FailedStudentsBtn)
                 DisplayResultsTxt.setText("");
                 Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                while (enumStudentName.hasMoreElements())
                     int Mark = Integer.parseInt((String)enumStudentMark.nextElement());
                     String Name = (String)enumStudentName.nextElement();
                     if (Mark <40)
                          DisplayResultsTxt.append(Name + " " + Mark + "\n");
            if (e.getSource() == DistinctionStudentsBtn)
                 DisplayResultsTxt.setText("");
                 Enumeration enumStudentName = StudentDetailsTbl.keys();
                Enumeration enumStudentMark = StudentDetailsTbl.elements();
                while (enumStudentName.hasMoreElements())
                     int Mark = Integer.parseInt((String)enumStudentMark.nextElement());
                     String Name = (String)enumStudentName.nextElement();
                     if (Mark >=75)
                          DisplayResultsTxt.append(Name + " " + Mark + "\n");
    }

  • Business Event not triggering the PLSQL procedure.. What to do?

    We need to call a plsql procedure when the GL Approval workflow has ended with approval. I thought i could do this by customizing the relevant business event.
    We are on EBS 12.1.3 with RDBMS : 11.2.0.3.0.
    I saw that the business event oracle.apps.gl.Journals.journal.approve was disabled currently. I enabled it and created a subscription for it. Subscription was a PLSQL procedure. Currently, for test purpose only thing it is doing is to insert a row into a table.
    Business Event Subscription settings:
    System: ORDEBS.SYSTEM.COM
    Triggering Event
    Source Type:Local
    Event Filter: oracle.apps.gl.Journals.journal.approve
    Execution Condition
    Phase: 100
    Status: Enabled
    Rule Data: Message
    Action Type:Custom
    On Error: Stop and Rollback
    Action
    PL/SQL Rule Function: XX_GL_APPROVE_BE_PKG.Get_Attributes
    Priority: Normal
    Documentation (Not sure what value to be given for these. I went with the below values.)
    Owner: Company Name
    Owner Tag: Custom Schema
    Using the below query i can see that the business event is getting called when the approval happens (One row added each time approval happened). But I cant see any rows in the table where it should insert a row. What could be going wrong? How can i verify that the procedure has been called?
    select * from WF_DEFERRED where corrid ='APPS:oracle.apps.gl.Journals.journal.approve'
    Procedure:
    CREATE OR REPLACE PACKAGE BODY APPS.XX_GL_APPROVE_BE_PKG
    AS
    PROCEDURE Get_Attributes
    IS
    BEGIN
    INSERT INTO xx.xx_test_table VALUES ('From BE');
    COMMIT;
    END Get_Attributes;
    END XX_GL_APPROVE_BE_PKG;

    Thanks Alejandro. Now this is working.
    Changes i made:
    1. Added the WFERROR workflow as a subscription to this event. So i could see that the function i am calling from the event did not have proper signature.
    2. Changed the function signature to have standard parameters like:
    CREATE OR REPLACE PACKAGE BODY XX_GL_APPROVE_BE_PKG
    AS
    function subscription(p_subscription_guid in raw,
    p_event in out nocopy wf_event_t) return varchar2 is
    l_result varchar2(20);
    begin
    insert into xxvtv.xxvtv_test_table values ('From BE');
    commit;
    exception
    when others then
    wf_core.context('XX_GL_APPROVE_BE_PKG','function subscription', p_event.getEventName(), p_event.getEventKey());
    wf_event.setErrorInfo(p_event, 'ERROR');
    return 'ERROR';
    end subscription;
    END XX_GL_APPROVE_BE_PKG;
    3. Changed the owner name and owner tag both to the custom schema name (XX)

  • How about use partial key to loop at a hashed table?

    Such as I want to loop a Internal table of BSID according to BKPF.
    data itab_bsid type hashed table of BSID with unique key bukrs belnr gjahr buzid.
    Loop at itab_bsid where bukrs = wa_bkpf-bukrs
                              and    belnr  = wa_bkpf-belnr
                              and    gjahr  = wa_bkpf-gjahr.
    endloop.
    I know if you use all key to access this hashed table ,it is certainly quick, and my question is when i use partial key of this internal hashed table to loop it, how about its performance.
    Another question is in this case(BSID have many many record) , Sorted table and Hashed table , Which is better in performance.

    You can't cast b/w data reference which l_tax is and object reference which l_o_tax_code is.
    osref is a generic object type and you store a reference to some object in it, right? So the question is: what kind of object you store there? Please note - this must be an object reference , not data reference .
    i.e
    "here goes some class
    class zcl_spfli definition.
    endclass.
    class zcl_spfli implementation.
    endclass.
    "here is an OBJECT REFERENCE for it, (so I refer to a class) i.e persistent object to table SPFLI
    data oref_spfli type ref to zcl_spfli.
    "but here I have a DATA REFERENCE (so I refer to some data object) i.e DDIC structure SPFLI
    data dref_spfli type ref to spfli.
    So my OSREF can hold only oref_spfli but it not intended for dref_spfli . That's why you get this syntax error. Once you have stored reference to zcl_spfli in osref then you will be able to dereference it and access this object's attributes.
    data: osref type osref.
    create object osref_spfli.
    osref = osref_spfli.
    "now osref holds reference to object, you can deference it
    oref_spfli ?= osref.
    osref_spfli->some_attribute = ....
    OSREFTAB is just a table whose line is of type OSREF (so can hold multiple object references - one in each line).
    Regards
    Marcin

Maybe you are looking for