Combining SQL scripts

I have about 15 sql scripts that calculate/count total based on different conditions that are drawn from a report that needs to be exported. The scripts represent expressions that are calculated in a Crystal Report. Since each script calculates a single
column, I basically need to have the output of each script put into a table that I can export into Excel or text file for external use. I can run each script separably and combine later but want to automate it. So, script A will populate column A, script B
will populate column B, ect until all columns are populated. See below:
When the script is run all columns have values (A to E) I have also added a sample of one of the scripts that populates a column below this example.
BranchNo
Trip
A
B
C
D
E
21
7
9724
22
7
12668
23
7
12151
25
7
6036
26
7
7895
30
7
12630
31
7
7931
32
7
13831
40
7
11959
42
7
10663
43
7
18010
45
7
7552
47
7
11978
51
7
6757
52
7
12417
54
7
13071
61
7
163
63
7
8603
65
7
5743
66
7
5117
67
7
16405
68
7
10748
70
7
5301
/***** This script generates the ASSIGNED column. */
Select ws.P4DistrictNumber as BranchNo, ws.Cycle as Trip, COUNT(DISTINCT msi.MeterSessionInputKey) as Assigned
from fcs.dbo.WorkSet as ws
left outer join fcs.dbo.Work as w
on ws.WorkSetKey = w.WorkSetKey
left outer join fcs.dbo.Customer as c
on w.WorkKey = c.WorkKey
left outer join fcs.dbo.WorkAssignment as wa
on ws.WorkSetID = wa.WorkSetID
left outer join fcs.dbo.meter as m
on c.CustomerKey = m.CustomerKey
left outer join fcs.dbo.CustomDatafield as cdf
on c.CustomerKey = cdf.CustomerKey
left outer join fcs.dbo.CustomDataField as cdfl
on m.MeterKey = cdfl.MeterKey
left outer join fcs.dbo.MeterSessionInput as msi
on m.MeterKey = msi.MeterKey
left outer join fcs.dbo.MeterSessionOutput as mso
on msi.MeterSessionInputKey = mso.MeterSessionInputKey
where
ws.StartDateTime IS NOT NULL and
wa.RetiredFlag = 0 and
wa.LoadStatusIndicator NOT IN (0, 4) and
msi.P4UtilityTypeReadIndicator != 'F' and
case
        when
            cast(wa.startdatetime as date) <= cast(ws.scheduledreaddate as date) and
            wa.workfiltername not in ('DNRs','Type 2s/3s') or
            ((ws.worksetid %100 < 50 and
            substring(ws.worksetid, len(ws.worksetid) - 3, 1) = 0))
        then 1
            End = 1 and
ws.Cycle = 7
group by ws.P4DistrictNumber, ws.Cycle
order by ws.P4DistrictNumber

