Procedures needed

Gurus,
Need your help on this one.
There are 2 tables one used by application and other used by database.Structures is given inthe script
create table table_1_appln (reqd_session number(10),file_name varchar2(32767))
create table table_2_act (reqd_session number(10),file_name varchar2(32767))
Session Id File_Name
1111 1234~2345~3456~4567
22222 2345~3456~5678~67897545~6546878921~4874654314
33333 3456213~46768765~465486541~15799399333~976646249633~4657981
I need 2 procedures
i)One will insert the delimitized file names into main data base as is given below :
Session Id File_Name
1111 1234
1111 2345
1111 3456
1111 4567
22222 2345
22222 3456
22222 5678
22222 67897545
22222 6546878921
22222 4874654314
33333 3456213
33333 46768765
33333 465486541
33333 15799399333
33333 976646249633
33333 4657981
ii)One which will output the filenames for a session id to the application.
Session Id File_Name
1111 1234~2345~3456~4567
22222 2345~3456~5678~67897545~6546878921~4874654314
33333 3456213~46768765~465486541~15799399333~976646249633~4657981
Things to take care while creating procedures is
1)Length of filename can exceed the normal maximum capacity of varchar2 datatype i.e 32767.
If it does , then for the second procedure while the file name is outputted start populating second out variable.

You created a nice setup for us:
SQL> create table table_1_appln (reqd_session number(10),file_name varchar2(32767))
  2  /
create table table_1_appln (reqd_session number(10),file_name varchar2(32767))
FOUT in regel 1:
.ORA-00910: Opgegeven lengte is te groot voor zijn gegevenstype.
SQL> create table table_2_act (reqd_session number(10),file_name varchar2(32767))
  2  /
create table table_2_act (reqd_session number(10),file_name varchar2(32767))
FOUT in regel 1:
.ORA-00910: Opgegeven lengte is te groot voor zijn gegevenstype.What is your problem with the second question/statement?
And most importantly, what have you tried yourself and where did you get stuck?
Regards,
Rob.

