Funny bug in pl sql code

Hi,
I have written a code to upload data from csv file to oracle table. it gives me a funny error. I have given below the sample contents of .csv file
"4951","TCSPL (TRADING A/C)","470","TISCO",20050419,"P",362.6550,212,0.00
"4951","TCSPL (TRADING A/C)","470","TISCO",20050419,"S",361.7500,212,-191.86
"4951","TCSPL (TRADING A/C)","477","ASHOKLEY",20050928,"P",28.5000,200,0.00
"4951","TCSPL (TRADING A/C)","477","ASHOKLEY",20050928,"S",28.4960,200,-0.80
for the first time if i run the sql code it uploads first 2 records and does not upload third record, if i change the figure of =-191.86 to 191.86 (if i remove - mark ) then it uploads all the records, if i reverse it back it does not the third record, the structure of the table is like this ( the data column where this data get inserted is number(15,4) datatype)
this type of problem is happening with that perticular row only, though several such kind of combination is there in the csv file.
sQL> desc UNITISCLTRXN
Name Null? Type
CLCODE VARCHAR2(10)
CLNAME VARCHAR2(120)
SCCODE VARCHAR2(10)
NSESYMBOL VARCHAR2(10)
TRDDATE DATE
PURSAL VARCHAR2(1)
RATE NUMBER(15,6)
CLQTY NUMBER(10,2)
PROFIT NUMBER(15,4)
the sql code i have written is as below
PROCEDURE upload_unitiscltrxn IS
file_id text_io.file_type;
     crec unitiscltrxn%rowtype;
linebuf VARCHAR2(1000);
i number:=1;
len number:=0;
spos number:=0;
tpos number:=0;
var varchar2(1000);
mon varchar2(5);
cnt number:=0;
     errnum NUMBER := ERROR_CODE;
     errtxt VARCHAR2(80) := ERROR_TEXT;
errtyp VARCHAR2(3) := ERROR_TYPE;
begin
          Delete from unitiscltrxn;
          File_id := Text_IO.Fopen('M:\UNITIS\db\final.csv', 'r');
     Text_IO.Get_Line(File_id,linebuf);
          cnt :=1;
          while linebuf is not null loop
     IF CNT<>1 THEN
          Text_IO.Get_Line(File_id,linebuf);
     END IF;     
          cnt :=1+cnt;
     len := length(linebuf);
     spos :=1;
     i:=1;
     tpos :=0;
     var:='';
     mon:='';     
     while i < 10 loop
     tpos := instr(linebuf,',',spos);
     if tpos >0 then
          var :=substr(linebuf,spos,tpos-spos);
     else
          var :=substr(linebuf,spos);
     end if;     
          ----------get values into variable.------------------     
     If i =1 then
          Crec.clcode := Replace(var,'"','');
     ElsIf     i =2 then
          Crec.clname := Replace(var,'"','');
     ElsIf     i =3 then
          Crec.sccode := Replace(var,'"','');
     ElsIf     i =4 then
          Crec.nsesymbol := Replace(var,'"','');
     ElsIf     i =5 then
          select Decode(substr(var,5,2),1,'JAN',2,'FEB',3,'MAR',4,'APR',5,'MAY',6,'JUN',7,'JUL',8,'AUG',
          9,'SEP',10,'OCT',11,'NOV',12,'DEC') into mon from dual;
          Crec.trddate := to_date(substr(var,7)||'-'||mon||'-'||substr(var,1,4),'DD-MON-YYYY');
     ElsIf     i =6 then
          If var = '"P"' Then
               Crec.pursal :='P';
          Elsif     var = '"S"' Then
               Crec.pursal :='S';
          end if;     
          --Crec.pursal := var;
     ElsIf     i =7 then
          Crec.rate := var;
     ElsIf     i =8 then
          Crec.clqty := var;
     ElsIf     i =9 then
          Crec.profit := var;
     End If;     
     i:=i+1;
     spos:=tpos+1;
     end loop;
     INSERT INTO UNITISCLTRXN VALUES(crec.clcode, crec.clname ,crec.sccode ,crec.nsesymbol,
     crec.trddate,crec.pursal,crec.rate,crec.clqty,crec.profit);
     text_io.new_line(file_id, 1);
     End loop;     
     EXCEPTION
     WHEN no_data_found THEN
     Text_IO.Put_Line('Closing the file...');
     Text_IO.Fclose(file_ID);
