Instring error

I am writing a sql query, in that query I have
substr(ltrim(rtrim(sp.test)),1,instr(sp.test,'-')-1)
I am getting an error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
I checked the query by removing Instring option it worked. I need the query with Instring option.
any help would be great.
thanks,

Hi Scott,
I am trying to create a report using Region TYPE:
" SQL Query(pl/sql Function Body Returning Sql Query) "
In that query I have a column, which I have to split it into two columns to do that I wrote like this in my query:
substr(ltrim(rtrim(sp.description)),1,instr(sp.description,'-')-1) as Sampling_Interval_From,
ltrim(rtrim(substr(sp.description,instr(sp.description,'-')+1),length(sp.description))) as Sampling_Interval_To.
I am getting the following error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error.
If I remove "instr(sp.description,'-')-1" this it works fine.
Can't we use Instring function?
Thanks,
Ravi

Similar Messages

  • Error while trying to synchronize Audio and MIDI-HELP PLZ!!!

    Hi there, i have just started gettin the message wheneva i try and play audio/audio instr:
    'Error while thrying to synchronize Audio and MIDI-Sample Rate 41222 recognized. Check conflict between Logic Pro and external device'
    I get lots of high frequency bleeps n squeals thru the speakers. I am runing Motu 828mk2 and have only started gettin the problem reently its been fine before. The Motu has not problem playing audio in iTunes etc but as soon i open Logic it goes funny.

    Hi there, i have just started gettin the message
    wheneva i try and play audio/audio instr:
    'Error while thrying to synchronize Audio and
    MIDI-Sample Rate 41222 recognized. Check conflict
    between Logic Pro and external device'
    I get lots of high frequency bleeps n squeals thru
    the speakers. I am runing Motu 828mk2 and have only
    started gettin the problem reently its been fine
    before. The Motu has not problem playing audio in
    iTunes etc but as soon i open Logic it goes
    funny.
    Sounds like you need the infamous MOTU "Reset".
    (the bleeps & squeals is a give away)
    Follow these steps to restore the 828mkII to Factory Default Settings.
    -Disconnect the firewire cable from the 828mkII
    -Press the Setup knob
    -Turn the Setup knob all the way to the right
    -Press the Select knob
    -Press the Value knob
    -Power off the interface and plug the firewire cable back
    in
    -Power the interface back on
    Pancenter-

  • Compactrio RS232 question

    I have Compactrio 9074.  How do I setup the rs232 port setting.  I try to run"LabVIEW 2009\vi.lib\Instr\_visa.llb\VISA Configure Serial Port (Instr).vi" to setup the port I get a error. I would like to communicate over RS23 with the compactRIO.
    Port name = RIO0::INSTR
    error code  =  -1073807331
    Error desciption
    Error -1073807331 occurred at Property Node (arg 2) in VISA Configure Serial Port (Instr).vi
    Possible reason(s):
    VISA:  (Hex 0xBFFF001D) The specified attribute is not defined or supported by the referenced resource.
    Sam

    I have written LabVIEW for serial communication.  I have the Serial
    software that communicates between the instrument and computer.  I want to
    run the RS232 communication software on the CompactRIO.  I got everything
    working on the CompactRIO but the RS232 port.  The RS232 software is fine
    because I can run it on a computer talking to the instrument. 
    LabVIEW has a RS232 configure serial Port.  If I call out the wrong
    port, I should and get an error.  If I call out the correct port, I should
    not get an error even if the instrument is not connected.  All I'm doing
    is trying to initialize the port configuration. 
    On the compactRIO, I have NI-RIO 3.2.0(minimal) installed.  I'm trying
    to initialize the baud rate before I talk to the instrument.  Attached is
    the init vi I'm using.
    Thanks for the response
    Sam
    Attachments:
    InitSerial.vi ‏11 KB

  • IIF with InStr and LEFT -1 Causes #Error in SSRS 2008R2

    Hello,
    I'm using IIF with InStr to test for a "/" in a field on a report.  The left function works fine unless I try to subtract 1 from it.  This code works fine:
    =IIF(InStr(Fields!WellCompName.Value,"/")=0, Fields!WellCompName.Value, left(Fields!WellCompName.Value,InStr(Fields!WellCompName.Value,"/")))
    But this code causes the True condition to yield #Error in the report when I add the -1 to the end of the left function:
    =IIF(InStr(Fields!WellCompName.Value,"/")=0, Fields!WellCompName.Value, left(Fields!WellCompName.Value,InStr(Fields!WellCompName.Value,"/")-1))
    I do need -1 to remove the "/" but it doesn't work with IFF and LEFT.
    Thanks

    Hi SomeDBGuyOutThere,
    I have tested on my local environment and can reproduce the issue, your issue caused by when the value in the field WellCompName don't contains "/". the function "left(Fields!WellCompName.Value,InStr(Fields!WellCompName.Value,"/")-1)"
    in the expression is invalid and will caused the error.
    In your scenario, please modify the second expression as below to avoid the error when there is no "/" in the string:
    =IIF(InStr(Fields!WellCompName.Value ,"/")=0,
    Fields!WellCompName.Value,
    left(Fields!WellCompName.Value,InStr(IIF(InStr(Fields!WellCompName.Value,"/")=0,"Test1/Test2",Fields!WellCompName.Value),"/")-1))
    Note: when WellCompName don't include "/" we given an test string "Test1/Test2" in the expression to avoid the error.
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Instr function syntax error in MDX quary

    Hi all
    Wen Iam excuting this MDX quary its giving error;syntax error line at 3 ','
    SELECT
    Filter( [PERIOD].Generations(5).Members,
    InStr( [PERIOD].currentmember.[2010], "Cola" ) >0 )
    ON COLUMNS
    FROM REP.Rep;
    but wen iam excuting this below example
    SELECT
    Filter( [PERIOD].Generations(4).Members,
    InStr( "cocaCola", "Cola" ) >0 )
    ON COLUMNS
    FROM REP.Rep;
    its fine
    Plz can any help would be appriciated
    Edited by: user8815661 on 13 avr. 2010 04:17

    Hi gary,
    plz help on this , i already posted in forum but iam confident on u ,
    Ihave one scenario like calculate the ytd values using cross join like
    IIF(is ([Flow].CurrentMember,[YTD]),
    (case
    when
    is ([PERIOD].CurrentMember,[2008.01])
    Then (Sum (crossjoin({[DI-3]},CrossJoin({[FLOW].[MtD]},{[PERIOD].[2008.01],[PERIOD].[2008.01] })))/2)
    when
    is ([PERIOD].CurrentMember,[2008.02])
    Then (Sum (crossjoin({[DI-3]},crossjoin({[FLOW].[MtD]},{[PERIOD].[2008.01],[PERIOD].[2008.02]}))))
    when
    is ([PERIOD].CurrentMember,[2008.03])
    Then (Sum (crossjoin({[DI-3]},CrossJoin({[FLOW].[MtD]},{[PERIOD].[2008.01],[PERIOD].[2008.02],[PERIOD].[2008.03]))))
    etc,othercase)
    but I am trying other oneto decrese the size of formula
    IIF(is ([Flow].CurrentMember,[YTD]),
    (Sum (crossjoin({[DI-3]},CrossJoin({[FLOW].[MtD]},
    {filter([PERIOD].Generations(5).members,StrToNum(Right([PERIOD].CurrentMember.MEMBER_NAME,2)) <= StrToNum(Right([PERIOD].CurrentMember.MEMBER_NAME,2)) AND StrToNum(Left([PERIOD].CurrentMember.MEMBER_NAME,4))=StrToNum(left([PERIOD].CurrentMember.MEMBER_NAME,4)) ) }))))
    , othercase )
    but its result is same value for all the YTDs for every month, something is going wrong some where
    plz any help would be appriociated

  • I can't run visa interactive control window. ERROR MESSAGE: "Unable to open session "ASrl::INSTR" Status name VI_ERROR-RSRC BUSY Visa cannot curently access this resource.

    I cant run tds220 (driver for oscilloscope).
    Error message:
    VISA: (Hex 0xBFFF000E) The given session or object reference is invalid.
    Furthermore
    I cant run Visa INteractive control.
    Error message:
    "Unable to open session to "ASRL1::INSTR" Return value 0xBFFF0072 Status name VI-ERROE-RSRC-BUSY . VISA csnnot currently access this resource."
    Then change ports, this message appears for another port.
    Thanks for answer.
    Gita

    The port is open by another resource. You note that you should also get an error if you try to access the port in hyperterminal. Try rebooting your computer and the first thing you try is opening a VISA session with Visa Interactive control(VISAIC).
    If that fails, then you have a driver accessing your ports.
    If it works then it was just two applications that were trying to access your port (LabVIEW and VISAIC are seperate apps even thought they both may be using VISA.)
    Closing VISA sessions:
    LabVIEW will only *automatically* close VISA sessions if you have this option set: Tools>>options>>Automatically close VISA sessions.
    Otherwise you need to explicitly call a Visa close on the resource.

  • Error while using CURRENTMEMBER property in INSTR function

    Hi,
    I am looking for SQL 'LIKE' operator equivalent solution in MDX and I tried the below query.
    SELECT FILTER([Company].Members, INSTR([Company].CURRENTMEMBER.NAME,"AA") >0) on columns from temp1.db
    The above query is not compiling due to CURRENTMEMBER propery in INSTR function.
    When I replaced [Company].CURRENTMEMBER.NAME with a constant "AABB", then the query is working fine.
    SELECT FILTER([Company].Members, INSTR("AABB","AA") >=0) on columns from temp1.db
    Also, CURRENTMEMBER is working fine outside INSTR function.
    SELECT FILTER([Company].Members, [Company].CURRENTMEMBER.[GEN_NUMBER] = 1) DIMENSION PROPERTIES GEN_NUMBER on columns from temp1.db
    Is CURRENTMEMBER property not supported in INSTR? I am using Hyperion Provider Services 9.3.1.
    Is there any other solution for SQL 'LIKE' operator equivalent in MDX?
    Thanks in advance,
    Anil.

    With Essbase 9.3.1 it ought to work. The following is a simple query that works for me:
    select
      filter (
           [Market].Members,
           Instr (1,
                [Market].CurrentMember.MEMBER_NAME,
                "e"
           ) > 0
      ) on axis(0)
      from [Sample.Basic]
      ;

  • Why can't I get my InStr formula to parse my data without an error?

    I'm currently designing a form in Crystal XI. I've created a series of variables to parse certain sections of a long note string (possibly 3,000 characters) and when I run the report in the preview it works beautifully.  However, when I load the report into the application that deploys it and try and run it from there I receive an error:
    Error -2147189166 : Failed to retrieve data from the database. Details: [Database Vendor Code: 400]
    I believe the crystal viewer makes a copy of my uploaded report and saves it as a Crystal 9.0 report.  Would that have something to do with why I get this error?
    Does anyone have a code snippet that may work for parsing a string that big that they could share?

    Hi
    I guess you are using SQL Server in your back end. So if you are connecting your report through a connection which is through
    "SQL Server Native Client" this error might occur. Instead of this connection try using "Microsoft OLE DB Provider for SQL Server"
    I might be guessing about your issue too much. But try this because I too had this kind of error when I tried connecting my report through SQL Native Client. I got this error on when then report is having a subreport in it. When I changed the connection the error is cleared too.
    Hope the information will be useful to you
    Regards
    Vivek

  • Followed deactivate instr but uninstall errors out

    I followed the instructions to deactivate the serial number, including checking the box to erase it when the uninstall is complete.  Then I proceeded with the uninstall via the control panel as instruction.  It errors out without much explanation.  Then I borrowed the installation CD again to reinstall and it also errors out.  So I'm stuck in the Twilight Zone, unable to get this thing off my machine.  I've spent over an hour on this website trying to figure out what to do.  Anybody got any bright ideas?  Thanks.

    Listen, I really appreciate your willingness to help but I have a bad
    feeling that if that help requires knowledgeable answers to all those many,
    many questions, you're going to become ill with me, sooner if not later.
    Frankly I never heard of anything requiring me to know the "system
    language".  Vista op system is all I know.  It was a Photshop C4 CD.  Yes,
    I'm the administrator of my laptop.  That's all I know about it.
    Let's just skip it.  It doesn't seem to have hurt anything that it didn't
    uninstall correctly; I was just trying to cleanly remove it so I could give
    it to someone in the office who needed it worse than I.  She was able to
    install if fine.  Thanks anyway.

  • Error in running a function to convert coordinates in degrees to decimal for EXCEL VBA

    For your information, I have 3 cross-posts regarding this question - and all I can said there is still no firm solution regarding this error.
    1) http://stackoverflow.com/questions/27634586/error-in-running-a-function-to-convert-coordinates-in-degrees-to-decimal-for-exc/27637367#27637367
    2) http://www.mrexcel.com/forum/excel-questions/826099-error-running-function-convert-coordinates-degrees-decimal-excel-visual-basic-applications.html#post4030377 
    3) http://www.excelguru.ca/forums/showthread.php?3909-Error-in-running-a-function-to-convert-coordinates-in-degrees-to-decimal-for-EXCEL-VB&p=16507#post16507
    and the story of the error is as below:
    Currently I am working on VBA excel to create a widget to verify coordinates whether it lies under the radius of ANOTHER predefined and pre-specified sets of coordinates.
    In the module, I want to convert the coordinates from degrees to decimal before doing the calculation - as the formula of the calculation only allow the decimal form of coordinates.
    However, each and every time I want to run the macros this error (Run-time error '5', invalid procedure call or argument) will appear. Then, the debug button will bring me to below line of coding:
    degrees = Val(Left(Degree_Deg, InStr(1, Degree_Deg, "°") - 1))
    For your information, the full function is as below:
    Function Convert_Decimal(Degree_Deg As String) As Double
    'source: http://support.microsoft.com/kb/213449
    Dim degrees As Double
    Dim minutes As Double
    Dim seconds As Double
    Degree_Deg = Replace(Degree_Deg, "~", "°")
    degrees = Val(Left(Degree_Deg, InStr(1, Degree_Deg, "°") - 1))
    minutes = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "°") + 2, _
    InStr(1, Degree_Deg, "'") - InStr(1, Degree_Deg, "°") - 2)) / 60
    seconds = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "'") + _
    2, Len(Degree_Deg) - InStr(1, Degree_Deg, "'") - 2)) / 3600
    Convert_Decimal = degrees + minutes + seconds
    End Function
    Thank you.
    Your kind assistance and attention in this matter are highly appreciated.
    Regards,
    Nina.

    You didn't give an example of your input string but try the following
    Sub test()
    Dim s As String
    s = "180° 30' 30.5""""" ' double quote for seconds
    Debug.Print Deg2Dec(s) ' 180.508472222222
    End Sub
    Function Deg2Dec(sAngle As String) As Double
    Dim mid1 As Long
    Dim mid2 As Long
    Dim degrees As Long
    Dim minutes As Long
    Dim seconds As Double ' or Long if only integer seconds
    sAngle = Replace(sAngle, " ", "")
    mid1 = InStr(sAngle, "°")
    mid2 = InStr(sAngle, "'")
    degrees = CLng(Left$(sAngle, mid1 - 1))
    minutes = CLng(Mid$(sAngle, mid1 + 1, mid2 - mid1 - 1))
    seconds = Val(Mid$(sAngle, mid2 + 1, 10)) ' change 10 to 2 if only integer seconds
    Deg2Dec = degrees + minutes / 60 + seconds / 3600
    End Function
    As written the function assumes values for each of deg/min/sec are included with unit indicators as given. Adapt for your needs.
    In passing, for any work with trig functions you will probably need to convert the degrees to radians.

  • Getting Error While Attaching Concurrent Program Output PDF file for POAPPRV Workflow

    Hi All,
    I am getting the below error when I am trying to attach concurrent program output to the PO Approval Notification.
    An Error occurred in the following Workflow.
    Item Type = POAPPRV
    Item Key = 1040589-528378
    User Key =945871
    Error Name = WF_ERROR
    Error Message = [WF_ERROR] ERROR_MESSAGE=3835: Error '-20002 - ORA-20002: [WFMLR_DOCUMENT_ERROR]' encountered during execution of Generate function 'WF_XML.Generate' for event 'oracle.apps.wf.notification.send'. ERROR_STACK=
    Wf_Notification.GetAttrblob(3604701, ZZ_PREVIOUS_PO_COMPARE, text/html)
    WF_XML.GetAttachment(3604701, text/html)
    WF_XML.GetAttachments(3604701, http://oraerp.am.corp.xxxx.com:8099/pls/DEV, 11283)
    WF_XML.GenerateDoc(oracle.apps.wf.notification.send, 3604701)
    WF_XML.Generate(oracle.apps.wf.notification.send, 3604701)
    WF_XML.Generate(oracle.apps.wf.notification.send, 3604701)
    Wf_Event.setMessage(oracle.apps.wf.notification.send, 3604701, WF_XML.Generate)
    Wf_Event.dispatch_internal()
    Error Stack =
    Activity ID = 190844
    Activity Label = AL_NOTIFY_APPROVER_PROCESS:ZZ_PO_PO_APPROVE_ATTCH
    Result Code = #MAIL
    Notification ID = 3604701
    There are several threads for this error however I cannot find any specific solution to the problem.
    Please find the code below -
        wf_engine.setitemattrdocument(itemtype=>itemtype,
                                      itemkey=> itemkey,
                                      aname=>'ZZ_PREVIOUS_PO_COMPARE',
                                      documentid =>'PLSQLBLOB:zz_po_reqapproval_init1.xx_notif_attachments/' || to_char(l_request_id_prev_po)||':'||to_char(l_document_num));
    -- here l_request_id_q_and_s is the request id of the program and l_document_num is the PO document number
    PROCEDURE xx_notif_attachments(p_request_id    IN VARCHAR2,
                                   p_document_num  IN VARCHAR2,
                                   p_document      IN OUT BLOB,
                                   p_document_type IN OUT VARCHAR2) IS
      v_lob_id          NUMBER;
      v_document_num    VARCHAR2(15);
      v_document_prefix VARCHAR2(100);
      v_file_name       VARCHAR2(500);
      v_file_on_os      BFILE;
      v_temp_lob        BLOB;
      v_dest_offset     NUMBER := 1;
      v_src_offset      NUMBER := 1;
      v_out_file_name   VARCHAR2(2000);
      v_conc_prog_name  VARCHAR2(500);
      v_conc_req_id     NUMBER;
      CURSOR get_output_file(p_concurrent_request_id NUMBER) IS
        SELECT cr.outfile_name, cp.concurrent_program_name
          FROM fnd_concurrent_requests cr, fnd_concurrent_programs_vl cp
         WHERE request_id = p_concurrent_request_id
           AND cp.concurrent_program_id = cr.concurrent_program_id;
    BEGIN
      --    set_debug_context('xx_notif_attach_procedure');
      v_conc_req_id  := to_number(substr(p_request_id,
                                         1,
                                         instr(p_request_id, ':') - 1));
      v_document_num := substr(p_request_id,
                               instr(p_request_id, ':') + 1,
                               length(p_request_id) - 2);
      OPEN get_output_file(v_conc_req_id);
      FETCH get_output_file
        INTO v_out_file_name, v_conc_prog_name;
      CLOSE get_output_file;
      v_out_file_name := substr(v_out_file_name,
                                instr(v_out_file_name, '/', -1) + 1);
      v_file_name     := to_char(v_document_num) || '-Previous_PO_Rev.pdf';
      utl_file.fcopy(src_location  => 'APPS_OUT_DIR',
                     src_filename  => v_out_file_name,
                     dest_location => 'PO_DATA_DIR',
                     dest_filename => v_file_name);
      --  v_lob_id := to_number(v_document_id);
      v_file_on_os := bfilename('PO_DATA_DIR', v_file_name);
      dbms_lob.createtemporary(v_temp_lob, cache => FALSE);
      dbms_lob.fileopen(v_file_on_os, dbms_lob.file_readonly);
      dbms_lob.loadblobfromfile(dest_lob    => v_temp_lob,
                                src_bfile   => v_file_on_os,
                                amount      => dbms_lob.getlength(v_file_on_os),
                                dest_offset => v_dest_offset,
                                src_offset  => v_src_offset);
      dbms_lob.fileclose(v_file_on_os);
      p_document_type := 'application/pdf;name=' || v_file_name;
      dbms_lob.copy(p_document, v_temp_lob, dbms_lob.getlength(v_temp_lob));
    EXCEPTION
      WHEN OTHERS THEN
        wf_core.CONTEXT('ZZ_PO_REQAPPROVAL_INIT1',
                        'xx_notif_attachments',
                        v_document_num,
                        p_request_id);
        RAISE;
    END xx_notif_attachments;
    Please help me find a to the above mentioned error.
    Thanks,
    Suvigya

    There are two ways to look at what error the PLSQLBLOB API is throwing.
    1) Call your PLSQLBLOB API GNE_PO_CREATE_FILE_ATTACHMENT.Gne_Create_File_Attachment directly from a PLSQL block and verify that it returns the BLOB data successfully.
    You could also call another WF API that in turn executes the PLSQLBLOB API internally. For example,
    <pre>
    declare
    l_document blob;
    l_doctype varchar2(240);
    l_aname varchar2(90);
    begin
    dbms_lob.CreateTemporary(l_document, true, dbms_lob.Session);
    -- 207046 - This is the notification id of your failed workflow
    -- PO_REPORT - Document type attribute
    -- 'text/html' - Content Type being generated for
    Wf_Notification.GetAttrBLOB(207046, 'PO_REPORT', 'text/html', l_document, l_doctype, l_aname);
    -- Print the size of the document here to verify it was fetched correctly
    end;
    </pre>
    2) Turn on log for SYSADMIN user with following attributes.
    Log Enabled = TRUE
    Log Level = ERROR
    Log Module = wf.plsql%
    Restart the Workflow Deferred Agent Listener and Workflow Notification Deferred Agent Listener and run your workflow process. Search for log messages written for above context and you can identify the error at wf.plsql.WF_XML.GetAttachment module with message starting as "Error when getting BLOB attachment ->"
    Hope this helps.
    Vijay

  • Error while downloading a file via APEX screen

    While I try to download a file using the below code;
    an HTTP 404 error is coming although the proc is being called and the parameter is correctly being passed.
    Please help.
    create or replace procedure download_myfile1(p_id in number)
    as
    v_mime varchar2(255);
    v_length number;
    v_file_name varchar2(2000);
    Lob_loc BLOB;
    BEGIN
    -- -- Selecting the details from the table whoch contains the extracts
    select EXTRACT_FILE,FILE_NAME,dbms_lob.getlength(EXTRACT_FILE) into lob_loc,v_file_name,v_length from table_name where ID = p_id;
    -- -- set up HTTP header
    -- -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( 'application/octet', FALSE );
    -- set the size so the browser knows how much to download
    --v_file_name := substr(v_file_name,1,instr(v_file_name,'.')-1);
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment; filename="'||v_file_name|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( lob_loc );
    end download_myfile1;
    It shows a POP up window by which u can save or opens the file. But no pop up displayed in this case.
    -Shreya

    Hi,
    Made the same changes but still getting the same error.
    The earlier URL also that I had mentoned would dynamically make this url mentioned by you and then shows the pop up window.
    However when I am right clicking on the download link and then clicking 'Save target as' then this error message is provided:
    Internet Cannot download [schema name].download_myfile2 from [DNS name]
    Internet Explorer was not able to open this Internet Site.The requested site is either unavailable or cannot be found .Please try again.
    Please help..
    Thanks in Advance ...
    Shreya
    Edited by: 935203 on Jul 9, 2012 11:58 PM

  • FRM-92101 error while running report from a button or menu

    Hi All,
    I am getting the error FRM-92101 while running report without parameter from a button or menu. I am using Developer Suit 10g. I get the error as it shows there has some configuration problem in my form. Will you please help me anyone how can i solve the problem. My previous forms running very well both with parameter and without parameter.
    Arif

    Hello Sir,
    Thanks for your cooperation. I have solved my problem by myself. The fact was that, when i tried with the following code which made my report---
    SELECT br.bid, br.bname, br.branchtxnstatus, dif.difference
    FROM branch br,
    (SELECT gladbrid branchid,
    SUM
    (CASE
    WHEN ga.gl_acc_categry IN ('L', 'I')
    THEN gd.gladbalance
    ELSE -1 * gd.gladbalance
    END
    ) AS difference
    FROM glaccount ga, glaccountdetail gd
    WHERE ga.glid = gd.gladglid
    GROUP BY gladbrid) dif
    WHERE dif.branchid = br.bid AND br.branchtxnstatus = :Br_Status
    and dif.difference!=0
    ORDER BY br.bid;
    and the code against the button or menu item is---
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    repid := FIND_REPORT_OBJECT('ASSET');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('http://192.168.0.21:8889/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
    ELSE
    message('Error when running report');
    END IF;
    Clear_message;
    END;
    Clear_message;
    which has shown the error FRM-92101 and didn't run the report.
    In that case I have changed the query to run the report. first of all i create a view following the query and build the report using a simple select query. that's etc. my report running fine now.
    It is mentioned that there had no error on my codes.
    Arif

  • Error in using DBMS_LOB Package

    Hi,
    I am attaching a PDF File through a database procedure as shown below
    create or replace procedure load_document(document_id in number, filename IN varchar2, doc_desc IN VARCHAR2, doc_type IN VARCHAR2) as
    f_lob bfile;
    b_lob blob;
    --document_name varchar2(30);
    --mime_type varchar2(30);
    document_name oea_documents.document_name%TYPE;
    mime_type oea_documents.document_mime_type%TYPE;
    dot_pos number;
    v_file_type VARCHAR2(10);
    begin
    -- Find the position of the dot ('.') located in the filename
    dot_pos := instr(filename,'.');
    -- Get the filename without extension and use it as image name
    document_name := substr(filename,1,dot_pos-1);
    -- Build the mime type . Retrieve the file extension and add it to 'image/'
    v_file_type := SUBSTR( filename, dot_pos+1, Length(Filename) );
    IF ( UPPER(v_file_type) IN ('JPG','JPEG','TIF','TIFF','GIF') ) THEN
    mime_type := 'image/'||substr( filename , dot_pos+1 , length(filename) );
    ELSIF ( UPPER(v_file_type) = 'PDF' ) THEN
    mime_type := 'application/pdf';
    ELSIF ( UPPER(v_file_type) = 'DOC' )THEN
    mime_type := 'application/msword';
    ELSIF ( UPPER( v_file_type) = 'XLS') THEN
    mime_type := 'application/ms-excel';
    ELSE
    mime_type := 'image/'||substr( filename , dot_pos+1 , length(filename) );
    END IF;
    insert into oea_documents (document_id,
    document_name,
    document_mime_type,
    document,
    document_description,
    document_type
    values(document_id, document_name, mime_type, empty_blob(),doc_desc,doc_type) return document into b_lob;
    -- /!\ Directory name has to be UpperCase !
    f_lob := bfilename('FILE_LOAD',filename);
    o_dset_test('5');
    dbms_lob.fileopen(f_lob,dbms_lob.file_readonly);
    o_dset_test('6');
    dbms_lob.loadfromfile(b_lob,f_lob,dbms_lob.getlength(f_lob) );
    dbms_lob.fileclose(f_lob);
    commit;
    end;
    FILE_LOAD is a folder on the database server(unix).
    I have also tried to give the full path on the unix databse server instead of FILE_LOAD directory but then it gives error ora-22285.
    while executing this procedure I am getting the error ora-22288(Invalid file or directory).
    But this occurs randomly
    For instance i tried to attach a pdf file with the name cross.pdf ,it gave me the above error and when i renamed the file as Cross.pdf it attached successfully.
    The error comes whilke executing the statement dbms_lob.fileopen(f_lob,dbms_lob.file_readonly);
    Please guide on the above issue.

    Hi,
    Welcome to the forum!
    user1356624 wrote:
    f_lob := bfilename('FILE_LOAD',filename);
    FILE_LOAD is a folder on the database server(unix).
    I have also tried to give the full path on the unix databse server instead of FILE_LOAD directory but then it gives error ora-22285.The first argument to BFILENAME is the name of a directory object, as found in the directory_name column of all_directories. That is not the same thing as a folder name, which is found in the directory_path column of all_directories. Look up [CREATE DIRECTORY|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5007.htm#sthref6211] in the SQL Language manual for a description of Oracle's directory objects.
    If you have problems with this, post the results of
    SELECT  *
    FROM    all_directories;It might also be useful to see the Oracle "CREATE DIRECTORY" command that was used.
    As you probably noticed, this site compresses white space by default.
    When you post code or results on this site, type these 6 characters:
    (small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
    Edited by: Frank Kulash on Aug 10, 2009 3:35 PM
    Added link.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Error when try to call a pl/sql procedure from the .xsql file

    I tried to call a pl/sql procedure like this:
    <?xml version="1.0"?>
    <page connection="omtest5" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-owa>
    sampleowaxml.testone
    </xsql:include-owa>
    </page>
    but I got the following error message:
    <?xml version="1.0" ?>
    - <page>
    - <xsql-error action="xsql:include-owa">
    <statement>declare buf htp.htbuf_arr; param_names owa.vc_arr; param_values owa.vc_arr; rows integer := 32767; outclob CLOB;begin param_names(1) := 'HTTP_COOKIE'; param_values(1) := ''; param_names(2) := 'SERVER_NAME'; param_values(2) := 'mxfang-nt.us.oracle.com'; param_names(3) := 'SERVER_PORT'; param_values(3) := '80'; param_names(4) := 'SCRIPT_NAME'; param_values(4) := '/servlets/oracle.xml.xsql.XSQLServlet'; param_names(5) := 'PATH_INFO'; param_values(5) := '/xsql/test/myproject.xsql'; param_names(6) := 'HTTP_USER_AGENT'; param_values(6) := 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)'; owa.init_cgi_env(6,param_names,param_values); sampleowaxml.testone owa.get_page(buf,rows); dbms_lob.createtemporary(outclob,true,dbms_lob.session); for i in 1..rows loop dbms_lob.writeappend(outclob,length(buf(i)),buf(i)); end loop; ? := outclob; ? := DBMS_LOB.INSTR(outclob,CHR(10)&#0124; &#0124;CHR(10));end;</statement>
    <message>ORA-06550: line 3, column 3: PLS-00103: Encountered the symbol "OWA" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "OWA" to continue.</message>
    </xsql-error>
    - <xsql-error action="xsql:include-owa">
    <message />
    </xsql-error>
    </page>
    This error message is very similiar to the message that Shanthir posted on Jan, 21. I did run the dbmslob.sql, but it doesn't help. Anybody has ideas how to solve it?
    I used the PL/SQL web toolkit provided by OAS4.0.8.1. I believe oracle web agent is replaced by this toolkit.
    Thanks,
    Min
    null

    Hi,
    Glad that somebody else too got this problem. Well, as I had mentioned in my previous posting too, I think there are some procedures in the package, dbms_lob, like the writeappend, createtemporary etc.. which is not found in my dbms_lob.sql file, I am using 8.0.5, but I found these procedures in the 8i, I think it is becos of that.
    By the way if anybody got this solution and got any workaround, please help me too.
    I am still waiting for the solution to that.
    Shanthi

Maybe you are looking for

  • Appraisal template not visible-urgent!!

    Hi All, We have implemented Appraisals (MBO) module, we have created an appraisal template for same. The data is now being transferred to production server, hence the problem is that the Appraisal template what we created is <b>not visible in front e

  • IPod 5G, iTunes 10.4, Album artwork, Vista

    Hello there, I own an iPod5G (60G), connect to a Vista PC (yes, I know) through iTunes 10.4. I tried to add albums artwork to show on the iPod, to no result. Practically speaking, I have successfullyf added the artwork to the tags (through TagScanner

  • Application (ReadIris) crashes on launch

    I have ReadIris 9.0 (Optical Character Recognition software) on my system. It has always worked very well in the past, but I have not used it for a while. Last night I tried to start it, and it began to open and then crashed. I tried it repeatedly. T

  • Can't read DVDRW after new HD install

    I just got my iBook back from the Mac store today after getting a new HD and top case - I backed up all my files on a DVDRW which worked fine and was readable before I sent the computer in. Now when I insert the disc the drive makes a clicking sort o

  • Extension of ME6h

    Hi , I have a requirement to extend ME6H with some more fields and remove some fields from output, can any one help me on this. thanks bobby