Rob 
And what is the question?  In order to import the data into EXCEL the best choose is SSIS (packages).
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • SQL script based on hostname and database name?

    I am trying to write a script that I can run on several unix servers and databases that will do different sql statements based on which server and database it is being run in.
    Something like:
    if hostname = 'A' and database name = 'D' then do this
    else if hostname = 'B' and database name = 'F' then do that
    I have tried many diifferent combinations of shell scripts and sql scripts but can't seem to get anything that works.
    Can someone help me out? Thanks.

    Since you are already able to get he db and host info, you are well on your way to branching based on that information. All you need is the basic framework:
    declare
      db VARCHAR2(30);
      host VARCHAR2(30);
      sqlcmd VARCHAR2(4000);
    begin
      select sys_context('userenv','host') host
           , sys_context('userenv','db_name') db_name
        into host
           , db
        from dual;
      case
        when db = 'XE' and host = 'mypc' then
          sqlcmd := q'[local_package.do_something('parm1', :db, :host)]';
          execute IMMEDIATE sqlcmd USING db, host;
        when db = 'DEV' and host in ('serv1','serv2') then
          sqlcmd := q'[different_packge.do_something('parm1', :db, :host)]';
          execute IMMEDIATE sqlcmd USING db, host;
        else
          dbms_output.put_line('unrecognized db/host combination: '||db||', '||host);
      end case;
    end;
    /In this example I've used dynamic SQL since not all instances are guaranteed to have any or all of the package procedures referenced in the dynamic sql. With out the dynamic sql, you would get errors and be unable to run the script on any instance lacking one or more of the reference package procedures..

  • Wwv_flow_item.popupkey_from_query in combination  SQL updateable report

    Hi,
    I found out that wwv_flow_item.popupkey_from_query in combination 'SQL updateable report' does not work. It does not display the popup. It creates a extra column with the message below.
    In combination with 'SQL query' it works. Is it possible to make it work in combination with updatable reports? If so can you tell me how?
    Thanks in advance,
    Patrick
    Message:
    <NOSCRIPT>JavaScript not supported</NOSCRIPT><SCRIPT LANGUAGE="JavaScript1.1"> <!-- Comment out script for old browsersfunction genList0_f05_0() {           w = open("wwv_flow_utilities.gen_popup_list" +                       "?p_filter="  +                       "&p_name=" + escape('f05') +                       "&p_element_index=" +  escape ('0') +                       "&p_hidden_elem_name=" + escape('f04') +                       "&p_form_index=" + escape('0') +                       "&p_max_elements=" + escape('') +                       "&p_escape_html=" + escape('') +                       "&p_ok_to_query=" + escape('YES') +                       "&p_flow_id=" + escape('2648') +                       "&p_page_id=" + escape('8') +                       "&p_session_id=" + escape('276014029277327813') +                       "&p_eval_value=" + escape('') +                       "&p_return_key=YES" +                       "&p_translation=" + escape('NO') +                       "&p_lov=select+short_name,+id+from+rio_reps",                       "winLov",                       "Scrollbars=1,resizable=1,width=400,height=450");           if (w.opener == null)             w.opener = self;           w.focus();         }//--> </SCRIPT><div nowrap><INPUT TYPE="hidden" NAME="f04" VALUE="" id="0" ><INPUT TYPE="hidden" NAME="p_arg_names" VALUE="0"><INPUT TYPE="text" NAME="f05" id="0" disabled onfocus="this.blur()" ><IMG SRC="/i/list.gif" alt="LIST" border="0" align=bottom></div>

    you're seeing that error because those project marvel updatable report regions expect a regular query that they then turn into an updatable report for you at runtime. you're kind of confusing things when you try to provide it with your own calls to wwv_flow_item in there. the way to really take control of the way your updatable report will render is to code it as a regular report region in which you make your own wwv_flow_item calls. an easy way to generate that region code would be to step through our updatable report wizard and let marvel do it for you. the first screen of that updatable report wizard presents you with the option of having the flow builder "Use flows built in updatable query page process" or "Generate PL/SQL logic directly into page process". if you use this second option, your resulting query will have those calls to the wwv_flow_item package in it. so let's say you step through the wizard to generate an updatable report for the SCOTT.EMP table. you'd probably get something like this...
    select
    wwv_flow_item.hidden(1,EMPNO)||
    wwv_flow_item.text(2,EMPNO) EMPNO,
    wwv_flow_item.text(3,ENAME) ENAME,
    wwv_flow_item.text(4,JOB) JOB,
    wwv_flow_item.text(5,MGR) MGR,
    wwv_flow_item.text(6,HIREDATE) HIREDATE,
    wwv_flow_item.text(7,SAL) SAL,
    wwv_flow_item.text(8,COMM) COMM,
    wwv_flow_item.text(9,DEPTNO) DEPTNO
    from #OWNER#.EMP
    ...as your query in that report region. you could then tweak your wwv_flow_item calls to generate other item types like so...
    select
    wwv_flow_item.hidden(1,EMPNO)||
    wwv_flow_item.text(2,EMPNO) EMPNO,
    wwv_flow_item.text(3,ENAME) ENAME,
    wwv_flow_item.textarea(4,job) JOB,
    wwv_flow_item.text(5,MGR) MGR,
    wwv_flow_item.date_popup(4, null,HIREDATE) HIREDATE,
    wwv_flow_item.text(7,SAL) SAL,
    wwv_flow_item.text(8,COMM) COMM,
    wwv_flow_item.popupkey_from_query (1,deptno,'select dname, deptno from dept') DEPTNO
    from #OWNER#.EMP
    ...so now you'd have the an updatable report that used a date picker, a text area, and a popup key LOV as opposed to the one with straight text areas that was generated by default. take a look at the docs for the wwv_flow_item api at http://marvel.oracle.com/pls/otn/f?p=4200:58 to see just how much control you'd have.
    hope this helps,
    raj

  • Calling sql script from shell script

    Hi,
    I know this question has been asked many time in various forums, but I tried many combinations and not able to figure out what I'm missing.
    Basically - I'm trying to call a sql script from a shell script.
    This is my sql script (plsql.sql) -
    DELCARE
    v_empno NUMBER := '&empno';
    BEGIN
    select ename,sal from emp where empno = v_empno;
    dbms_output.put_line('Inside the plsql file');
    END;
    This is my unix shell script - I'm caling the plsql.sql file with the parameter passed(97882). I don't get any output. at least I should be able to view the dbms output if not for the sql query inside the sql script.
    #!/usr/bin/ksh
    sqlplus -s sam/olo01 << HERE
    @plsql.sql 97882;
    HERE
    What is it I am missing ?

    Using your scripts (and having to create and populate a table myself, that would have what your select statement implies),
    oracle:oklacity$ cat plsql.sql
    DELCARE
    v_empno NUMBER := '&empno';
    BEGIN
    select ename,sal from emp where empno = v_empno;
    dbms_output.put_line('Inside the plsql file');
    END;
    oracle:oklacity$ cat doit.sh
    #!/usr/bin/ksh
    sqlplus -s sam/olo01 << HERE
    @plsql.sql 97882;
    HERE
    oracle:oklacity$ ./doit.sh
    SP2-0042: unknown command "DELCARE" - rest of line ignored.
    SP2-0734: unknown command beginning "v_empno NU..." - rest of line ignored.
    oracle:oklacity$
    This is the kind of information you should have put in your opening post.

  • Executing a bunch of .SQL scripts in a folder  ???

    hi ,
    I have 60+ sql scripts in a folder X..Is there any way to execute these scripts in one go..??
    I am searching for a shortcut to execute these scripts using SQL PLUS Scripting (any possible way) ..
    Can anyone give some light to solve my issue??
    Regards,
    john

    jpy wrote:
    hi ,
    I have 60+ sql scripts in a folder X..Is there any way to execute these scripts in one go..??
    I am searching for a shortcut to execute these scripts using SQL PLUS Scripting (any possible way) ..
    Can anyone give some light to solve my issue??
    Regards,
    johnls -1 *sql > combined.sql
    edit combined.sql and add "@" as first character of every lines
    sqlplus scott/tiger @combined.sql

  • Running 2 API's in 1 sql script or seperately?

    hello.
    Running 2 API's in 1 script or seperately?
    I'm setting up a process of importing employee records into per_all_people_f table via 2 API's (create_gb_employee & create_person_address) but I'm running into problems. This is making me wonder is this the right method? Has anybody else ran 2 API's in 1 sql script? I can't find anything on both here or Metalink..
    Ive successfully tested running both API's in seperately (using a Hardcoded employee details) but am encountering SQL problems when combining the two..
    many thanks for looking..
    Steven

    Thanks Am0x for the suggestion but its still falling over at the line where the first API ends
    and the second the begins.
    ======================== error message =====================
    DECLARE
    ERROR at line 1:
    ORA-06550: line 65, column 22:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ) , * & = - + < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like
    between || multiset member SUBMULTISET_
    The symbol ", was inserted before ";" to continue.
    Commit complete.
    ======================== error message =====================
    ======================== actual code =====================
    -- SL's HRMS New Employee's Personal and address details Migration--
    SET SERVEROUTPUT ON SIZE 100000
    DECLARE
    /*Following Variables declared to hold Values returned by the API (Out Parameters) */
    ip_p_address_id NUMBER;
    ip_p_object_version_number NUMBER;
    l_employee_number varchar2(20):='00019834';
    l_person_id number:= 134571;
    l_validate BOOLEAN DEFAULT FALSE;
    l_assignment_id number;
    l_per_object_version_number number;
    l_asg_object_version_number number;
    l_per_effective_start_date date;
    l_per_effective_end_date date;
    l_full_name varchar2(40);
    l_per_comment_id number;
    l_assignment_sequence number;
    l_assignment_number varchar2(20);
    l_name_combination_warning boolean;
    l_assign_payroll_warning boolean;
    l_address_id NUMBER;
    l_object_version_number NUMBER;
    --dbms_output.put_line('Starting to import the Employee records for today: ' || SYSDATE);
    --dbms_output.put_line('');
    BEGIN
    BEGIN
    hr_employee_api.create_gb_employee
    p_validate => l_validate --FALSE
    ,p_hire_date => SYSDATE
    --,p_hire_date => to_date('11-Jul-2001','DD-MON-YYYY')
    ,p_business_group_id => 0
    ,p_first_name => 'Jack'
    ,p_middle_names => NULL --'Sell'
    ,p_last_name => 'Beats'
    ,p_sex => 'M'
    ,p_ni_number => 'WP924591B'
    ,p_employee_number => l_employee_number
    ,p_person_id => l_person_id
    ,p_assignment_id => l_assignment_id
    ,p_per_object_version_number => l_per_object_version_number
    ,p_asg_object_version_number => l_asg_object_version_number
    ,p_per_effective_start_date => l_per_effective_start_date
    ,p_per_effective_end_date => l_per_effective_end_date
    ,p_full_name => l_full_name
    ,p_per_comment_id => l_per_comment_id
    ,p_assignment_sequence => l_assignment_sequence
    ,p_assignment_number => l_assignment_number
    ,p_name_combination_warning => l_name_combination_warning
    ,p_assign_payroll_warning => l_assign_payroll_warning);
    END;
    BEGIN
    hr_person_address_api.create_person_address
    p_validate => l_validate,
    p_effective_date => SYSDATE,
    p_pradd_ovlapval_override => NULL,
    p_validate_county => NULL,
    p_person_id => 134571;
    p_primary_flag => 'Y',
    p_style => 'GB_GLB',
    p_date_from => SYSDATE,
    p_date_to => NULL,
    p_address_type => NULL,
    p_comments => NULL,
    p_address_line1 => 'Waterloo Rd',
    p_address_line2 => 'Cockfield',
    p_address_line3 => 'Darlo',
    p_town_or_city => 'Saarrfff Laaarrnnnddaann',
    p_region_1 => NULL,
    p_region_2 => NULL,
    p_region_3 => NULL,
    p_postal_code => 'NE13 6DF',
    p_country => 'GB',
    p_telephone_number_1 => '0122 26453148',
    p_telephone_number_2 => NULL,
    p_telephone_number_3 => NULL,
    p_addr_attribute_category => NULL,
    p_addr_attribute1 => NULL,
    p_addr_attribute2 => NULL,
    p_addr_attribute3 => NULL,
    p_addr_attribute4 => NULL,
    p_addr_attribute5 => NULL,
    p_addr_attribute6 => NULL,
    p_addr_attribute7 => NULL,
    p_addr_attribute8 => NULL,
    p_addr_attribute9 => NULL,
    p_addr_attribute10 => NULL,
    p_addr_attribute11 => NULL,
    p_addr_attribute12 => NULL,
    p_addr_attribute13 => NULL,
    p_addr_attribute14 => NULL,
    p_addr_attribute15 => NULL,
    p_addr_attribute16 => NULL,
    p_addr_attribute17 => NULL,
    p_addr_attribute18 => NULL,
    p_addr_attribute19 => NULL,
    p_addr_attribute20 => NULL,
    p_add_information13 => NULL,
    p_add_information14 => NULL,
    p_add_information15 => NULL,
    p_add_information16 => NULL,
    p_add_information17 => NULL,
    p_add_information18 => NULL,
    p_add_information19 => NULL,
    p_add_information20 => NULL,
    p_party_id => NULL,
    p_address_id => ip_p_address_id,
    p_object_version_number => ip_p_object_version_number);
    END;
    dbms_output.put_line ('Address Updation/Insertion has been successful!');
    dbms_output.put_line ('');
    --DBMS_OUTPUT.put_line (SQLERRM);
    end;
    commit;
    exit;
    ======================== actual code =====================

  • Passing parameters to SQL Script

    I'm trying to pass a parameter to SQL Script like
    sqlplus hr/my_password @myscript.sql King
    but everytime sqlplus is started the system is asking me for this parameter.
    I would like too use this principe in combination with forms. (host user/passwrd@test @test.sql King)
    kind regards,
    Menk

    Your variable name in SQL script must be called &1.
    Eg. SELECT value FROM table WHERE name = '&1.' ;
    So, if you have more than one argument, the followed must be &2. &3. ...
    If you use another name, Oracle always requests the value.
    I hope help you

  • IF statement syntax in SQL script view

    I need to include a "IF" condition in the "SELECT" section of my SQL script view.
    I tried the following syntax's but I get the error 'Incorrect SQL syntax near 'IF'
    1.  IF(Revenue <> '0' AND Quantity <> '0', Revenue/Quantity, '0') AS Gross Price
    2.  IF(Revenue != '0' AND Quantity != '0', Revenue/Quantity, '0') AS Gross Price
    3.  IF(Revenue <> '0' AND Quantity <> '0' THEN Revenue/Quantity ELSE  '0' END) AS Gross Price
    4.  IF(Revenue != '0' AND Quantity != '0' THEN Revenue/Quantity ELSE  '0' END) AS Gross Price
    My final SQL would read like follows:
    SELECT field1, field2, IF(......) AS field3
    FROM table1
    Can anybody please help with the correct IF statement syntax to be used in the SQL script based view?

    Hi Lakshmi,
    below is the syntax for IF statement.
    IF <bool_expr1> THEN
    <then_stmts1>
    ELSEIF <bool_expr2>
    THEN <then_stmts2>
    [ELSE <else_stmts3>]
    END IF
    eg :
    BEGIN
    DECLARE found INT := 1;
    SELECT count(*) INTO found FROM books WHERE isbn = :v_isbn;
    IF :found = 0 THEN
    INSERT INTO books VALUES (:v_isbn, 'In-Memory Data Management', 1, 1, '2011', 42.75, 'EUR');
    ELSE
    UPDATE books SET price = 42.75 WHERE isbn =:v_isbn;
    END IF;
    END;
    Sreehari

  • IF Condition in a PL/SQL Script give a report error.

    Hello, I’m German and I hope you can unterstand my Question.
    First, I work with the HTML DB Version 1.6.0.0.0.87 and the Oracle Version 9.2.0.6.
    I create a SQL Report, where a PL/SQL Script return the SQL Statement for the Report. This is my source-code, I have short it...:
    Declare
    sql_str varchar(2000);
    sql_str_select varchar(1000) :=' select dim_sparte …... ';
    sql_str_from varchar(1000) := ' from faktentabelle,dim_sparte ';
    sql_str_where varchar(1000):= ' where … and faktentabelle.zeit_id = :POPUP_ZEIT ';
    sql_str_groupby varchar(1000):= ' group by dim_sparte.name, faktentabelle.zeit_id ';
    Begin
    If ( (V('POPUP_NETZGEBIET') is not NULL) and (V('POPUP_NETZGEBIET') <>
    'Alle Netzgebiete')) THEN
    sql_str_select := sql_str_select || ' ,dim_organisationseinheit.netzgebiet_name ';
    sql_str_from := sql_str_from || ' , dim_organisationseinheit ';
    sql_str_where := sql_str_where || ' and faktentabelle ... and
    dim_organisationseinheit.netzgebiet_name = :POPUP_NETZGEBIET';
    sql_str_groupby := sql_str_groupby || ' , dim_orga .... ';
    End IF;
    sql_str:= sql_str_select || sql_str_from || sql_str_where || sql_str_groupby;
    htp.print(sql_str);
    Return sql_str;
    End;
    This Script include a IF-THEN condition. The Condition is true and the sql-String-Variables are updatet.
    I can get the string with htp.print() and the Statement is OK.
    The report get a Error “report error: ORA-1403: no data found”. If I copy the printet sql String in a new Report Region with SQL String, the Report is OK. When I write IF(true) instead of IF( Condition) the Report is OK, too.
    I try ist with Varibalen V(‘name‘) and with :name. It’s always the same problem. I can’t use IF-THEN-Else Conditions in a Script.
    Please help me and say me what is the problem???
    Thanks,
    Simona

    Hi Simona,
    In the sql region below the region source see that you have " Use Generic Column Names (parse query at runtime only)" check and not " Use Query-Specific Column Names and Validate Query".
    This error you usually get when you have a mismatch in your report heading.
    Vivek
    [email protected]

  • Pl/sql script needed - Urgent

    Hi All,
    I have one problem. I have to populate a table having rows more than 500000000 $ through PL/SQL.
    For getting the idea...I have created one dummy table " T1 " with column " X " having 9 rows and
    values in source are -
    row 1 = 10
    row 5 = 20
    row 8 = 30
    Other rows(2, 3, 4, 6, 7, 9) are null.
    I want to carry fwd the values so the values in the same table will come like -
    row 1, 2, 3, 4 = 10
    row 5, 6 ,7 = 20
    row 8,9 = 30
    For resolving the problem i have written a procedure :
    DECLARE
    CURSOR cur_adb IS SELECT * FROM t1 ;
    var cur_adb%rowtype ;
    var1 number(10) ;
    BEGIN
    OPEN cur_adb ;
    LOOP
    FETCH cur_adb INTO var ;
    DBMS_OUTPUT.PUT_LINE ( 'x=') ;
    EXIT WHEN cur_adb%ROWCOUNT > 10 ;
    If var is not null
    then update t1
    set x = var ;
    var1 := VAR;
    else update t1
    set x = var1 ;
    exit;
    end if;
    END LOOP;
    CLOSE cur_adb ;
    END ;
    But it is giving me wrong result as it is fetching more rows at a time.
    Pls. send me the correct Pl/SQL script as soon as possible.
    Note: You can directaly send the procedure to [email protected] .
    Thanks & Regs,
    Ashish

    Hello,
    I got the solution by adding on more column in the source table :
    source table : T1 -> x x_id
    10 1
    2
    3
    4
    20 5
    6
    7
    30 8
    9
    The procedure is :
    SQL> DECLARE
    2 CURSOR cur_adb IS SELECT x, x_id FROM t1 ;
    3 var number(10) ;
    4 var1 number(10) ;
    5 var2 number(10) ;
    6 BEGIN
    7 OPEN cur_adb ;
    8 LOOP
    9 FETCH cur_adb INTO var , var2 ;
    10 If var is not null
    11 then var1 := VAR;
    12 elsif var is null
    13 then update t1
    14 set x = var1
    15 where x_id = var2;
    16 end if;
    17 DBMS_OUTPUT.PUT_LINE ('The value of x=' || var) ;
    18 Exit when cur_adb%ROWCOUNT > 9 or cur_adb%NOTFOUND ;
    19 END LOOP;
    20 CLOSE cur_adb ;
    21 END ;
    22 /
    The value of x=10
    The value of x=10
    The value of x=10
    The value of x=10
    The value of x=20
    The value of x=20
    The value of x=20
    The value of x=30
    The value of x=30
    The value of x=30
    PL/SQL procedure successfully completed.
    Thanks everyone for helping me........
    Regards,
    Ashish

  • Can't Upload SQL scripts or application scripts in APEX 3.1

    I have installed APEX 3.1 on an Oracle 10g database.
    I can log in to APEX, create applications, and run applications.
    One application I import is the sample OEHR application which imports correctly at the hosted site.
    However, when I try to upload an SQL script or import the sample application I get
    "Page not Found" for this page http://csora:7777/pls/apex/wwv_flow.accept
    I've included my dads.conf below and also some Apache error entries
    Alias /i/ "e:\oracle\product\10.1.0\Db\Apache\Apache\images/"
    AddType text/xml     xbl
    AddType text/x-component     htc
    <Location /pls/apex>
    Order deny,allow
    PlsqlDocumentPath docs
    AllowOverride None
    PlsqlDocumentProcedure      wwv_flow_file_mgr.process_download
    PlsqlDatabaseConnectString     csora:1521:ORCL ServiceNameFormat
    PlsqlNLSLanguage          AMERICAN_AMERICA.AL32UTF8
    PlsqlAuthenticationMode     Basic
    SetHandler          pls_handler
    PlsqlDocumentTablename     wwv_flow_file_object$
    PlsqlDatabaseUsername     APEX_PUBLIC_USER
    plsqlDefaultPage          apex     
    PlsqlDatabasePassword     hocking
    Allow from all
    </Location>
    I:[Mon Apr 14 15:52:35 2008] [error] [client 10.116.101.158] [ecid: 1208202755:198.30.4.195:2696:2864:2873,0] File does not exist: e:/oracle/product/10.1.0/db/apache/apache/htdocs/pls/htmldb/builder/topnav2.gif
    [Mon Apr 14 15:52:35 2008] [error] [client 10.116.101.158] [ecid: 1208202755:198.30.4.195:2696:2924:2771,0] File does not exist: e:/oracle/product/10.1.0/db/apache/apache/htdocs/pls/htmldb/builder/left_curve.gif
    [Mon Apr 14 15:52:35 2008] [error] [client 10.116.101.158] [ecid: 1208202755:198.30.4.195:2696:2944:2767,0] File does not exist: e:/oracle/product/10.1.0/db/apache/apache/htdocs/pls/htmldb/builder/left_curve.gif
    [Mon Apr 14 15:52:35 2008] [error] [client 10.116.101.158] [ecid: 1208202755:198.30.4.195:2696:2972:2750,0] File does not exist: e:/oracle/product/10.1.0/db/apache/apache/htdocs/pls/htmldb/builder/right_curve.gif
    [Mon Apr 14 15:52:35 2008] [error] [client 10.116.101.158] [ecid: 1208202755:198.30.4.195:2696:2940:2762,0] File does not exist: e:/oracle/product/10.1.0/db/apache/apache/htdocs/pls/htmldb/builder/right_curve.gif
    [Mon Apr 14 16:19:33 2008] [error] [client 10.116.101.158] [ecid: 1208204373:198.30.4.195:2696:2924:2773,0] File does not exist: e:/oracle/product/10.1.0/db/apache/apache/htdocs/pls/htmldb/builder/topnav2.gif
    [Mon Apr 14 16:21:48 2008] [error] [client 10.116.101.158] [ecid: 1208204507:198.30.4.195:2696:2948:2801,0] mod_plsql: /pls/apex/wwv_flow.accept HTTP-404 ORA-00942: table or view does not exist
    [Mon Apr 14 16:23:29 2008] [error] [client 10.116.101.158] [ecid: 1208204609:198.30.4.195:2696:2788:2760,0] mod_plsql: /pls/apex/wwv_flow.accept HTTP-404 ORA-00942: table or view does not exist
    [Mon Apr 14 16:23:29 2008] [error] [client 10.116.101.158] [ecid: 1208204609:198.30.4.195:2696:2788:2761,0] mod_wchandshake: incorrect uri: name="p_t04" passed in.
    [Mon Apr 14 16:23:29 2008] [error] [client 10.116.101.158] [ecid: 1208204609:198.30.4.195:2696:2788:2761,0] Invalid URI in request -data; name="p_t04"
    Am I missing some files or directories from the 3.1 install? Any help would be appreciated since I think I'm close to having APEX fully functional.

    Val,
    In this line:
    PlsqlDocumentTablename wwv_flow_file_object$
    ...that needs to be wwv_flow_file_objects$
    Scott

  • How to test a simple PL SQL function from another PL SQL script

    Hi,
    I have created a function. Now i need to test that whether it is returning the correct values or not.
    For that, i have written anothe pl sql script and trying to call this function. Im passing all the IN parameters in that function. I assume here that OUT parameters will provide me the result. Im trying to display the OUT parameter one by one to see my result.
    I'm using toad as sql client here connected with oracle.
    pl sql script:-
    DECLARE
    BEGIN
         DBMS_OUTPUT.PUT_LINE('$$$$$$$ VINOD KUMAR NAIR $$$$$$$');
         FETCH_ORDER_PRODUCT_DATA(320171302, 1006, 6999,
    ODNumber OUT VARCHAR2, Line_Number OUT VARCHAR2,
    ServiceID OUT VARCHAR2, BilltoNumber OUT VARCHAR2,
    AnnualPrice OUT NUMBER, CoverageCode OUT VARCHAR2)
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | ODNumber );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | Line_Number );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | ServiceID );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | BilltoNumber );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | AnnualPrice );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | CoverageCode );
    END;
    Function:-
    Program Name : SPOT_Order_Product_Data_For_CFS.sql
    Description : Function to Validate parameters from CFS
    By : Vinod Kumar
    Date : 08/19/2011
    Modification History
    By When TAR Description
    CREATE OR REPLACE FUNCTION FETCH_ORDER_PRODUCT_DATA(orderNumber IN VARCHAR2, customerNumber IN VARCHAR2,
    productLine IN VARCHAR2, ODNumber OUT VARCHAR2,
    Line_Number OUT VARCHAR2, ServiceID OUT VARCHAR2,
    BilltoNumber OUT VARCHAR2, AnnualPrice OUT NUMBER,
    CoverageCode OUT VARCHAR2)
    RETURN VARCHAR2 IS
    lv_err_msg VARCHAR2(100) := '';
    lv_bucket_id VARCHAR2(14);
    lv_bill_number VARCHAR2(30);
    lv_anual_price NUMBER;
    lv_coverage_code VARCHAR2(8);
    lv_quote_num NUMBER(10) := NULL;
    lv_line_num NUMBER(5) := 0;
    lv_customer_number VARCHAR2(30) := customerNumber;
    lv_product_id VARCHAR2(14) := productLine;
    lv_count_quote NUMBER := 0;
    lv_quote_status VARCHAR2(5);
    lv_quote_version NUMBER(2):=0;
    BEGIN
    IF INSTR(orderNumber, '-') = 0 THEN
    lv_quote_num := orderNumber;
    ELSE
    lv_quote_num := SPT_Delimiter(orderNumber, 1, '-');
    lv_line_num := SPT_Delimiter(orderNumber, 2, '-');
    END IF;
    --Check status of the quote COM, APP
    SELECT COUNT(*) INTO lv_count_quote FROM sot_order_header WHERE ORDER_NUMBER=lv_quote_num
    AND ORDER_STATUS IN ('APP', 'COM') AND CUSTOMER_NUMBER = lv_customer_number;
    IF lv_count_quote = 0 THEN
    lv_err_msg := 'Invalid Order number';
    RETURN lv_err_msg;
    END IF;
    -- Fetch the latest version on SPOT quote
    SELECT MAX(VERSION_NUMBER) INTO lv_quote_version FROM SPT_QUOTE_HEADER WHERE QUOTE_NUMBER = lv_quote_num
    AND CUSTOMER_NUMBER = lv_customer_number;
    -- If quote is valid fetch the data in OUT parameters
    IF lv_line_num = 0 THEN
    BEGIN
    SELECT a.CUSTOMER_BILLTO_NUMBER,
    b.LINE_NUMBER, b.BUCKET_ID,
    b.ANNUAL_REF_RATE_USD, b.COVERAGE_CODE
    INTO lv_bill_number,lv_line_num,lv_bucket_id,lv_anual_price,lv_coverage_code
    FROM SPT_QUOTE_HEADER a, SPT_QUOTE_LINE b
    WHERE a.QUOTE_NUMBER = lv_quote_num
    AND a.CUSTOMER_NUMBER = lv_customer_number
    AND a.VERSION_NUMBER = lv_quote_version
    AND a.QUOTE_NUMBER = b.QUOTE_NUMBER
    AND a.VERSION_NUMBER = b.VERSION_NUMBER
    AND b.PRODUCT_ID = lv_product_id;
    ODNumber := lv_quote_num;
    BilltoNumber := lv_bill_number;
    Line_Number := lv_line_num;
    ServiceID := lv_bucket_id;
    AnnualPrice := lv_anual_price;
    CoverageCode := lv_coverage_code;
    RETURN '';
    EXCEPTION WHEN OTHERS THEN
    lv_err_msg := 'Multiple PIDs existing in the SPOT order, please provide the SPOT order + line number as input data';
    RETURN lv_err_msg;
    END;
    ELSE
    BEGIN
    SELECT a.CUSTOMER_BILLTO_NUMBER,
    b.BUCKET_ID, b.ANNUAL_REF_RATE_USD,
    b.COVERAGE_CODE
    INTO lv_bill_number,lv_bucket_id,lv_anual_price,lv_coverage_code
    FROM SPT_QUOTE_HEADER a, SPT_QUOTE_LINE b
    WHERE a.QUOTE_NUMBER = lv_quote_num
    AND a.CUSTOMER_NUMBER = lv_customer_number
    AND a.VERSION_NUMBER = lv_quote_version
    AND a.QUOTE_NUMBER = b.QUOTE_NUMBER
    AND a.VERSION_NUMBER = b.VERSION_NUMBER
    AND b.PRODUCT_ID = lv_product_id
    AND b.LINE_NUMBER = lv_line_num;
    ODNumber := lv_quote_num;
    BilltoNumber := lv_bill_number;
    Line_Number := lv_line_num;
    ServiceID := lv_bucket_id;
    AnnualPrice := lv_anual_price;
    CoverageCode := lv_coverage_code;
    RETURN '';
    EXCEPTION WHEN OTHERS THEN
              lv_err_msg := 'Multiple SPOT lines exist with same parameter';
              RETURN lv_err_msg;
    END;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    lv_err_msg := '@@@ EXCEPTION THROWN @@@ '|| SUBSTR(SQLERRM,1,120);
    RETURN lv_err_msg ;
    END;
    Don't look at the function, it might have errors but my primary concern is how to test this function. Once I start doing its testing then only i can understand any bugs(if any).
    My pl sql is not so good. Im still learning. I don't understand IN and OUT parameters are.
    I just know that IN parameters r those whick we pass in to the function wen we call it and OUT parameters are those through which we get the result.
    Thanks in advance
    Vinod Kumar Nair

    20100511 wrote:
    I wondered how I could test the output of the function from within TOAD?I usually create the following function in my developer schema:
    create or replace function BoolToChar( b boolean ) return varchar2 is
    begin
      if b then
        return( 'TRUE' );
      else
        return( 'FALSE' );
      end if;
    end;To test a function like yours, the following will do in SQL*Plus/TOAD/etc:
    begin
      DBMS_OUTPUT.put_line(
        BoolToChar( XCCC_PO_APPROVALLIST_S1.does_cpa_exist(1017934)  )
    end;
    I'm probably doing 101 things wrong here, but thought I'd ask anyway and risk being shouted at.Shout at? You reckon? I thought people risked being beaten with a lead pipe, or pelted with beer cans and stale pretzels - which makes being shouted at a really safe and viable alternative. {noformat};-){noformat}

  • How can I convert a mysql sql script to a oracle sql script

    Hi,
    We have a bunch of tables with data running on a mysql server.
    This should now be moved to an oracle 9 db.
    are there any tools to convert the import script of a mysql db
    to a format of the sql script that work for oracle ?
    Thanks
    Michael

    Oracle has a tool called Migration Toolbench, which supports MySQL 3.22 and 3.23:
    http://otn.oracle.com/tech/migration/workbench/content.html
    On this same topic, I was wondering if anybody has tried migrating from PostgreSQL to Oracle 9i. The workbench doesn't seem to support it, and feeding a pg_dump file directly into SQL*Plus is not working.

  • How to reference dynamic parameters in the PL/SQL script

    The meaning of dynamic parameter is the position and name of parameters will be changed based on the data structure of a referenced text file reading by the concerned PL/SQL script. Anybody can post a sample code will be very appreciated.

    The SQL and PL/SQL discussion forum is a good source for this kind of information.
    The URL is:
    PL/SQL

  • How can I run a SQL script file...

    How can I run a SQL script file from a location on my computer without providing the whole path?
    Is there some way I can set a "Working folder" in SQL Plus??
    Thanks!
    Tom

    You can create an environment variable called "SQLPATH" which is a list of directories that SQL*Plus will search for your .SQL
    scripts.
    I would like to use another directory than the oracle/bin...
    How can I do this ??
    Hello,
    U can do this by this way:
    Save odm_script.sql file to the default Oracle
    directory i.e. Oracle-Home/bin and Run following command
    through SQL Plus.
    SQL>@Script_Name
    I hope this will resolve ur problem.
    Regards,
    Omer Saeed Khan.