WHEN OTHERS THEN
     Message(errtyp||'-'||TO_CHAR(errnum)||': '||errtxt||'FF'||DBMS_ERROR_CODE);
     Message(errtyp||'-'||TO_CHAR(errnum)||': '||errtxt);
END;
END;
Thanks
Uday

Hi
Try to debug you procedure inserting a better exception handling and some dbms_output.put_line.
E.g.
ElsIf i =9 then
Crec.profit := var;
dbms_output.put_line(var || '  -  ' Crec.profit);
End If; Try to put the exception handling in the loop ... while i < 10 loop ... .
I don't think that it's an Oracle bug. It's a human error in your code!
Bye, Aron

Similar Messages

  • Bug: Validate PL/SQL code not working?

    Hallo,
    in the newer versions of Apex there seems to be an issue with Process code validation.
    It doesn't make any difference if i check the
    "Do not validate PL/SQL code (parse PL/SQL code at runtime only)" option or if i don't.
    There is no parsing of the code and i can write the worst syntax without any problem resulting in bad runtime errors. However the parsing of Region SQL and PL/SQL is working well.
    Anybody knows what this is ?
    Thanks,
    Jochen
    Message was edited by:
    Jochen.Zehe

    I think I know what is happening.
    On the Create Process wizard, when you enter your PL/SQL code in
    http://i14.tinypic.com/4qxai38.jpg
    and click the Next button, the code is parsed and throws an error if it has syntax errors. But if you click on the Create Process button, the process is created, regardless of whether it has syntax errors or not!
    Similarly, the Edit Page Process page also doesn't appear to validate the code, it happily saves the process with any nonsense in the Process Source box, even when the "Do not parse code" checkbox is unchecked (default)
    Definitely a bug (not sure if it is regression from 2.x or not)

  • PL/SQL code written in db or in application...????

    Hi ,
    Which is the best...at performance , maintability... e.t.c.???
    To write PL/SQL as validation process of data values going to be inserted in db:
    1) as db trigger (before insert or update row-level trigger)
    2) in application level - in Forms10g...
    This PL/SQL code compares some pairs of data values only.... there DML statement....
    Both db server and App server are considered to be or in the same machine or in two machines very close to each other...
    Note: i use Db10g .
    Thanks...
    Sim

    It is all about moving parts. How many there are. Where they are located.
    The less moving parts, the less the complexity, the bugs - and the better the performance (less wheels to turn to crunch data), the easier the maintenance and the better the flexibility.
    Part of this is having the moving parts close to the data. Kind of obvious - what is faster? Shipping data from the db engine to a front-end application via a app server and web server? Or shipping the data from the db (SQL) engine to a PL/SQL process running as part and parcel of db instance? IPC is significantly faster than TCP/IP.
    Having the moving parts close to the data also means that it can scale with the data. Oracle is good at scalability. It is designed at its very core to be scalable. Partitions to reduce I/O. Shared Server to reduce o/s resource footprint per client session. Shared pool to re-use SQL. DB buffer to cache data. RAC to run multiple db instances for a single physical database. Etc. Etc.
    With the application moving parts being close to the data, it inherits this scalability. You can "multi-thread" application code using table pipelines. You have access to forking application code using background processes (DBMS_JOB and DBMS_SCHEDULER). You have bulk processing in order to transfer more data per SQL engine call, between the buffer cache and your application, and thus also reduce expensive context switching.
    This list goes on and on.
    All this is summarised into the following rules.
    Rule 1. Do it in SQL.
    Rule 2. Only when SQL cannot do it, use PL/SQL. (e.g. SQL is not suited for managing and controlling process flow - PL/SQL is)
    Rule 3. Only when PL/SQL cannot do it, use <insert-language-here> (e.g. PL/SQL cannot render a Windows grid on the client - but Delphi/C#//Java can).
    Also keep in mind that in the modern client-server paradigm we deal with a web architecture. Which means the client is a web browser. And this means that PL/SQL can pass the data (HTML) required by the client (web browser) to render the User Interface.
    Have a look at APEX (Oracle's Application Express) for how this works. http://apex.oracle.com
    All you need to develop web applications is APEX (a PL/SQL product suite in the database) and a web browser. Kickass stuff... :-)

  • BUG in Oracle SQL Developer 3.0.04 on the "generating DLL" with comments?

    I'm newbie on oracle, but I think that I found out a bug in Oracle SQL Developer version 3.0.04 on the "generating DLL" tool using "comments".
    I will describe the steps that I gave:
    I created a view, but after I test it I had to change my “where” condition, so I comment the old code and then I wrote the new “where” condition below. After I done that I tried to look at the sql code of my view using “generating DLL” tool, but oracle sql developer only shown me half of the code, a lot of code were missing. Then I began with some test trying to understand what happen and I notice that if I put an invalid sql code in my comment the generating DLL start working with no problems, for example(pseudo-code):
    (COMMENT WITH VALID SQL CODE the "Generating SQL" don't work:)
    CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
    AS
    SELECT column1, column2
    FROM table1
    INNER JOIN
    (SELECT
    FROM table2
    INNER JOIN .....
    INNER JOIN ....
    --where time_stamp = (select max(time_stamp) from .....)
    WHERE time_stamp >= TRUNC(sysdate)
    ) t1 ON t1.ID = ....
    AND ..... >= TRUNC(sysdate)
    ORDER BY ....
    Generating DLL returns this(when the error occurs):
    CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
    AS
    (COMMENT WITH VALID SQL CODE the "Generating SQL" work with no problems:)
    CREATE OR REPLACE VIEW <user>.<view_name> ( <column1>,<column2> )
    AS
    SELECT column1, column2
    FROM table1
    INNER JOIN
    (SELECT
    FROM table2
    INNER JOIN .....
    INNER JOIN ....
    --where
    WHERE time_stamp >= TRUNC(sysdate)
    ) t1 ON t1.ID = ....
    AND ..... >= TRUNC(sysdate)
    ORDER BY ....
    I believe that "Generating DLL" tool have some problem with the comments, I also used /*...*/ to comment but the problem is still active.
    I notice as well that if I started to add some more comments along the code, the conditions migth change, so I think the problem is related with "comments" code.
    Would you mind telling me if this is a real bug or if I'm doing anything wrong.
    Thank you in advance,
    Rodrigo Campos
    Edited by: 894886 on 3/Nov/2011 5:29

    Hi Rodrigo,
    Thank you for reporting this. The only bug I see currently logged on a comment affecting the generated View DDL involves ending the last line of the definition with a comment, which treats the ending semi-colon (even if on a different line) as part of the comment. That is actually related to a low-priority bug against an Oracle database API.
    Unfortunately, your pseudo-code is a bit complex. Trying a few quick, simpler tests against the standard HR schema did not reproduce the issue. I tried INNER JOIN, and nested SELECTs. It would help greatly if you could provide a test case compilable against one of the standard schema, like HR or SCOTT.
    Regards,
    Gary
    SQL Developer Team

  • Bug calling PL/SQL procedure from Java

    Has anybody encountered this problem/know the solution to the following problem?
    I have a collection of Java Beans that call the database (8.1.6). The code works perfectly except when done through a user on the DB who only has permissions to execute the PL/SQL code defined by another user AND when I use the thin drivers.. using OCI works a treat.
    The error appears to be a security exception saying that no table or view was found 'ORA-00942: table or view does not exist'..
    This does not happen for all of the procedures, only the ones that return ref cursors.
    This code worked fine on Oracle8, the problem is limited to 8i and thin drivers.
    Any suggestions as to what the problem could be/confirmation that it is a bug with Oracle would be appriciated.
    Thanx,
    - Chris.
    Brainbench MVP Java2.

    I have seen this behavior too. Oracle, could you please respond on this one.
    Thanks

  • Unwanted Line Breaks in PL/SQL CODE after 'CREATE OR REPLACE' statements

    Does anybody know how to keep SQL Developer from automatically editing PL/SQL code and adding line breaks after 'CREATE OR REPLACE' statements?
    It keeps taking:
    CREATE OR REPLACE PACKAGE DEVELOPER AUTHID DEFINER
    And turns it into:
    create or replace
    package developer AUTHID DEFINER
    This unwanted linebreak causes our autodeployment processes to break.
    Thanks,
    Michael Dunn
    University of Notre Dame
    Edited by: user9133268 on Feb 21, 2012 8:00 AM

    Hi Michael,
    I believe nothing for this issue has progressed since it was asked here:
    2.1 RC Extra Line Breaks
    As there may be approval for some planned improvements to the SQL Formatter feature in 3.2, I logged an enhancement request for you:
    Bug 13744858 - FORUM: UNWANTED LINE BREAK AFTER CREATE OR REPLACE SYNTAX
    Regards,
    Gary
    SQL Developer Team
    Edited by: Gary Graham on Feb 21, 2012 4:19 PM
    But if you have control over your auto-deployment process code, it might be quicker to enhance that to deal with CREATE OR REPLACE on the same or the preceding line. Also, note that if you edit the package DDL to put the CREATE OR REPLACE on the same line with the package name in the code editor, then immediately use Export or Save Package Spec and Body to save it to disk, then PACKAGE <name> will appear on the same line as the CREATE OR REPLACE syntax.

  • Bug report: PL/SQL validation for page process

    It looks like that the PL/SQL code which is entered for a page process isn't validated. It's not verified in the wizard and also not when modifying an existing one.
    There is a "Do not validate PL/SQL code (parse PL/SQL code at runtime only)." checkbox on both pages, so I assume that the page is designed to do the check.
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

    Yes, someone else reported this bug in Re: Validate PL/SQL code not working?
    Looks like a regression from 2.x to 3.x

  • View the SQL code

    Hello,
    I'd really like to see the SQL code generated for a webi request in XI version 3.0. Could you help me please ?
    In webi XI R2, you have a little button "i"sql that open the windows with the code (from the request) ; I find this functionality quite practical to look for a bug !
    Thank you for your answer,
    Regards,
    Camille

    Hi Camille,
    If it is built over a Relational DB eg Oracle and you have the permission granted then you should be able to see the SQL Viewer button.
    If your universe is connecting to a OLAP Cube, SAP BEx query or anyother data source based on MDX then it will not be available.
    If this is not the case for you I would report it as a bug.
    Regards
    Alan

  • Got the following reply from db-kernel: SQL-Code :-903

    Dear Experts,
    I am having a problem running MaxDB Data backup on Netbackup.... Please se log below and suggest.
    2011-04-11 13:30:38
    Using environment variable 'TEMP' with value 'C:\Windows\TEMP' as directory for temporary files and pipes.
    Using connection to Backint for MaxDB Interface.
    2011-04-11 13:30:39
    Checking existence and configuration of Backint for MaxDB.
        Using configuration variable 'BSI_ENV' = 'C:\Netbackup_Script\bsi_backint_daily.env' as path of the configuration file of Backint for MaxDB.
        Setting environment variable 'BSI_ENV' for the path of the configuration file of Backint for MaxDB to configuration value 'C:\Netbackup_Script\bsi_backint_daily.env'.
        Reading the Backint for MaxDB configuration file 'C:\Netbackup_Script\bsi_backint_daily.env'.
            Found keyword 'BACKINT' with value 'D:\sapdb\KGP\db\bin\backint.exe'.
            Found keyword 'INPUT' with value 'E:\sapdb\data\wrk\KGP\backint.input'.
            Found keyword 'OUTPUT' with value 'E:\sapdb\data\wrk\KGP\backint.output'.
            Found keyword 'ERROROUTPUT' with value 'E:\sapdb\data\wrk\KGP\backint.error'.
            Found keyword 'PARAMETERFILE' with value 'C:\Netbackup_Script\backint_parameter_daily.txt'.
        Finished reading of the Backint for MaxDB configuration file.
        Using 'D:\sapdb\KGP\db\bin\backint.exe' as Backint for MaxDB program.
        Using 'E:\sapdb\data\wrk\KGP\backint.input' as input file for Backint for MaxDB.
        Using 'E:\sapdb\data\wrk\KGP\backint.output' as output file for Backint for MaxDB.
        Using 'E:\sapdb\data\wrk\KGP\backint.error' as error output file for Backint for MaxDB.
        Using 'C:\Netbackup_Script\backint_parameter_daily.txt' as parameter file for Backint for MaxDB.
        Using '300' seconds as timeout for Backint for MaxDB in the case of success.
        Using '300' seconds as timeout for Backint for MaxDB in the case of failure.
        Using 'E:\sapdb\data\wrk\KGP\dbm.knl' as backup history of a database to migrate.
        Using 'E:\sapdb\data\wrk\KGP\dbm.ebf' as external backup history of a database to migrate.
        Checking availability of backups using backint's inquire function.
    Check passed successful.
    2011-04-11 13:30:39
    Checking medium.
    Check passed successfully.
    2011-04-11 13:30:39
    Preparing backup.
        The environment variable 'BSI_ENV' has already the value 'C:\Netbackup_Script\bsi_backint_daily.env'.
        Setting environment variable 'BI_CALLER' to value 'DBMSRV'.
        Setting environment variable 'BI_REQUEST' to value 'NEW'.
        Setting environment variable 'BI_BACKUP' to value 'FULL'.
        Constructed Backint for MaxDB call 'D:\sapdb\KGP\db\bin\backint.exe -u KGP -f backup -t file -p C:\Netbackup_Script\backint_parameter_daily.txt -i E:\sapdb\data\wrk\KGP\backint.input -c'.
        Created temporary file 'E:\sapdb\data\wrk\KGP\backint.output' as output for Backint for MaxDB.
        Created temporary file 'E:\sapdb\data\wrk\KGP\backint.error' as error output for Backint for MaxDB.
        Writing 'D:\sapdb\pipe2 #PIPE' to the input file.
    Prepare passed successfully.
    2011-04-11 13:30:39
    Starting database action for the backup.
        Requesting 'SAVE DATA QUICK TO 'D:\sapdb\pipe2' PIPE BLOCKSIZE 8 NO CHECKPOINT MEDIANAME 'BACKDBFULL'' from db-kernel.The database is working on the request.
    2011-04-11 13:30:39
    Waiting until database has prepared the backup.
        Asking for state of database.
        2011-04-11 13:30:39 Database is still preparing the backup.
        Waiting 1 second ... Done.
        Asking for state of database.
        2011-04-11 13:30:41 Database has finished preparation of the backup.
    The database has prepared the backup successfully.
    2011-04-11 13:30:41
    Starting Backint for MaxDB.
        Starting Backint for MaxDB process 'D:\sapdb\KGP\db\bin\backint.exe -u KGP -f backup -t file -p C:\Netbackup_Script\backint_parameter_daily.txt -i E:\sapdb\data\wrk\KGP\backint.input -c >>E:\sapdb\data\wrk\KGP\backint.output 2>>E:\sapdb\data\wrk\KGP\backint.error'.
        Process was started successfully.
    Backint for MaxDB has been started successfully.
    2011-04-11 13:30:41
    Waiting for end of the backup operation.
        2011-04-11 13:30:41 The backup tool is running.
        2011-04-11 13:30:41 The database is working on the request.
        2011-04-11 13:30:43 The database has finished work on the request.
        Receiving a reply from the database kernel.
        Got the following reply from db-kernel:
            SQL-Code              :-903
        2011-04-11 13:30:43 The backup tool is running.
        2011-04-11 13:30:44 The backup tool process has finished work with return code 2.
    The backup operation has ended.
    2011-04-11 13:30:44
    Filling reply buffer.
        Have encountered error -24920:
            The backup tool failed with 2 as sum of exit codes. The database request failed with error -903.
        Constructed the following reply:
            ERR
            -24920,ERR_BACKUPOP: backup operation was unsuccessful
            The backup tool failed with 2 as sum of exit codes. The database request failed with error -903.
    Reply buffer filled.
    2011-04-11 13:30:44
    Cleaning up.
        Copying output of Backint for MaxDB to this file.
    Begin of output of Backint for MaxDB (E:\sapdb\data\wrk\KGP\backint.output)----
            Reading parameter file C:\Netbackup_Script\backint_parameter_daily.txt.
            Using D:\sapdb\KGP\db\bin\backint.exe as Backint for Oracle.
            Using C:\Netbackup_Script\nt_initKGPdaily.utl as parameterfile of Backint for Oracle.
            Using E:\sapdb\data\wrk\KGP\backinthistory.log as history file.
            Using E:\sapdb\data\wrk\KGP\backintoracle.in as input of Backint for Oracle.
            Using E:\sapdb\data\wrk\KGP\backintoracle.out as output of Backint for Oracle.
            Using E:\sapdb\data\wrk\KGP\backintoracle.err as error output of Backint for Oracle.
            Using staging area D:\sapdb\Stage1 with a size of 2147483648 bytes.
            Reading input file E:\sapdb\data\wrk\KGP\backint.input.
            Backing up pipe D:\sapdb\pipe2.
            Found 1 entry in the input file.
            Starting the backup.
            Starting pipe2file program(s).
            Waiting for creation of temporary files.
            1 temporary file is available for backup.
            Calling Backint for Oracle at 2011-04-11 13:30:43.
            Calling 'D:\sapdb\KGP\db\bin\backint.exe -u KGP -f backup -t file -p C:\Netbackup_Script\nt_initKGPdaily.utl -i E:\sapdb\data\wrk\KGP\backintoracle.in -c' .
            Backint for Oracle ended at 2011-04-11 13:30:43 with return code 2.
            Backint for Oracle output: Reading parameter file C:\Netbackup_Script\nt_initKGPdaily.utl.
            Backint for Oracle output: Using E:\sapdb\data\wrk\KGP\backint4oracle.in as input of Backint for Oracle.
            Backint for Oracle output: Using E:\sapdb\data\wrk\KGP\backint4oracle.out as output of Backint for Oracle.
            Backint for Oracle output: Using E:\sapdb\data\wrk\KGP\backint4oracle.err as error output of Backint for Oracle.
            Backint for Oracle output: Using staging area D:\sapdb\Stage1 with a size of 2147483648 bytes.
            Backint for Oracle output: Using E:\sapdb\data\wrk\KGP\backinthistory.log as history file.
            Backint for Oracle output: Using D:\sapdb\KGP\db\bin\backint.exe as Backint for Oracle.
            Backint for Oracle output:
            Backint for Oracle output: Reading input file E:\sapdb\data\wrk\KGP\backintoracle.in.
            Backint for Oracle output: Backing up file D:\sapdb\Stage1.0.
            Backint for Oracle output: Found 1 entry in the input file.
            Backint for Oracle output:
            Backint for Oracle output: Starting the backup.
            Backint for Oracle output: Starting pipe2file program(s).
            Backint for Oracle output:
            Backint for Oracle output: Calling Backint for Oracle at 2011-04-11 13:30:43.
            Backint for Oracle output: Calling 'D:\sapdb\KGP\db\bin\backint.exe -u KGP -f backup -t file -i E:\sapdb\data\wrk\KGP\backint4oracle.in -c' .
            Backint for Oracle output: Backint for Oracle ended at 2011-04-11 13:30:43 with return code 2.
            Backint for Oracle output: Backint for Oracle output: Reading parameter file .
            Backint for Oracle output: Backint for Oracle output:
            Backint for Oracle output: Backint for Oracle output:
            Backint for Oracle output: Backint for Oracle error output: No staging area is defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output: The path of Backint for Oracle is not defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output: The name of the history file is not defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output: The name of the input file of Backint for Oracle is not defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output: The name of the output file of Backint for Oracle is not defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output: The name of the error output file of Backint for Oracle is not defined in the parameter file.
            Backint for Oracle output: Backint for Oracle error output:
            Backint for Oracle output:
            Backint for Oracle output: Finished the backup unsuccessfully.
            Backint for Oracle output:
            Backint for Oracle output: #ERROR D:\sapdb\Stage1.0
            Backint for Oracle output:
            Backint for Oracle error output: Backint for Oracle was unsuccessful.
            Backint for Oracle error output:
            Finished the backup unsuccessfully.
            #ERROR D:\sapdb\pipe2
    End of output of Backint for MaxDB (E:\sapdb\data\wrk\KGP\backint.output)----
        Removed Backint for MaxDB's temporary output file 'E:\sapdb\data\wrk\KGP\backint.output'.
        Copying error output of Backint for MaxDB to this file.
    Begin of error output of Backint for MaxDB (E:\sapdb\data\wrk\KGP\backint.error)----
            Backint for Oracle was unsuccessful.
    End of error output of Backint for MaxDB (E:\sapdb\data\wrk\KGP\backint.error)----
        Removed Backint for MaxDB's temporary error output file 'E:\sapdb\data\wrk\KGP\backint.error'.
        Removed the Backint for MaxDB input file 'E:\sapdb\data\wrk\KGP\backint.input'.
    Have finished clean up successfully.

    >     Requesting 'SAVE DATA QUICK TO 'D:\sapdb\pipe2' PIPE BLOCKSIZE 8 NO CHECKPOINT MEDIANAME 'BACKDBFULL'' from db-kernel.The database is working on the request.
    This seems to be your problem, the pipe is wrongly defined. On Windows it looks like
    \\.\pipe1
    see
    http://msdn.microsoft.com/en-us/library/aa365783.aspx
    Markus

  • REPORT WITH PL/SQL  CODE

    DECLARE
    SQ VARCHAR2(100);
    BEGIN
    SQ := 'SELECT * FROM EMP WHERE EMPNO=7788';
    RETURN SQ;
    END
    THE ABOVE PL/SQL CODE WORKING FINE
    BUT I NEED CONDITION BASED ON ENAME
    SQ:='SELECT * FROM EMP WHERE ENAME=''SCOTT'';
    IT IS GIVEING ERROR
    WHAT TO DO?

    Hi,
    You're missing the final quote - you have the quotes for SCOTT but not the one to close the SQ string:
    DECLARE
    SQ VARCHAR2(100);
    BEGIN
    SQ := 'SELECT * FROM EMP WHERE EMPNO=''SCOTT''';
    RETURN SQ;
    ENDAndy

  • How to 100% Protect PL/SQL Code By Wrapped in Oracle Database 10g R2

    Hello,
    Is Possible to 100% Protect PL/SQL Code By Wrapped in Oracle 10g R2 ?
    If it is not possible by wrap in oracle 10g R2,
    Please, let me suggest, how i will be able to 100% protect PL/SQL code in Oracle Database 10g R2.
    Because, I have lot of functions, procedures & package's in my project.
    Which is running in field filed.
    So, i have needed to protect 100%.
    Also, will i convert to al functions, procedures & package's to .pll file ?
    And .pll file to .plx file?
    Is it possible to convert .plx file to .pll file ?
    Please, let know any better solutions in this case....
    Regards
    Mehedi

    Hello,
    No, wrapping is not a 100% secure method. It could prevent your code from amateurs, but not from professional hackers. Look at the article http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/wrap.htm#BEHGBJAA
    It says: "•Wrapping is not a secure method for hiding passwords or table names.
    Wrapping a PL/SQL unit prevents most users from examining the source code, but might not stop all of them."
    Edited by: apiminov on 03.12.2012 3:23
    Edited by: apiminov on 03.12.2012 3:24

  • How to reference LEVEL in a TREE's SQL code

    Is it possible to somehow reference LEVEL in a tree's sql code so that you can use a decode statement to selectively create links on specific levels only i.e. NOT on the root level?
    e.g.
    select "CHILD_ID" id,
    "PARENT_ID" pid,
    "NAME" name,
    decode( LEVEL, 1, null,'f?p=' || :APP_ID || ':43:' || :APP_SESSION || '::::P43_CHILD_ID:' || CHILD_ID) link,
    null a1,
    null a2
    from TREETABLE
    order by name
    one solution I've implemented is to create a DB function e.g.
    create or replace function get_tree_level(v_child_id number) return number
    is
    v_level number(2);
    begin
    select level
    into v_level
    from TREETABLE
    where child_id=v_child_id
    start with child_id=1
    connect by prior child_id= parent_id;
    return v_level;
    end;
    and then use
    decode( get_tree_level(child_id) 1, null,'f?p=' || :APP_ID || ':43:' || :APP_SESSION || '::::P43_CHILD_ID:' || CHILD_ID) link,
    but this is too slow as I have quite a few records in the tree and takes too long to render
    regards
    Paul P

    OK I found a workaround after reading
    How to add URL to tree
    The view my tree is build on is constructed out of 3 unions and 4 "selects" ( the first select creates the ROOT NODE where "1" is also used as a hard coded foreign key (Parent_id), in the company table.)
    I just added a new column called tree_level to the query which is hard coded wrt its level on the hierarchy.
    e.g.
    CREATE OR REPLACE FORCE VIEW COMCONSTUTREE ("CHILD_ID", "PARENT_ID", "NAME","TREE_LEVEL") AS
    select 1 as child_id,to_number(null) as parent_id ,'Company' as name,*1 as tree_level* from dual
    UNION
    select COM_ID, 1, COM_NAME,2
    from company
    UNION
    select CON_ID,CON_COMPANY_ID, substr(con_name,instr(con_name,' ')+1) ||', '||substr(con_name,1,instr(con_name,' ')-1),3
    from contact
    UNION
    select STU_ID,STU_CONTACT_ID, STU_LAST_NAME||', '||STU_FIRST_NAME ,4
    from student;
    the tree code now becomes
    select "CHILD_ID" id,
    "PARENT_ID" pid,
    "NAME" name,
    decode( tree_level,1, null,'f?p=' || :APP_ID || ':43:' || :APP_SESSION || ':TREE:::P43_CHILD_ID:' ||CHILD_ID) link,
    null a1,
    null a2
    from COMCONSTUTREE"
    order by name

  • PL/SQL Code not working without debug statements

    Hi Guys,
    I have a pl/sql code in a procedure, logic iterates through almost 40K records, conditional delete and update.
    When I execute this code, I dont see the deletes and updates happening, though procedure executes for 8 minutes and exits wihtout any error, execption.
    In same procedure when I write some debug statements like dbms_output, then everything seems to be working fine.
    I know this scenario happens in Oracle Forms, wehre we use SYNCHRONIZE.
    But this is plain pl/sql procedure.
    any thoughts on this?
    Av.

    COMMIT ?
    Aside from that, no idea what your procedure looks like, what it does, what version of Oracle you are using, how you are determining "I dont see the deletes and updates happening". etc...
    You'd need to provide a slew of information for anyone to give you any meaningful help.
    I can only assure you that DBMS_OUTPUT doesn't do magic :)

  • Can I have a PL/SQL code for LOV

    Hi,
    I apologize for this dumb question. I have been so out of touch with dev (almost 8 years). Plus new to pl/sql.
    I am creating a status report application. On the dashboard, I currently have some metrics (horizontal charts). I wanted to expose these metrics based on filter.
    I had created 2 filters. The first one will identify the type (Week, Month, Qtr or Year) and the 2nd filter would be based on the type. For e.g. if I select Month as type, the 2nd filter should show May-12, April-12 etc. Once I select the 2nd filter, I should use them to show the appropriate metrics. The metric that I currently have would show all the projects that users have worked on during the week/month/qtr or year (depending on the 1st and 2nd filter).
    On the dashboard region, I added a condition to check if the value for both 1st and 2nd filter is not null. This allows me to show the dashboard only if the 2 filters have been selected.
    For the 2nd filter, I need to write a PL/SQL code to show the LOV.
    I am assuming that the pl/sql would return a SQL query. The SQL query will be based on week, month etc. Is that right?
    Thanks
    balaji
    Edited by: user644868 on May 17, 2012 11:29 AM

    rbalaji2026 wrote:
    For the 2nd filter, I need to write a PL/SQL code to show the LOV. Doesn't appear necessary. With filter 2 cascading from filter 1, why not:
    select
            /* Week query */
    from
    where
    and     :p1_filter_1 = 'WEEK'       
    union all
    select
            /* Month query */
    from
    where
    and     :p1_filter_1 = 'MONTH'       
    union all
    select
            /* Quarter query */
    from
    where
    and     :p1_filter_1 = 'QUARTER'       
    union all
    select
            /* Year query */
    from
    where
    and     :p1_filter_1 = 'YEAR'       

  • Multiple SQL queries in additional PL/SQL code in Report

    Hello gurus,
    I have a form in my portal populated some searching parameters and these parameters inserted into some temporary tables such as name_temp, addr_temp. And then I have a report that run based on these parameters, I have added additional PL/SQL code in the report at the time after the header was displayed. The code is as follows:
    declare
    checkname varchar2(40);
    checkaddr varchar2(100);
    begin
    select emp.name into checkname from emp
    where name = (select name from name_temp);
    select personnel.addr into checkaddr from personnel
    where addr = (select address from addr_temp);
    end;
    The problem I have is always the first SQL statement was executed, but not the second one, nor the third one. Does PL/SQL only supports one SQL statement per call? Please help. Is there a better way to handle this case?
    Thanks.
    Vince

    Hello gurus,
    I have a form in my portal populated some searching parameters and these parameters inserted into some temporary tables such as name_temp, addr_temp. And then I have a report that run based on these parameters, I have added additional PL/SQL code in the report at the time after the header was displayed. The code is as follows:
    declare
    checkname varchar2(40);
    checkaddr varchar2(100);
    begin
    select emp.name into checkname from emp
    where name = (select name from name_temp);
    select personnel.addr into checkaddr from personnel
    where addr = (select address from addr_temp);
    end;
    The problem I have is always the first SQL statement was executed, but not the second one, nor the third one. Does PL/SQL only supports one SQL statement per call? Please help. Is there a better way to handle this case?
    Thanks.
    Vince

Maybe you are looking for

  • How can I publish my Muse site to BC if I can't log in my BC account?

    I am a Creative Cloud subscriber and appear to be locked out of BC. How do I get BC to change my password for me? I can't do it from my end. It took 3 phone calls, 3 chats, and 3 days to update my Adobe Creative Cloud email ID. I was assured that BC

  • Problem with Disk Warrior

    Greetings. I'm attempting to run DW 3.0.3 rev 39 on my back-up computer, an iMac 400 on which I recently installed 10.3.9. Main computer is in the shop. Computer boots up from DW disk OK, however, during "rebuilding directory," the computer freezes d

  • Nested Groups in Component Model

    Is it possible to have a nested group in the Component Model? For example, I have a group of metatdata. That group is called Class and consists of the following fields: - Department - Number - Title - Level There can be 1:n of these Classes. These Cl

  • Aperture Stops Posting to Facebook Albums

    Hi All: I have done several searches on this topic, and have yet to see this precise problem. I have several Facebook albums [28]. Aperture sees them all. Up until this week, Aperture had no problem posting additional photos to these albums. But I ha

  • Issues with Assign activity

    I am trying to assign a value(string) from an element of one variable, to an attribute of an element in another. I then test the process and get an error on this activity. The message says: XPath query string returns zero node. According to BPEL4WS s