Similar Messages

  • * * Procedure needs a way to  perform  update, insert or delete to...

    Hi Gurus,
    I got Assignment & need your help how to write this procedure efficiently.
    ** The procedure needs a way to actually perform the update, insert or delete to bring the reference data up-to-date with the refresh table.**These columns are for internal use and should not be compared to the refresh tables.
    Column 1
    Column 4
    Column 5
    Column 7
    Column 9
    Column 12
    Column 22
    Column 24
    1)     I would list out the columns in the cursors in place of the *. Or better define a record with %ROWTYPE.
    2)     You will need to include a way to look for rows that may be in one table and not the other.
    a.     Insert the rows that exist in the refresh table, but are missing from the reference table.
    b.     Delete the rows that are found in the reference table, but do not appear in the refresh table.
    3)     You also need to provide for handling the expiration date. Our default expiration date is ‘01-JAN-2500’, meaning if the refresh table has a futuristic expiration date or null, then our default expiration date is considered valid. Also this date needs to be added to any new rows created as a result of the refresh, if you leave the EXPIRATION_DATE column out of the insert it should default to the above date.
    4)     I assume that Differences is where you plan to list the actual data values that differ. If you don’t list the whole row I would at least list the primary key, in addition to what columns are different.
    5)     The procedure needs a way to actually perform the update, insert or delete to bring the reference data up-to-date with the refresh table.
    Thanks in advance

    Hi,
    Take a look at merge
    http://www.psoug.org/reference/merge.html
    Keep Smiling
    Bob R

  • Row Fetch on View doesn't work / Custom procedure needed???

    Hello guys!
    Again I have a problem. It seems like once I finish one problem I stumble into another one. :-(
    Would is breaking my neck is the following problem.
    I have a view based on a query that joins 3 tables including one via a database-link. I would like and need to use that view as the source for the automatic row fetch! However, when creating the automatic-fetch-row process, the items on my page do not get populated. However, If I change the cource for the fetch-row-process to a view made of only a single table it works like a charm. Could it be that the automatic fetch-row procedure doesn't work with joined views and db-links at all??? If so, could you please give me an example of a PL/SQL procedure that will populate items on page reload and load!
    It's extremely urgent and I appreciate every input!
    Thanks guys! I hope you some ideas and hints!
    Regards,
    Sebastian

    Ah, ok - I probably read too much into your update (still thinking that it was related to the "view" issue in your first post :) ) - so an INSTEAD OF trigger won't be needed if this is just a single table!
    There are a few ways that adding an extra column into a tabular form would stop it being updated. Typically, this could be if the new column forms part of the "Primary key" for the data. If this is the case, you need to ensure that the processes recognise this. It can also be that you have set the item to DISABLED or READONLY - these items are not submitted with the page, so even if you set the item's value somehow, that will never get back into the record (there are ways to take off the DISABLED or READONLY attributes immediately prior to the submit, if need be). That could also happen if you have set the item to be a Standard Report Column - this is just displayed text, so doesn't form part of the submitted data. You can get around that by having a hidden column with the actual data in there as well - if you have ever created a tabular form using the simple EMP table example, you'll see EMPNO and EMPNO_DISPLAY - both contain EMPNO but only the basic EMPNO hidden item is submitted. Another, perhaps rare, possibility is if you have used the APEX_ITEM package to create any of the output and have used an index number that has been automatically assigned to another column - for example, if you have APEX_ITEM.TEXT(1, ....), which gives each item a name value of "f01", then this is most likely going to double up with the index for the hidden primary key item (which is usually first in the list). If this is the case, just change the index of your APEX_ITEM item to some high number (anything up to 50).
    Finally, you say "INV_PT_ID_SUB is also bound to an item PTIDS" - what is PTIDS? The MRU processes need to understand what column to update and relies on the settings for primary keys and the column names in the SQL query.
    The MRU's only know about their own settings - the workspace, tablename and primary keys etc. They contain no details of individual columns as such, so adding in extra columns shouldn't be a problem. In fact, I've added/deleted so many columns from tabular forms, that I'd be really annoyed if I had to start from scratch every time!!
    Andy

  • Cracking the procedure-Need Feedback!

    Hellow everyone...this is my Q, i got basic code put together, need some help to complete the following procedure(i'm working on my programming skills with pl-sql) kindly guide me...if i'm wrong !
    write a function/procedure that will take a year parameter(e.g 2007)
    and will go through all AP Invoices (with invoice_date falling within that year)
    for the Vision Services organization (org_id=458) and output all
    project numbers that are associated with any of these invoices.
    Also output the count of project related invoices and a count of non-project related invoices
    ----basic information of columns and tables necessary to write procedure--
    SELECT ppa.segment1 project_numbers
    FROM pa_projects ppa
    ,ap_invoices_all api
    WHERE api.org_id='458'
    AND invoice_date BETWEEN '01-JAN-2007' AND '31-DEC-2007'
    AND api.project_id = ppa.project_id
    -----My procedure- (It has to be corrected--)--will appreciate some feedback
    create or replace procedure year_parameter (p_year in varchar2,
    p_out out number)
    as
    v_year varchar2(10);
    v_out number ;
    cursor c1(p_year in varchar2) is
    select project_id,invoice_date
    from ap_invoices_all api
    where api.org_id='458'
    and substr(invoice_date,7,10):= p_year;
    --and to_char(invoice_date,'YYYY')='2007';
    BEGIN
    c_rec is c1%rowtype;
    for c_rec in c1
    loop
    select pa.segment1 into v_out
    from pa_projects pa
    where pa.project_id=c_rec.project_id;
    dbms_output.put_line(v_out);
    end loop;
    END;

    This is already your 3rd post abaout this "procedure thing"
    Need help with this procedure!
    Re: Need help with this procedure!
    OK, just a few comments:
    - use the data type of the values and do not let them implicitly convert
    - what means "outputting" inside a procedure as a procedure normally runs on the database server with no terminal connected?
    - if invoice_date is an Oracle date data type then the line
    AND invoice_date BETWEEN '01-JAN-2007' AND '31-DEC-2007'is just plain wrong as it is only working by accident. Ther correct condition would be
    AND invoice_date BETWEEN to_date('01-JAN-2007', 'dd-mon-yyyy') AND to_date('31-DEC-2007', 'dd-mon-yyyy')- if org_id is of type number why you compare it to the string '458'? Compare it against the number 458
    - for me, the year 2007 is either a date or a number but not a string. So the parameter should be defined as date or number resp.
    As I can not really figure out what you want to achieve with this procedure it is hard to comment.

  • !! Test procedure needed to determine if MLB replacement is warranted.

    Hi!
    I was hoping someone could point me to a post around here that lays out a nice test procedure I can follow to determine if I really do need a new logic board.
    I've got CoreDuoTemp, and it usually sits around 45 - 50 C. I'm on a replacement battery, and it's charging to 3 - 3.5 hours, depending on what I'm doing.
    I definately have the whine on battery power (none on A/C). It goes away if the camera is turned on, comes right back if I shut the camera off. Luckily, I only hear the whine if I'm in a quiet room. Unfortunately that's the worse time to hear it, because I'm usually trying to concentrate!
    Other than that, I'm very happy with the MBP, and am a little hesitant to take it down to the Apple store (I'm worried I could end up getting back a MBP with more problems than this one).

    Hi!
    I was hoping someone could point me to a post around
    here that lays out a nice test procedure I can follow
    to determine if I really do need a new logic board.
    I've got CoreDuoTemp, and it usually sits around 45 -
    50 C. I'm on a replacement battery, and it's
    charging to 3 - 3.5 hours, depending on what I'm
    doing.
    I definately have the whine on battery power (none on
    A/C). It goes away if the camera is turned on, comes
    right back if I shut the camera off. Luckily, I only
    hear the whine if I'm in a quiet room. Unfortunately
    that's the worse time to hear it, because I'm usually
    trying to concentrate!
    Other than that, I'm very happy with the MBP, and am
    a little hesitant to take it down to the Apple store
    (I'm worried I could end up getting back a MBP with
    more problems than this one).
    Supposedly some serial numbers are already flagged to receive a new logic board, so go in, have them scan the S/N and see if you're eligible.
    Unfortunately, if not, it'll be a hard bargain to just "get" someone to replace your Logic Board for no good reason. The part's about $1,000. You can bring up your points, but I'm not sure that any of them will convince a genius that you need a new logic board.
    Though, if you complain about the heat, one of their first steps is typically to replace the fans, and the logic board. You never know.
    So go in and see if you're eligible... or even save yourself a trip and call the store itself to see if they can do a lookup.

  • Consolidation Configuration - Steps / Procedures Needed

    Gurus,
    I have tried searching the internet and stuff. I need to understand the business process followed in consolidation in SAP.
    Can anybody elaborate the simplest steps for consolidation..?
    Where can I look for configuration procedures. Link requested.
    Thanks.
    Moderator: Please, read and respect SDN rules

    Hello,
    Please find some time to search in this forum for your requirement. You can find all of your list except intecompany third party order.
    Prase

  • J2EE testing procedures; need some help

    Hi, Iam working on compiling some key items and write a small document on J2EE's best practices on Testing Procedures. This document may contain anywhere from basic to few complex testing procedures.
    Iam not that familiar at the moment (i have very little experience doing J2EE testing) and iam trying to learn (through this document) about J2EE testing procedures and guidelines.
    So, can somebody please give me some references or some ideas ?
    Thanks a ton for all your help.

    Hi, Iam working on compiling some key items and
    write a small document on J2EE's best practices on
    Testing Procedures. This document may contain
    anywhere from basic to few complex testing
    procedures. Sounds like your boss gave you an assignment that you're not up for. Have you ever done any testing? If not, how can you write about best practices?
    I am not that familiar at the moment (i have very
    little experience doing J2EE testing) and iam trying
    to learn (through this document) about J2EE testing
    procedures and guidelines.Do you have experience with Java EE? How do you test your stuff when you write it?
    So, can somebody please give me some references or some ideas ?
    Thanks a ton for all your help.Tell your boss I want the raise you get from my ideas.
    Start with unit testing classes as you write them. Test Driven Development, when done properly, will be a big help. Look at TestNG and JUnit.
    Mock objects can help here. If you've already tested your persistence layer, there's no need to worry about it for your service layer tests. Look at EasyMock.
    Next is integration or business acceptance testing - combinations of classes and packages, front to back, entire use cases. You need to include the UI here. I'm looking at ThoughtWorks' Selenium and its IDE. It even pumps out Java code for you now. Very nice.
    Stress testing is next. You'll need something that can simulate many users hitting the app at once. JMeter might help.
    You have to worry about setting up test data in databases. It's got to stable while you're testing. It won't do to have tests break simply because data was changed. DbUnit might help.
    Most of all, don't do all your testing at the end in one "big bang".
    %

  • Stored DB Procedure - Need help

    Hi. I have a stored database package containing 2 functions. I need help with the function named ret_columns.
    If you look at the code below you will see this function has two different FOR loops. The Select statement in FOR loop that is commented out works just fine, but when I try to use the uncommented select statement in it's place the Function returns NULL (or no records). However, if I run the Select statement in plain old SQL Plus it returns the rows I need. I don't get it.
    Can anyone help me? I'm really stuck on this one.
    -- PACKAGE BODY
    CREATE OR REPLACE package body audit_table_info
    as
    function ret_tables return table_type is
    t_t table_type;
    i integer;
    begin
    i := 1;
    for rec in (select distinct table_name
    from all_triggers
                   where substr(trigger_name,1,9) = upper('tr_audit#')) loop
    t_t(i).tableA := rec.table_name;
    i := i+1;
    end loop;
    return t_t;
    end;
    function ret_columns return column_type is
    c_t column_type;
    i integer;
    begin
    i := 1;
    -- for rec in (select distinct table_name column_name
    -- from all_triggers
    --               where substr(trigger_name,1,9) = upper('tr_audit#')) loop
    for rec in (select distinct b.column_name column_name
    from all_triggers a, all_tab_columns b
                   where a.table_owner = b.owner
                        and a.table_name = b.table_name
                             and substr(a.trigger_name,1,9) = upper('tr_audit#') and rownum < 5) loop                    
    c_t(i).tableB := rec.column_name;
    i := i+1;
    end loop;
    return c_t;
    end;
    end audit_table_info;
    -- PACKAGE DEFINITION
    CREATE OR REPLACE package Audit_Table_Info as
    type table_rec is record( tableA all_tab_columns.TABLE_NAME%type);
    type table_type is table of table_rec index by binary_integer;
    function ret_tables return table_type;
    type column_rec is record( tableB all_tables.TABLE_NAME%type);
    type column_type is table of column_rec index by binary_integer;
    function ret_columns return column_type;
    end Audit_Table_Info;
    /

    It works when I do this!!! I'm so confused.
    Ok...so I did this:
    1 create table test_columns as
    2 (select b.column_name
    3 from all_triggers a,
    4 all_tab_columns b
    5 where a.table_owner = b.owner
    6 and a.table_name = b.table_name
    7 and substr(a.trigger_name,1,9) = upper('tr_audit#')
    8* and rownum < 5)
    SQL> /
    Table created.
    Then altered the Function so the Select statement refers to this table:
    function ret_columns return column_type is
    c_t column_type;
    i integer;
    begin
    i := 1;
    for rec in (select distinct column_name
    from test_columns) loop
    c_t(i).tableB := rec.column_name;
    i := i+1;
    end loop;
    return c_t;
    end;
    Again, any help would be greatly greatly appreciated!

  • Procedure needed 4 changing the sequence order

    For example, there are ten employees. The first employee’s id will be 1. The second employee says his id he wants to be 14. For the third employee, the employee id should come in sequence, i.e it should assign 2 by default, if he have not requested an id. Again when the fourth employee comes, he will request for number 4. When fifth employee comes, he will be assigned number 3, when he has not requested of his choice. When sixth employee comes, number 5 should be assigned, since number 4 is already in use.
    So how can I write a Procedure for this?

    this example might be of help.
      -- assuming that you have this in your procedure:
      -- pEmpId Number        => for Employee ID
      -- vEmpId Number        => place holder for employee id
      -- vCtr   Number        => counter for checking rows
      -- emp_seq_no           => sequence for employee
      -- employee does not request for an Id
      If pEmpId Is Null Then
        Loop
          Select emp_seq_no.nextval
            Into vEmpId
            From dual;
          --check if existing on the table
          Select empid
            Into vCtr1
            From employee
           Where empid = vEmpId; 
          If vEmpId <> vCtr1 Then
            exit;
          End If
        End Loop;
      Else
        -- employee requested for an Id
        Select Count(*)
          Into vCtr1
          From employee
         Where empid = vEmpId; 
        -- check if existing on the table
        If vCtr1 > 0 Then
          -- code goes here on what do you want to do when
          -- the requested id exists
        End If;
      End If;note: this code has not been tested.

  • Procedure needed to input table name

    i want a procedure where i would enter the table name and an attribute as input parameters.
    The procedure will find whether the entered attribute is primary key or not
    Please help me

    Hi,
    Try this :
    SQL> create table test (col1 number primary key, col2 number);
    Table created.
    SQL> create or replace function is_pk (tb_name varchar2, col_name varchar2)
    return varchar2 is
    var_is_pk varchar2(5);
    begin
    begin
    select 'PK'
    into    var_is_pk
    from   user_cons_columns a, user_constraints b
    where  a.OWNER=b.OWNER
    and   a.CONSTRAINT_NAME=b.CONSTRAINT_NAME
    and   a.TABLE_NAME=b.TABLE_NAME
    and   a.TABLE_NAME=upper(tb_name)
    and   a.COLUMN_NAME=upper(col_name)
    and   b.constraint_type='P';
    exception when others then var_is_pk:='NO_PK';
    end;
    return var_is_pk;
    end;
    Function created.
    SQL> select is_pk('test','col1'), is_pk('test','col2') from dual;
    IS_PK('TEST','COL1')  IS_PK('TEST','COL2')
    PK                             NO_PKHTH,
    Nicolas.
    I'm sorry Maarten, my network is catastrophic this morning... so I didn't see your post before post mine.
    Message was edited by:
    N. Gasparotto

  • SAP 4.6c installation procedure needed

    Hi everybody,
    this is the first time i've posted on the forum. Could someone please provide me with the installation procedure of SAP. I have a AMD 3000+ system with 512 mb RAM and 80GB hard drive on a windows xp and windows 2000 dual boot platform. I really would appreciate the help.

    Hello Friends!
         I am Kishore, new to sap and am interested in learing Sap Basis. Can any one send me a step by step installation guide for installing sap 4.6c and 4.7.
         Also i would like to know the min. requirements for the above installation as i am not having a high end system.
    My email is :[email protected] I would be very greatful, if any one can send the same.
    Thank u
    Kishore

  • Electrinic Bank Statement - Upload procedure needed

    Hi,
    Our client is having bank statement in MT940 format.We need to upload their bank statements into SAP R/3 and want to avoid manual posting.
    Can any one tell us which transactions/programs should be run for this upload.
    Also please let us know whether we have to convert client’s Mt940 file to Multicash format & then upload.We need the MT 940 transaction fields details which need to be mapped.
    Please give us the file formats also if any.
    Please try to give us the solution in steps,if possible.
    Thanks & Regards,
    Seshagiri.M.

    okay, thanks! Now I feel much better
    Answers to your questions:
    (1) You <b>will</b> need the file from the Bank eventually....so follow it up with them....go to the bank yourself and talk to them (but don't send a Peon....haa haa!) Remember, if you don't get a test file from them you can't do nothing.
    (2) Yes - if the file format from the bank is supported by SAP. Note: its not clien't file...its client's bank file. The file comes from the bank to your client. Think of this whole process like your personal bank sending you a statement at the end of the month for all your incomes and expenses during the month.
    Again, depending on the bank's format you'll have to decide if you need to prepare (i.e. change the format) the file at your end.
    (3) Yes, format will depend on what format the bank is sending the file....so accordingly you have to select the format on selection screen.
    You can select Multicash if bank is sending you the file in Multicash format, otherwise not.
    (4) For test mode select radiobutton 'Do not Import/Post' ....for live mode, select 'Import/Post' radio...also select all checkboxes at the end of the selection screen except the last one as far as I remember....do let me know the descriptions of the checkboxes.
    Hope this helps!

  • Procedure needs for install sap4.7 -oracle 8.2 in linux AS-4 machine.

    Hi friends,
      I am new for linux environment, I have all data cd’s to install
    Sap 4.7, Oracle 8.2 in linux machine.  Any one can help to install sap 4.7
    In my linux AS-4 machine.
       Please provide procedure doc or LINK.
    Thanks & Regards,
    Satish

    Dear Satish,
    please check:
    SAP note: <a href="https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=722273">722273</a>: Red Hat Enterprise Linux 3 and 4: Installation and upgrade
    and
    SAP Service Marketplace Installation Guides: <a href="https://service.sap.com/instguides">https://service.sap.com/instguides</a>
    Thanks,
      Hannes

  • Automator and Microsoft Office 2008 - step by step procedure needed

    When I right-click on the desktop, I would like to have commands listed like:
    - New Microsoft Word document
    - New Microsoft Excel document
    - New RTF document
    After selecting the option, I'd like to be given the option to name the file. After the file is created, I want to be able to double-click it no different than any other file and the associated application open up.
    I've been told that this could be done through Automator though I don't know how to set it up, I need a step by step instruction. Would anybody be able to point me in the direction to get this setup?
    I used to use a utility called NuFile though it hasn't been maintained for some time and the right-click options no longer work with Snow Leopard.

    No. I've heard that complained about in the past, also. I was trying to stack everything up and pass to my applescript action as a multi-item list. It would be nice to see an action that would take a stacked set of input to use as Filename, source, destination. Just have a "take from input" option instead of the default asking--even 'use variable' would be nice. I was trying to use Applescript for most of that heavy lifting, but can't get past the issue I posted above.
    Trying to combine the two functions of (no input or destination folder) did not work as you can only have one--If you select no input, clicking on a folder doesn't provide the Service, and if you select folders, the Service doesn't show in the Services menu if you actually don't have input.
    I think the way to go would be a straight Applescript action that looks at the Finder Selection. If it is empty or the selection is not a folder, then use the front Finder Window as the destination and if it has a value, use that folder as destination. As stated, there is no way to make this work as a service unless you create two separate services for each document type.
    Perhaps putting each applescript in the Finder Toolbar would be sufficient for the OP? Not quite a contextual menu, but as close as I think we can get.

  • Installation procedure needed

    Hi Friends,
    Can any one give installation procedure for
    SAP 4.7/ORACLE/NT
    Thanks & Regards
    Satish

    Hi Satish
    The following are the links where you will get enogh info
    http://www.help.sap.com
    http://www.service.sap.com
    http://www.sdn.sap.com
    http://www.sapinfo.net
    http://www.sapinsider.com
    Hope this helps you
    Regards,
    RK

Maybe you are looking for

  • Multiple row data in a single row

    I have a table like the following: AGREEMENT_ID SERVICE_CODE SERIAL_NO 22     CV     CE095F0011007884F 22     HS     2509b000121373869 22     NG     2509B000121265554 22     SG     2509B00012120278D 22     SM     PAFABM0716140704 22     SN     G32X2M

  • How can i change my background color in "albums" mode back to black in iTunes 11

    how can i change my background color in albums mode back to black in iTunes 11?

  • Reg : Cross browser issue while handling LOV event on KeyFlexFeild

    Hi OA Gurus, We are encountering issues on R12.0.6, JDev 120Rup6. We have the following test case and code changes. Requirement: We have OA page where we have one KeyFlexFeild item and a normal LOV. Page items are part of one AM and LOV is in another

  • When I try to run, I has an error in the server.

    starting weblogic with Java version: java version "1.6.0_05" Java(TM) SE Runtime Environment (build 1.6.0_05-b13) Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode) Starting WLS with line: C:\Oracle\MIDDLE~1\JDK160~1\bin\java -client -Xms256m -X

  • BT Broadband - Red Flashing Light on Home Hub and ...

    (Posting on behalf of a friend).  Good morning, Having recently got a the latest home hub (recieved as part of upgrade to broadband package) I currently do not have a working broadband connection. Have been unable to get BT on the phone so posting he