Maybe you are looking for

  • Desktop Windows Composition and Windows 8.1 Pro x64 [SOLVED]

    Hi, I'm Jenn, also new to these forums. I stumbled upon a problem when switching from Windows 7 x64 to Windows 8.1 Pro x64. I have the EXACT same setup, same laptop, same hardware, same programs, same configuration, everything. Windows 7 never did an

  • Error while running HelloWorld program

    Hi Friends! I am doing my hello world program...while running i m getting the below error...please help me regarding this... The target WSCO.java cannot be started as a servlet, because the class oracle.apps.ak.ws.webui.WSCO does not extend javax.ser

  • HT4245 FACETIME IS NOT WORKING AFTER UPDATE TO IOS 6.1 ON IPHONE 5

    Did anyone have this problem? My facetime has not been working a week or so of updating my iPhone to ios 6.1. I've checked that facetime is on in my settings, have switched the phone off and on, still no luck! Please help..

  • Custom control in custom page layout not getting shown

    Hi, I have created a site column for Date field: <Field ID="{GUID}" Name="MyCustomPageLayoutDate" StaticName="MyCustomPageLayoutDate" Group="TestGroup" Type="DateTime" Format="DateOnly" DisplayName="Date" Required="FALSE" ><Field ID ="{guid}" Name ="

  • How to pass values to messages dynamically

    Hi,     I am facing an issue while passing dynamic values to message text. The message number and message text are stored in an itab. eg- lets say 001(which changes dynamically for every loop) has text 'Contract account &1 doesn't exist'. Now I need