Problem in dbms_output.put_line boolean variable

hello guys m practicing PL/SQL when i try to exicute below code i get following error:
DECLARE
I BOOLEAN:=TRUE;
BEGIN
dbms_output.put_line(i);
END;
error:
Error starting at line 1 in command:
DECLARE
I BOOLEAN:=TRUE;
BEGIN
dbms_output.put_line(i);
END;
Error report:
ORA-06550: line 4, column 1:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 4, column 1:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

user13355933 wrote:
hello guys m practicing PL/SQL when i try to exicute below code i get following error:
DECLARE
I BOOLEAN:=TRUE;
BEGIN
dbms_output.put_line(i);
END;
error:
Error starting at line 1 in command:
DECLARE
I BOOLEAN:=TRUE;
BEGIN
dbms_output.put_line(i);
END;
Error report:
ORA-06550: line 4, column 1:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 4, column 1:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:DBMS_OUTPUT.PUT_LINE only accepts strings (VARCHAR2) datatype
what exactly do you expect to see, if in fact it worked as desired?

Similar Messages

  • Dbms_output.put_line prints a varchar2(32767) variable partially.

    Please help if anyone knows.
    I have an anonymous block that declares a variable as below:
    v_return_code varchar2(32767);
    I am appending characters that I am building in the begin end block to this variable and at the end printing it out using dbms_output
    dbms_output.put_line(v_return_code);
    I observe that the output is generated partially when I ran the block through PL/SQL developer SQL window.
    My code appends a new line char chr(10) after each new value is appended to the variable.
    I have the below settiing in the output window
    buffer size: 2000000
    Can someone please help why it prints the output partially?
    Thanks in advance.
    Girish

    Hi Frank,
    Thanks for your reply.
    I figured out that some other developer in the team had same problem before and he had then written a library function to tokenise the variable into 255 chars and then dbms_output it. So I am good now.
    Thanks for coming by and replying though.
    Regards,
    Girish

  • Output variable value (DBMS_OUTPUT.PUT_LINE)

    Hello,
    I just started using ORACLE and am learning about PL/SQL. My question is how do you output a variable? I am running the following in an SQL Worksheet, but I can't output the value:
    DECLARE
    v_Temp VARCHAR2(200);
    BEGIN
    v_Temp :='help me';
    DBMS_OUTPUT.PUT_LINE(v_Temp);
    DBMS_OUTPUT.PUT_LINE('Text In Single');
    END;
    Thanks, sck10

    SQL> DECLARE
      2  v_Temp VARCHAR2(200);
      3 
      4  BEGIN
      5  v_Temp :='help me';
      6  DBMS_OUTPUT.PUT_LINE(v_Temp);
      7  DBMS_OUTPUT.PUT_LINE('Text In Single');
      8  END;
      9  /
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on
    SQL> /
    help me
    Text In Single
    PL/SQL procedure successfully completed.
    SQL> Nicolas.

  • Problem using a Boolean variable

    Greetings;
    I'm writing a game in which the player and 'enemies' fall off the screen when they 'die'. The problem is that I also want to constrain their  movement to within the screen boundaries whenever they have not been killed. To start  I thought I'd go into the class I wrote to handle the player falling off the screen when he's touched by an enemy and create a boolean variable so that Flash would know to let him fall off the screen when killed, but remain constrained on the screen until that point.The problem is that now the player stays on the screen even when I want him to fall off (i.e. after he's been hit).
    The class I wrote to handle the player dying is below, and the boolean variable is called 'playerBeenHit'. Since the player only gets a y acceleration when hit, I tried using the 'ay' variable to control the behavior but with the same results. In troubleshooting I tried to trace(playerBeenHit) on every frame and noticed it would go to 'true' and then set itself back to 'false' for three out of four readouts even after the player was hit. I'm not sure what I'm doing wrong here.
    Thanks,
    Jeremy
    package  jab.enemy
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.geom.ColorTransform;
        public class DieLikeAPlayer
            private var _clip1:MovieClip; // the 'player'
            private var _clip2:MovieClip; // the 'enemy' who kills the 'player' on contact.
            private var ay = 0; // vertical acceleration for falling off the screen.
            private var vx = 0; // horizontal initial velocity, 'knockback' from the impact.
            private var vy = 0; // vertical initial velocity, 'knockback' from the impact.
            private var playerBeenHit:Boolean = false;
            public function DieLikeAPlayer(clip1:MovieClip, clip2:MovieClip): void
                _clip1 = clip1;
                _clip2 = clip2;
                _clip1.stage.addEventListener(Event.ENTER_FRAME, onEnterFrame)
                function onEnterFrame(event:Event):void
                    if (_clip1.hitTestObject(_clip2)) // what happens when the player gets killed.
                        playerBeenHit= true;
                        ay = 3;
                        _clip1.scaleY = -Math.abs(_clip1.scaleY);
                        _clip1.alpha = 0.4;
                        _clip1.gotoAndStop(2);
                        vx = -0.2;
                        vy = 2;
                        _clip1.y += 5;
                        _clip1.rotation = -45
                    // adding y acceleration and x velocity (knockback) from being hit.
                    _clip1.x += vx;
                    _clip1.y += vy;
                    vy += ay;
                    if(playerBeenHit == false)//constrains the player from moving past the  bottom of the screen.
                         if(_clip1.y > 620)
                         {_clip1.y = 620;}
                    if (_clip1.y > 100000) // brings the player 'back to life' after falling 100,000 pixels.
                        ay = vx = vy = 0;
                        _clip1.alpha = 1;
                        _clip1.scaleY = Math.abs(_clip1.scaleY);
                        _clip1.rotation = 0;
                        _clip1.gotoAndStop(1);
                        _clip1.x = 480;
                        _clip1.y = 300;
                        playerBeenHit = 0;

    that shouldn't compile.  don't you see an error message about your boolean being assigned an int?  you are publishing for as3, correct?

  • Dbms_output.put_line problem..

    We have created delete script to some 150 tables using cursors suppose we r deleting with some condition and use to display the output as
    dbms_output.put_line('Rows Deleted in the table distb_store_promo is '||SQL%ROWCOUNT);
    its shows error like it exceeds the limit.so we made setserver output off and running the query it works fine.is any other solution to overcome this..

    > is any other solution to overcome this..
    Yes. Do not use DBMS_OUTPUT. It is a very primitive API - useful for the odd debug display when debugging PL/SQL code. It should not be used for anything else. In fact, any DBMS_OUTPUT code in production PL/SQL requires serious reconsideration as those calls should be wrapped in a user PL/SQL proc.
    The proper and correct method would be to create a log PL/SQL procedure to log messages into an Oracle table, using autonomous transactions.

  • Error in dbms_output with bind variables ?

    Can you help me about the different results in "SQL Developer" and "SQL*Plus" wiht dbms_output package?
    I execute next code:var v1 number;
    var v2 varchar2(20);
    set serveroutput on
    begin
    :v1 := 10;
    :v2 := 'Hello';
    dbms_output.put_line('In first block:');
    dbms_output.put_line('v1 = '||to_char(:v1));
    dbms_output.put_line('v2 = '||:v2);
    end;
    begin
    dbms_output.put_line('In second block:');
    dbms_output.put_line('v1 = '||to_char(:v1));
    dbms_output.put_line('v2 = '||:v2);
    end;
    In SQL*Plus, the result is:In first block:
    v1 = 10
    v2 = Hello
    In second block:
    v1 = 10
    v2 = Hello
    In SQL Developer, the result is:In first block:
    v1 =
    v2 =
    In second block:
    v1 = 10
    v2 = Hello
    What happen's in SQL Developer? I work with Oracle SQL Developer 1.5.1.
    Thanks, very much

    Isidre,
    The problem appears to be in with how SQL Developer treats multiple references to the same bind variable in PL/SQL. As well as evaluating all bind references before starting the PL/SQL block, only the first assignment to the bind variables in a PL/SQL block is recognised.
    var v1 number;
    var v2 varchar2(20);
    set serveroutput on
    begin
    dbms_output.put_line('First block ...');
    :v1 := 10;
    :v2 := 'First assignment';
    :v1 := 20;
    :v2 := 'Second assignment';
    end;
    begin
    dbms_output.put_line('Second block ...');
    dbms_output.put_line('v1 = '||to_char(:v1));
    dbms_output.put_line('v2 = '||:v2);
    end;
    /Produces the following:
    anonymous block completed
    First block ...
    anonymous block completed
    Second block ...
    v1 = 10
    v2 = First assignmentThis has been discussed before (as part of EA3/EA2/EA1 - Bind Variables in PL/SQL but no bug reference was given for this problem.
    theFurryOne

  • Can we print boolean variable in dbms_output_put_line ?

    Hi
    Can any one please tell me Can we print boolean variable in dbms_output_put_line ?
    Is it possible or not ?
    Thanks,
    Sanjeev.

    user13483989 wrote:
    Hi
    Can any one please tell me Can we print boolean variable in dbms_output_put_line ?
    Is it possible or not ?
    Thanks,
    Sanjeev.The answer is in the package definition (or the documentation) if you just look:
    SQL> desc dbms_output
    PROCEDURE DISABLE
    PROCEDURE ENABLE
    Argument Name                  Type                    In/Out Default?
    BUFFER_SIZE                    NUMBER(38)              IN     DEFAULT
    PROCEDURE GET_LINE
    Argument Name                  Type                    In/Out Default?
    LINE                           VARCHAR2                OUT
    STATUS                         NUMBER(38)              OUT
    PROCEDURE GET_LINES
    Argument Name                  Type                    In/Out Default?
    LINES                          TABLE OF VARCHAR2(32767) OUT
    NUMLINES                       NUMBER(38)              IN/OUT
    PROCEDURE GET_LINES
    Argument Name                  Type                    In/Out Default?
    LINES                          DBMSOUTPUT_LINESARRAY   OUT
    NUMLINES                       NUMBER(38)              IN/OUT
    PROCEDURE NEW_LINE
    PROCEDURE PUT
    Argument Name                  Type                    In/Out Default?
    A                              VARCHAR2                IN
    PROCEDURE PUT_LINE
    Argument Name                  Type                    In/Out Default?
    A                              VARCHAR2                IN
    SQL>PUT_LINE - argument type is VARCHAR2. Simples.

  • DBMS_OUTPUT.PUT_LINE doesn't work in Reports

    Version 1.1.2.25 Build Main 25.97
    I've tried to create a Report using the PL/SQL-DBMS_OUTPUT option and it just sends out a sinle line of text without any line throws. Copy the block of code and run it as a script and it works fine.
    Anybody else come across this problem?

    Here's the PL/SQL code for the Report....
    declare
    vowner VARCHAR2(30);
    vindex VARCHAR2(30);
    vtable VARCHAR2(30);
    CURSOR cIndex
    IS
    select OWNER, INDEX_NAME, TABLE_NAME
    from dba_indexes;
    begin
    dbms_output.enable(1000000);
    open cIndex;
    LOOP
    FETCH cIndex INTO vowner, vindex, vtable;
    EXIT WHEN cIndex%NOTFOUND;
    if (vowner = :OWNER) and (vTable like :TABLENAME)
    then
    dbms_output.put_line('alter index ' || vowner || '.' || vindex || ' nomonitoring usage;');
    end if;
    end loop;
    close cIndex;
    end;
    I've tested by setting the bind variables :OWNER to a schema and :TABLENAME to '%' to return all indexes owner by the schema.
    As you can see, I don't use \n.
    This works fine when run as a script in SQL Developer (each put_line coming out on a separate line) but not as a report.

  • DBMS_OUTPUT.PUT_LINE multi records from PL/SQL procedure to Java web page.

    Hello
    I will explain the scenario:
    In our java web page, we are using three text boxes to enter "Part number,Description and Aircraft type". Every time the user no need to enter all these data. The person can enter any combination of data or only one text box. Actually the output data corresponding to this input entries is from five Oracle table. If we are using a single query to take data from all the five tables, the database will hang. So I written a procedure "SEARCH1",this will accept any combination of values (for empty values we need to pass NULL to this procedure) and output data from all the five tables. When I executing this procedure in SQL editor, the execution is very fast and giving exact result. I used "dbms_output.put_line" clause for outputing multiple records in my procedure. The output variables are "Serial No, part Number, Description, Aircraft type,Part No1,Part No2,Part No3,Part No4". I want to use the same procedure "SEARCH1" for outputing data in java web page.The passing argument I can take from the text box provided in java web page. I am using jdbc thin driver to connect our java web page to Oracle 9i database.
    Note1 : If any combination of search item not available, in procedure itself I am outputing a message like "Part Number not found". Here I am using four words ("Part" is the first word,"Number" is the second,"Not" s the third, and "found" is the fourth) for outputing this message.Is it necessary to equalise number of words I am using here to the record outputing eight variable?
    Our current development work is stopped because of this issue. So any one familier in this field,plese help me to solve our issue by giving the sample code for the same scenario.
    My Email-id is : [email protected]
    I will expect yor early mail.
    With thanks
    Pramod kumar.

    Hello Avi,
    I am trying to solve this issue by using objects. But the following part of code also throwing some warning like "PLS-00302: component must be declared". Plese cross check my code and help me to solve this issue.
    drop type rectab;
    create or replace type rectype as object(PartNo varchar2(30),Description varchar2(150),AIrcraft_type varchar2(15),status_IPC varchar2(30),status_ELOG varchar2(30),status_SUPCAT varchar2(30),status_AIRODWH varchar2(30));
    create or replace type rectab as table of rectype;
    create or replace package ioStructArray as
    procedure testsch2(pno in varchar2,pdes in varchar2,air in varchar2,orec in out rectab);
    end ioStructArray;
    create or replace package body ioStructArray as
    procedure testsch2(pno in varchar2,pdes in varchar2,air in varchar2,orec in out rectab) is
    mdescription varchar2(150);
    mpartnum varchar2(30);
    mpno varchar2(30);
    mdes varchar2(150);
    mair varchar2(15);
    mstat varchar2(1);
    cursor c1 is select partnum,description,aircraft_type from master_catalog where partnum=mpno and aircraft_type=mair and description like ltrim(rtrim(mdes))||'%';
    cursor c2 is select partnum from ipc_master where partnum=mpartnum;
    cursor c3 is select partnum from fedlog_data where partnum=mpartnum;
    cursor c4 is select partnum from superparts where partnum=mpartnum;
    cursor c5 is select part_no from supplier_catalog where part_no=mpartnum;
    mpno1 varchar2(30);
    mpno2 varchar2(30);
    mpno3 varchar2(30);
    mpno4 varchar2(30);
    mpno5 varchar2(30);
    maircraft_type varchar2(15);
    mstat1 varchar2(30);
    mstat2 varchar2(30);
    mstat3 varchar2(30);
    mstat4 varchar2(30);
    begin
    mstat:='N';
    mpno:=pno;
    mdes:=pdes;
    mair:=air;
    if mpno is not null and mdes is not null and mair is not null then
    begin
    mstat:='N';
    mpno:=pno;
    mdes:=pdes;
    mair:=air;
    for i in c1 loop
    mstat:='N';
    mstat1:='N';
    mstat2:='N';
    mstat3:='N';
    mstat4:='N';
    mpno1:=i.partnum;
    mpartnum:=i.partnum;
    mdescription:=i.description;
    maircraft_type:=i.aircraft_type;
    for j in c2 loop
    mpno2:=j.partnum;
    end loop;
    for k in c3 loop
    mpno3:=k.partnum;
    end loop;
    for l in c4 loop
    mpno4:=l.partnum;
    end loop;
    for m in c5 loop
    mpno5:=m.part_no;
    end loop;
    if mpno2=mpartnum then
    mstat1:=mpno2;
    end if;
    if mpno3=mpartnum then
    mstat2:=mpno3;
    end if;
    if mpno4=mpartnum then
    mstat3:=mpno4;
    end if;
    if mpno5=mpartnum then
    mstat4:=mpno5;
    end if;
    if mpno1=mpartnum then
    mstat:='Y';
    orec.PartNo:=mpno1;
    orec.Description:=mdescription;
    orec.AIrcraft_type:=maircraft_type;
    orec.status_IPC:=mstat1;
    orec.status_ELOG:=mstat2;
    orec.status_SUPCAT:=mstat3;
    orec.STATUS_AIRODWH:=status_AIRODWH;
    end if;
    end loop;
    end;
    end if;
    end testsch2;
    end ioStructArray;
    Expecting your early reply.
    With thanks
    Pramod kumar.

  • Problem with DBMS_OUTPUT and SQL statment with a function

    I am using SQL Developer version 3.0.04 and I have a function that has a dbms_output statment in it. I am running the following SQL to select the output of that statment.
    select A.A_FUCTION('TEST') from dual;
    The output works fine but the dbms_output line does not show in the dbms_output window. I turned on the output window etc. and i can get the select to print out the output if i wrap it in a declare begin end wrapper... and then change the query to insert the return value into variable.
    just wondering if there is way to get the dbms_output to flush out with just an SQL statment instead of in a begin end wrapper etc.

    just wondering if there is way to get the dbms_output to flush out with just an SQL statment instead of in a begin end wrapper etc.works fine in sql*plus, so I guess it must be a preference or sth. in sql*developer:
    SQL> set serverout on
    SQL> create or replace function f1 (r int)
      2    return int
      3  as
      4  begin
      5    dbms_output.put_line ('Hello World ' || r);
      6    return r;
      7  end f1;
      8  /
    Function created.
    SQL>
    SQL> select f1 (rownum) f1 from dual connect by level <= 3
      2  /
            F1
             1
             2
             3
    3 rows selected.
    Hello World 1
    Hello World 2
    Hello World 3
    SQL>

  • BUG : DBMS_OUTPUT.put_line and tabs in sqldeveloper 1.2.1 - build 32.00

    Hi Guys.
    I upgraded from 1.2 and it appears that dbms_output.put_line is now broken.
    Consider the following:
    begin
       dbms_output.put_line('hello world');
    end;Process:
    1. Load SQL Developer
    2. Open a connection to DB
    3. Go to DBMS Output tab
    4. Enable server output
    5. Type in the code (as above)
    6. Hit F5
    The bug/new feature:
    After hitting f5, the DBMS Output tab switches to Script output where by I am presented with "anonymous block completed". In 1.2 (and previous versions) I used to see
    anonymous block completed
    hello world
    in the Script Output tab.
    Now I have to switch back to the DBMS Output tab. My problem with this is that there is far too much clicking. Why redirect me away from the tab that is going to actually display the script output only for me to have to click back into that tab? I just don't get it.
    Regards
    Kristian Jones
    http://kristianjones.blogspot.com
    Message was edited by:
    Kris Jones

    Hi,
    I also have the problem with the new Released.
    SQL Dev 1.2.0.29.98 upgraded with Check for Updates to 1.2.1.32.00
    On Windows XP.
    I did exactly as Kris Jones post, using Run Script
    but, it seems that my SQL Developer doesn't do anything.
    The progress bar is active like processing somthing, well, it processes forever.
    I tried to cancel the process (button Cancel), but the panel shows that it is still trying to cancel the process (all buttons are disabled except Cancel), although I can do another select (use CTRL + Enter because F9 doesn't work) within the same SQL Worksheet and the panel goes back to the active panel again.
    Well, there must be something wrong with the Run Script.
    Since any query or pl/sql block seems running forever if I use Run Script.
    I try on the SQL Developer 1.2.0.29.98 (luckily, I still keep the backup, just in case) and it shows the result as wanted.
    Is there something wrong within my SQL Developer 1.2.0.32.00?
    Or there is some patches which I should download?
    Is it another bug?
    Many thanks,
    Buntoro

  • Dbms_output.put_line  and sqlplus : output truncated to 100 Characters.

    HI all,
    please see the following script where the variable length is more than a 100 charecters...
    When i run this in sqlplus with SERVEROUTPUT ON, i see the ouput being truncated to 100 charecters.
    sql> ed
    Wrote file afiedt.buf
      1  declare
      2     l_var varchar2(400);
      3  begin
      4     l_var := 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh
      5     dbms_output.put_line(length(l_var));
      6     dbms_output.put_line(l_var);
      7* end;
      8  /
    130
    abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvI think I am looking for a sqlplus "SET XXXX..." command, but my search has been futile so far.
    Please advice.
    Thanks,
    John.

    Thanks for your reply .. Frank.
    Sorry... I Previewed the post but did not notice my code being truncated in my sqlplus sesssion.
    The actual script has the output to 130 charecters. but when i close the edit (afeidt.buf) and execute it, the display only shows 100 charecters...
    My SQLPLUS version is 9.2.0.1.
    I am using the "WE8ISO8859P1" charecter set.
    declare
        l_var varchar2(500) := 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz';
    begin
        dbms_output.put_line(length(l_var));
        dbms_output.put_line(l_var);
    end;
    130
    abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
      1  declare
      2      l_var varchar2(500) ;
      3  begin
      4      for i in 1 .. 5 loop
      5          l_var := l_var || 'abcdefghijklmnopqrstuvwxyz';
      6      end loop;
      7      dbms_output.put_line(length(l_var));
      8      dbms_output.put_line(l_var);
      9* end;
    sql> /
    130
    abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv

  • Dbms_output.put_line(v_boolean);

    I have 10.2.0.1.0 on Windows XP.
    Does 10g offers a handy function to print out boolean, such as dbms_output.put_line(v_boolean)?
    Thanks

    782150 wrote:
    I have 10.2.0.1.0 on Windows XP.
    Does 10g offers a handy function to print out boolean, such as dbms_output.put_line(v_boolean)?Nope.
    How about this?
    dbms_output.put_line(CASE WHEN v_boolean THEN 'TRUE' ELSE 'FALSE' END);as you can see below:
    SQL> set serveroutput on
    SQL> declare
      2   v_boolean BOOLEAN := TRUE;
      3  BEGIN
      4   dbms_output.put_line(CASE WHEN v_boolean THEN 'TRUE' ELSE 'FALSE' END);
      5   v_boolean := FALSE;
      6   dbms_output.put_line(CASE WHEN v_boolean THEN 'TRUE' ELSE 'FALSE' END);
      7  end;
      8  /
    TRUE
    FALSE
    PL/SQL procedure successfully completed.

  • Dbms_output.put_line in this query

    I want to put a  dbms_output.put_line in this query so it will give my the property_id is checking first in the PM_EXCHANGE_PROPERTY_PRIORITY
    (its part of a more bigger procedure)
    dbms_output.put_line('RESORT ID  one=> '||rci_dep_rec.resort_id);
            with    
                base_prop as (                                
                    select /*+ MATERIALIZE */ property_id, priority
                    from   PM_EXCHANGE_PROPERTY_PRIORITY ppp
                    where  ppp.exchange_affiliation = 'RCI'
                    and    ppp.master_property_id in (select ppp2.master_property_id
                                                                 from   P_PM_PROPERTY ppp1, PM_EXCHANGE_PROPERTY_PRIORITY ppp2
                                                                 where  ppp1.rci_id_number = rci_dep_rec.resort_id
                                                                 and    ppp1.property_active = 'Y'
                                                                and    ppp1.exchange_affiliation = ppp.exchange_affiliation
                                                                 and    ppp2.property_id = ppp1.property_id)
                    union
                    select property_id, 99999
                    from   P_PM_PROPERTY ppp
                    where  ppp.rci_id_number = rci_dep_rec.resort_id
                    and    ppp.property_active = 'Y'
                    and    not exists (select 1 from PM_EXCHANGE_PROPERTY_PRIORITY ppp1 where ppp1.property_id = ppp.property_id)
                    order by 2
            select pput.pm_unit_type_id
          bulk collect into pm_unit_type_ids
           from   P_PM_UNIT_TYPE pput, S_PM_EXCHANGE_MAPPING spem, base_prop bp
           where  spem.exchange_affiliation = 'RCI'
           and    spem.resortcode = rci_dep_rec.resort_id
           and    ((spem.unitnumber = rci_dep_rec.unit_no and rci_dep_rec.resv_type = 'WEEKS')
                  or  (spem.unitnumber = rci_dep_rec.unit_type and rci_dep_rec.resv_type = 'POINTS'))
           and    rci_dep_rec.start_dt between spem.begin_date and spem.end_date
           and    pput.property_id = spem.property_id
           and    pput.pm_unit_type_active = 'Y'
           and    instr(spem.unittypecode, pput.pm_unit_type) > 0
           and    spem.property_id = bp.property_id
           ORDER BY bp.priority,pput.pm_unit_type_priority;
        end;
         dbms_output.put_line('RESORT ID => '||rci_dep_rec.resort_id);
    but im not sure where i can put ii, i have it to give my the resort_id
    i want to know which one the property_id is checking first, there is only two , one has a higher priority
    for example if i hardcoded it
    select /*+ MATERIALIZE */ property_id, priority
                    from   PM_EXCHANGE_PROPERTY_PRIORITY ppp
                    where  ppp.exchange_affiliation = 'EZY'
                    and    ppp.master_property_id in (select ppp2.master_property_id
                                                                 from   P_PM_PROPERTY ppp1, PM_EXCHANGE_PROPERTY_PRIORITY ppp2
                                                                 where  ppp1.rci_id_number = '8789'
                                                                 and    ppp1.property_active = 'Y'
                                                                and    ppp1.exchange_affiliation = 'RCI,II'
                                                                 and    ppp2.property_id = 'VDG')
            union
                    select property_id, 99999
                    from   P_PM_PROPERTY ppp
                    where  ppp.rci_id_number ='8789'
                    and    ppp.property_active = 'Y'
                    and    not exists (select 1 from PM_EXCHANGE_PROPERTY_PRIORITY ppp1 where ppp1.property_id = 'VDG')
                    order by 2 
    i would get this
       PROPERTY_ID|PRIORITY
        VDR         |1
        VDG         |2
    thanks for help or tips

    Hi Nat,
    Your question is not very clear (other wise you would have an answer from this forum by now).
    What you are showing is an SQL (which is part of bigger picture). Bigger picture is important. Is it a PL/SQL procedure or function?
    DBMS_OUTPUT.PUTLINE is a procedures call, that can be called in PL/SQL. What you have shown us is a SQL from within the PL/SQL.
    Please do NOT paste a larger piece of code.
    The place where you ave shown the DBMSOUTPUT.PUT_LINE seems correct.
    However,
    You said
    but im not sure where i can put ii, i have it to give my the resort_id
    i want to know which one the property_id is checking first, there is only two , one has a higher priority
    The sequence in which rows are processed does NOT matter in SQL and there is no such thing as "checking first". ALL the rows that satisfy the criteria. Since you have ORDER BY the rows will be returned in that order.
    Please explain what problem you are trying to solve.
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    Hope this helps.
    vr,
    Sudhakar

  • DBMS_OUTPUT.PUT_LINE Issue

    Hi All,
    I have created one simple package to create the log file. It's generating the log file but it's not writing anything in the log file. Please let me know what's wrong.
    I'm using Windows 2000 and Oracle 9i
    Here is the Code :
    CREATE OR REPLACE PACKAGE pkg_LoadData AS
    v_exists     BOOLEAN;
    v_error_buf VARCHAR2(100);
    n_retcode     NUMERIC;
    Procedure Sch_A;
    v_MessageLog UTL_FILE.FILE_TYPE;
    END pkg_LoadData;
    CREATE OR REPLACE PACKAGE BODY pkg_LoadData AS
    PROCEDURE Sch_A_Pos_R AS
    v_DBName           VARCHAR2(100);
    v_LogDir          VARCHAR2(100);
    v_LogFileName          VARCHAR2(100);
    v_StartTime     VARCHAR2(100);
    v_EndTime          VARCHAR2(100);
    v_ProcName      VARCHAR2(100) := 'pkgLoadData.Sch_A:';
    v_Space               VARCHAR2(1) := ' ';
    v_Record_Count NUMBER(10) := 0;
    v_FileOpenMode VARCHAR2(1) := 'W'; --Write
    BEGIN
    v_LogFileName := 'status.log';
    IF (UTL_FILE.IS_OPEN(v_MessageLog)) THEN
    DBMS_OUTPUT.PUT_LINE(v_LogFileName || ' file is already opened...');
    ELSE
    v_MessageLog := UTL_FILE.FOPEN('PKGDIR', v_LogFileName, v_FileOpenMode);
    -- PKDIR's value is C:\xxxxx
    DBMS_OUTPUT.PUT_LINE('Opening log file ' || v_LogFileName);
    END IF;
    v_StartTime := 'Procedure ' ||v_ProcName||' started at '|| TO_CHAR(SYSDATE, 'dd-Mon-yy hh:mi:ss');
    DBMS_OUTPUT.PUT_LINE(v_StartTime);     
    v_EndTime := 'Procedure ' || v_ProcName ||' completed at '|| TO_CHAR(SYSDATE, 'dd-Mon-yy hh:mi:ss');
    DBMS_OUTPUT.PUT_LINE(v_EndTime);
    UTL_FILE.FCLOSE(v_MessageLog);
    END Sch_A;
    END pkg_LoadData;
    /

    When I searched init.ora file. I found only one file
    with name init.ora.2102007193333
    in that I have added
    utl_file_dir = *
    Well that looks like a backup file so it'll have no effect.
    Which is probably a good thing, as adding "*" to your utl_file_dir setting opens your operating system up to being hacked!!!
    There is no need, any longer, to set the utl_file_dir parameter, and you should never set it to "*".
    All that is required is to create a directory object on the database and grant the relevant permissions to that object.

Maybe you are looking for

  • Assigning a Sales Order Number to a Purchase Order

    My company has a requirement that for every purchase order we need to identify what sales order was created to generate the PR. I have found that by using the Account Assignment C - Sales Order, this opens the "Account Assignment" Tab and the fields

  • How use class file in jsp(very urgent)

    i have class file called birds (birds is actually a xslt file transformed to java class file) now this class file i have to use in my jsp file. how can i use them. if possible can any one give me sample code please very urgent can any one help me

  • Clear block not working !! help required asap

    We have used clearblock all inside a fix command, it used to work before and when we migrated over to new server it is failing to work. It is not throwing out an error but it is not clearing. I checked the difference at the database level and found t

  • Error verifying signature

    I am getting the following error while invoking the verify signature operation of Livecyle Signature service :  Does anyone have any idea when this error shows up ? PDFSignatureVerificationResult signInfo = signClient.verify( inputPDF, fieldName, Rev

  • Cross schema view insert permission error

    Oracle Database 11g Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production CORE     11.2.0.1.0     Production TNS for 64-bit Windows: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production Hello all. I've got a p