Question

how to transfer a value outside the block?

Asked by: wasabi3689

I am using Oracle 11.3.00 with Oracle 8i

I am adding code into custom.pll to load a value into an Oracle built-in form

if (form_name = 'OEXOEMOE' and block_name = 'ORDER')

then

declare
......

CURSOR c_get_tax_status IS

      select ATTRIBUTE1
      from RA_SITE_USES_ALL rsu
      where rsu.address_id = := name_in('order.address_id') ;
        .......

when I compile, I have the following error,
ERROR 103 at line 511, column 25
  Encountered the symbol "=" when expecting one of the following:
  "(" "-" "+" "all" "mod" "null" <an identifier>
  <a double-quoted string> <a bind variable> <a number>
  <a single-quoted SQL string> "any" "avg" "count" "max"
  "min" "prior" "some" "sql" "stddev" "sum" "variance"
  Replacing "=" with "(".
ERROR 103 at line 511, column 56
  Encountered the symbol ";" when expecting one of the following:
  "." "(" ")" "," "*" "%" "&" "|" "=" "-" "+" "<" "/" ">"
  "in" "mod" "not" "rem" ".." "an exponent (**)"
  "<> or != or ~=" ">=" "<=" <> "and" "or" "like" "between"
  "is null" "is not" "||"
  ) was inserted before ";" to continue.
Closing library CUSTOM...
FRM-30312:Failed to compile the library.

When I comment out this line
-- rsu.address_id = := name_in('order.address_id') ;

even I use this line

rsu.address_id = := order.address_id;

still doesn't work, same error.
it pass

I think maybe something wrong with this line. Can you tell?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-09-07 at 15:32:51ID24713464
Topics

PL / SQL

,

Oracle 8.x

,

Oracle CRM

Participating Experts
5
Points
300
Comments
57

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

    Free Tech Articles

    1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
      It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
    2. SCCM OSD Basic troubleshooting
      SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
    3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
      This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
    4. Create a Win7 Gadget
      This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
    5. Outlook continually prompting for username and password
      There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
    6. Backup Exchange 2010 Information Store using Windows Backup
      There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

    Cloud Class Webinars

    1. Avoiding Bugs in Microsoft Access
      Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
    2. Top 10 Best New Features in Visio 2010
      Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
    3. IT Consultant Business Secrets Revealed
      Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
    4. Disaster Recovery and Business Continuity
      Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
    5. Organize Your Visio Diagrams with Containers and Lists
      Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
    6. How to Us Objects, Properties, Events and Methods in Microsoft Access
      Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

    Join the Community

    Give a Little. Get a Lot.

    Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

    Join the Community

    Answers

     

    by: pratikroyPosted on 2009-09-07 at 21:40:25ID: 25278646

    The line "rsu.address_id = := order.address_id; " has to = signs, one with : and other without :. That is probably your problem (perhaps a typo).

    Try this:
    rsu.address_id  := name_in('order.address_id') ;

     

    by: HenkaPosted on 2009-09-07 at 22:05:12ID: 25278764

    I think that this is correct (without ":") :
    rsu.address_id =  name_in('order.address_id') ;

     

    by: shru_0409Posted on 2009-09-08 at 00:17:51ID: 25279275

    :rsu.address_id := name_in('order.address_id') ;

    TRY THIS

     

    by: nav_kum_vPosted on 2009-09-08 at 03:20:45ID: 25280234

    you can try :

      select ATTRIBUTE1
          from RA_SITE_USES_ALL rsu
          where rsu.address_id =  name_in('order.address_id') ;

    --> := is the assignment operator , it should be used here.

    or try

      select ATTRIBUTE1
          from RA_SITE_USES_ALL rsu
          where rsu.address_id =  :order.address_id

    --> we are using to :blockname.field_name to get the contents , i mean we are not using name_in function here...

     

    by: wasabi3689Posted on 2009-09-08 at 09:57:55ID: 25283821

    When I use this line
    rsu.address_id  := name_in('order.address_id') ;

    I have this error

    Compiling library CUSTOM...
      Invalidating Package Spec CUSTOM......
      Invalidating Package Body CUSTOM......
      Compiling Package Spec CUSTOM......
      Compiling Package Body CUSTOM......
    ERROR 103 at line 516, column 24
      Encountered the symbol "=" when expecting one of the following:
      "." "(" "*" "%" "&" "=" "-" "+" ";" "<" "/" ">" "for" "in"
      "mod" "not" "rem" "an exponent (**)" "<> or != or ~=" ">="
      "<=" <> "and" "or" "like" "between" "group" "having"
      "intersect" "minus" "order" "union" "where" "connect"
      "is null" etc.
      Replacing "=" with ".".
    Closing library CUSTOM...
    FRM-30312:Failed to compile the library.

    When I use this line
    rsu.address_id =  name_in('order.address_id') ;

    I have this error

    Compiling library CUSTOM...
      Invalidating Package Spec CUSTOM......
      Invalidating Package Body CUSTOM......
      Compiling Package Spec CUSTOM......
      Compiling Package Body CUSTOM......
    ERROR 231 at line 516, column 26
      function 'NAME_IN' may not be used in SQL
    ERROR 0 at line 514, column 2
      SQL Statement ignored
    ERROR 320 at line 0, column 0
      the declaration of the type of this expression is incomplete or malformed
    ERROR 0 at line 549, column 9
      SQL Statement ignored
    Closing library CUSTOM...
    FRM-30312:Failed to compile the library.

    When I use this line
    :rsu.address_id := name_in('order.address_id') ;

    I have this error

     Compiling Package Body CUSTOM......
    ERROR 49 at line 516, column 8
      bad bind variable ''
    ERROR 103 at line 516, column 9
      Encountered the symbol "RSU" when expecting one of the following:
      "." "(" "*" "%" "&" "=" "-" "+" ";" "<" "/" ">" "for" "in"
      "mod" "not" "rem" "an exponent (**)" "<> or != or ~=" ">="
      "<=" <> "and" "or" "like" "between" "group" "having"
      "intersect" "minus" "order" "union" "where" "connect"
      "is null" etc.
      Resuming parse at line 516, column 54.
    ERROR 103 at line 562, column 5
      Encountered the symbol "IF" when expecting one of the following:
            a PL/SQL variable or double-quoted string
            a function name (an identifier or operator symbol)
            an operator symbol
            an optional designator
            a key word
      Resuming parse at line 562, column 7.
    Closing library CUSTOM...
    FRM-30312:Failed to compile the library.

    When I use this line
    rsu.address_id =  :order.address_id;

    I have this error

    Compiling library CUSTOM...
      Invalidating Package Spec CUSTOM......
      Invalidating Package Body CUSTOM......
      Compiling Package Spec CUSTOM......
      Compiling Package Body CUSTOM......
    ERROR 49 at line 516, column 26
      bad bind variable ''
    ERROR 103 at line 516, column 32
      Encountered the symbol "." when expecting one of the following:
      "by"
      Replacing "." with "by".
    Closing library CUSTOM...
    FRM-30312:Failed to compile the library.

    All not working

     

    by: flow01Posted on 2009-09-08 at 15:08:29ID: 25286580

    In a pll you can't  refer directly to the blocks in a form.
    You have to use the name_in.

    I didn't know the name_in could not be used in sql .
    So try to avoid it:

    CURSOR c_get_tax_status (p_address_id number) IS

          select ATTRIBUTE1
          from RA_SITE_USES_ALL rsu
          where rsu.address_id = p_address_id;

    change your
    OPEN c_get_tax_status;
    to
    OPEN c_get_tax_status(name_in('order.address_id') );
            .......

     

    by: wasabi3689Posted on 2009-09-08 at 16:25:08ID: 25287041

    it pass compling

    But when I open the form, it has this error

    Form-40105: unable to resolve reference to  item ORDER.ADDRESS_ID

    Does it mean there is no address_id item in order block?

     

    by: nav_kum_vPosted on 2009-09-08 at 18:21:28ID: 25287578

    yes..can you double check this is there ...Does it mean there is no address_id item in order block?

     

    by: wasabi3689Posted on 2009-09-08 at 20:48:43ID: 25288092

    Ok, I modify my query, it passed. However, it cannot pass the value to the form. It's supposed to have a value but it's nothing, I put
    message(p_tax_status);

    and nothing shown up

    how to debug this? Is it possible to have message and value shown up in the command prompt?, instead popped up with the application.

     

    by: HenkaPosted on 2009-09-08 at 22:17:01ID: 25288421

    Are you sure there is value there ? You can try to set the value directly and see if message will display it.

     

    by: wasabi3689Posted on 2009-09-09 at 08:32:23ID: 25292346

    yes, there is a value there. I query it, it's a result. How to directly set a value? from the query or from where?

    if (p_tax_status is not null ) then

       Copy( p_tax_status,'order.Attribute14');
     
        else
             null;
      end if;

    when I change

      Copy( 'ABC','order.Attribute14');

    it shows up on the form 'ABC'

     

    by: wasabi3689Posted on 2009-09-09 at 08:43:07ID: 25292455

    something wrong with

     Copy( p_tax_status,'order.Attribute14');???

     

    by: wasabi3689Posted on 2009-09-09 at 08:57:06ID: 25292598

    let me correct one thing


    Copy( 'ABC','order.Attribute14');

    still not shown ABC in the field. Seems something wrong with Copy( p_tax_status','order.Attribute14');

     

    by: wasabi3689Posted on 2009-09-09 at 09:20:47ID: 25292842

    Here is what I test. I input message here

    if (p_tax_status is not null ) then

          message('inside if');
       Copy( p_tax_status,'order.Attribute14');
     
        else
          message('else here');
             null;
      end if;

    After I assign a value to

          select rsu.ATTRIBUTE1
            from RA_SITE_USES_ALL rsu
            where rsu.LOCATION=985290  --p_ship_to_location
          and rsu.SITE_USE_CODE='SHIP_TO';

    message inside if popped up, a value copy to the field on the form

    If I use  rsu.LOCATION=p_ship_to_location

    message else here popped up, there is no value assigned to copy to the field on the form

    I think statement Copy( p_tax_status,'order.Attribute14'); seems fine, I don't know why after putting  rsu.LOCATION=p_ship_to_location, no value??

     

    by: wasabi3689Posted on 2009-09-09 at 12:32:14ID: 25294726

    here is my complete code.

    can I use sql in custom.pll?

    if (form_name = 'OEXOEMOE' and block_name = 'ORDER'
    and name_in('SYSTEM.RECORD_STATUS') <> 'QUERY')
     
    then
     
    declare
     
         p_tax_status varchar2(100);
    		
       CURSOR c_get_tax_status (p_ship_to_location number) IS
     
    	select rsu.ATTRIBUTE1
            from RA_SITE_USES_ALL rsu 
            where rsu.LOCATION=p_ship_to_location  --985290
    	and rsu.SITE_USE_CODE='SHIP_TO';
     
     begin 
            --open c_get_tax_status;
    	OPEN c_get_tax_status(name_in('order.ship_to_location') );
            fetch c_get_tax_status into p_tax_status;          
    	close c_get_tax_status;
     
      if (p_tax_status is not null ) then
     
       Copy( p_tax_status,'order.Attribute14');
      
        else
             null;
      end if;
     
     end;
     
    end if;
    
                                                  
    1:
    2:
    3:
    4:
    5:
    6:
    7:
    8:
    9:
    10:
    11:
    12:
    13:
    14:
    15:
    16:
    17:
    18:
    19:
    20:
    21:
    22:
    23:
    24:
    25:
    26:
    27:
    28:
    29:
    30:
    31:
    32:
    33:
    

    Select allOpen in new window

     

    by: nav_kum_vPosted on 2009-09-09 at 18:52:23ID: 25296922

    before u open the cursor, again put a display message to display the content of the variable p_ship_to_location  and see first whether it has a value or not because this is very important otherwise your cursor select will not return any records right.

     

    by: wasabi3689Posted on 2009-09-09 at 20:34:02ID: 25297246

    Do you mean put a message like below?

    message (p_ship_to_location);

    CURSOR c_get_tax_status (p_ship_to_location number) IS
     
            select rsu.ATTRIBUTE1
            from RA_SITE_USES_ALL rsu
            where rsu.LOCATION=p_ship_to_location  --985290
            and rsu.SITE_USE_CODE='SHIP_TO';
     .....

     

    by: wasabi3689Posted on 2009-09-09 at 20:53:03ID: 25297297

    This ticket is 200 points now

    I develop something like this

    fnd_message.set_string(' name_in = ' || name_in( 'order.ship_to_location') );

    or

    message ( name_in( 'order.ship_to_location')  );

    all got complier error like

    ERROR 103 at line 534, column 8
      Encountered the symbol "=" when expecting one of the following:
      "constant" "exception" <an identifier>
      <a double-quoted string> "table"
      Replacing "=" with "constant".
    Closing library CUSTOM...
    FRM-30312:Failed to compile the library.

     

    by: nav_kum_vPosted on 2009-09-09 at 21:02:49ID: 25297331

    try....

    if (form_name = 'OEXOEMOE' and block_name = 'ORDER'
    and name_in('SYSTEM.RECORD_STATUS') <> 'QUERY')
     
    then
     
    declare
     
         p_tax_status varchar2(100);
                
       CURSOR c_get_tax_status (p_ship_to_location number) IS
     
          select rsu.ATTRIBUTE1
            from RA_SITE_USES_ALL rsu
            where rsu.LOCATION=p_ship_to_location  --985290
          and rsu.SITE_USE_CODE='SHIP_TO';
     
     begin
            --open c_get_tax_status;
        -- adding a message here....
    message ( 'my message is :' || name_in( 'order.ship_to_location')  );

          OPEN c_get_tax_status(name_in('order.ship_to_location') );
            fetch c_get_tax_status into p_tax_status;          
          close c_get_tax_status;
     
      if (p_tax_status is not null ) then
     
       Copy( p_tax_status,'order.Attribute14');
     
        else
             null;
      end if;
     
     end;
     
    end if;
     
    Open in New WindowSelect All

     

    by: wasabi3689Posted on 2009-09-09 at 21:30:58ID: 25297416

    Ok, when I open the form, my message is

    it's return nothing, it's empty

     

    by: nav_kum_vPosted on 2009-09-09 at 21:40:32ID: 25297440

    does the value  gets set for this 'order.ship_to_location' by the time our code gets executed or how is that ?

     

    by: wasabi3689Posted on 2009-09-10 at 07:53:12ID: 25300805

    I add more message like below

    message ( 'order.ship_to_location before fetch is :' || name_in( 'order.ship_to_location')  );
            --open c_get_tax_status;
          OPEN c_get_tax_status(name_in('order.ship_to_location') );
            fetch c_get_tax_status into p_tax_status;          
          close c_get_tax_status;

           message ( 'order.ship_to_location is after fetch :' || name_in( 'order.ship_to_location')  );
           message ( 'p_tax_status is :' || p_tax_status  );

    When I open the form, the messages popped up. I don't see any values assigned. When I query the form, I don't see values assigned. When I put rsu.LOCATION=985290, I can see p_tax_status is:NON_TAXABLE but there are nothing for order.ship_to_location is before fetch : or order.ship_to_location is after fetch :

     

    by: nav_kum_vPosted on 2009-09-10 at 18:09:57ID: 25306003

    can you attach the custom.pld code here so that i can see how some block.field name is referenced in the custom.pld...i do not need .pll because that is not ascii readable text. I need .pld file which is ascii readable.

     

    by: wasabi3689Posted on 2009-09-13 at 20:20:01ID: 25322831

    Can you tell me how to read it? and I can tell you the information. The file is too big and also with other programming not related to my work if I send to you.

     

    by: nav_kum_vPosted on 2009-09-13 at 20:22:51ID: 25322837

    because i was not able to let you know how to read it and make you understand on how you need to do it.. i asked for the .pld file., so that i can see whether i will be able to help

     

    by: wasabi3689Posted on 2009-09-16 at 14:42:34ID: 25350513

    Hi, I got a major progress finally and I can copy a flexifled value from one form to other now. The only problem is

    each time I open the form, I did not make any changes and just view a record, then close it. it pops up a message
    "Do you want to save the changes you have made" Yes, No, Cancel
    If select Yes, the last_updated_date and user_id will be updated automatically
    If select No, I can exit the form.

    If I click on a record to pop up another related form, then close it. I have this message popped up as attached file.

    I add more code to it, but it still have this message shown up. How to fix it

    I want to get rid of these message. But, I don't know how??

    Hi flow01 and nav_kum_v,

    Both of you code hit the point. But, I just choose the wrong ID. Now I choose the right block id and create a stored procedure for the sql and pass/return the values back to it.also, I add this line
    and name_in('SYSTEM.RECORD_STATUS') <> 'CHANGE'
     It work!

    Attached is the whole code  for you to take a look.

    I again increase 50 points to this request. Now the ticket is

    if form_name = 'OEXOEMOE' and block_name = 'ORDER' 
       and name_in('SYSTEM.RECORD_STATUS') <> 'CHANGE' 
     
    then
     
      declare
      
      p_tax_status varchar2(100);
      p_ship_to_site_use_id number;
     
      begin  
      
       p_ship_to_site_use_id := name_in('order.ship_to_site_use_id');
     
       XX_ORDERS_PKG.populate_taxstatus_flexfield(p_ship_to_site_use_id, p_tax_status);
       
    	    if p_tax_status is not null then
    		
    		 copy( p_tax_status, 'order.attribute14' );
    		 --Copy( '10'  , 'System.Message_Level' );
                  	 --COMMIT_FORM;
     
    	    if (event_name='Key-Exit')or(event_name='On-Close')
     
    	    Then
    		BEGIN
        			EXIT_FORM(NO_VALIDATE, NO_COMMIT);
    		END;
     
    		declare
      			v_errmsg varchar2(255) := error_text;
      			v_errcod NUMBER(5) := error_code;
    		begin
      			IF v_errcod = 40400 THEN
         				NULL;
      			ELSE
        				message(v_errmsg);
      			END IF;
    		end;
    	     end if;	    
     
    	    end if;
      end;
    end if;
                                                  
    1:
    2:
    3:
    4:
    5:
    6:
    7:
    8:
    9:
    10:
    11:
    12:
    13:
    14:
    15:
    16:
    17:
    18:
    19:
    20:
    21:
    22:
    23:
    24:
    25:
    26:
    27:
    28:
    29:
    30:
    31:
    32:
    33:
    34:
    35:
    36:
    37:
    38:
    39:
    40:
    41:
    42:
    43:
    44:
    

    Select allOpen in new window

     

    by: nav_kum_vPosted on 2009-09-16 at 21:22:48ID: 25352865

    i do not remember exactly but there is something for 'SYSTEM.BLOCK_STATUS' checking the block status also.  

    also the whole code is in the which trigger ? i mean when validate item or new item instance or new block instance etc ?

     

    by: HenkaPosted on 2009-09-17 at 00:21:41ID: 25353492

    Message FRM-40400 is only informative, so you can suppress it by setting :system.message_level to a higher value:
    Cause:  Save complete. Action:  No action is necessary. Level:  5 Type:  Informative

    So in the beginning of your code use this:
    :system.message_level:='10';

    Also you can read "Working with Forms Runtime Messages" in the on-line help.

     

    by: wasabi3689Posted on 2009-09-17 at 07:25:25ID: 25356598

    Do you mean putting this line before declare?
    ....
    :system.message_level:='10';

      declare

    ....

    I got a complier error

    ERROR 49 at line 507, column 2
      bad bind variable ''
    ERROR 103 at line 507, column 3
      Encountered the symbol "SYSTEM" when expecting one of the following:
      ":=" "." "(" "%" ";" "indicator"
      . was inserted before "SYSTEM" to continue.
    Closing library CUSTOM...
    FRM-30312:Failed to compile the library.

     

    by: wasabi3689Posted on 2009-09-17 at 08:52:30ID: 25357558

    Ok, I am able to get rid of one message like I attached image shown after I put

    if p_tax_status is not null then
                 copy( p_tax_status, 'order.attribute14' );
                 copy( '10'  , 'System.Message_Level' );
              end if;

    But, after I close each form, I still have this following  message asked, even I don't change anything

    "Do you want to save the changes you have made" Yes, No, Cancel

     

    by: wasabi3689Posted on 2009-09-17 at 09:41:40ID: 25358161

    according to http://www.orafaq.com/forum/t/55789/2/,  I add the following to the code


                if name_in('SYSTEM.RECORD_STATUS') = 'CHANGED' then
                    COMMIT;
                  END IF;
     
    When I open the form and find a record, it has this message popped up as attached image. I click on OK but it never give me to close the form anymore

     

    by: nav_kum_vPosted on 2009-09-17 at 18:20:32ID: 25362418

    you cannot use  any restricted builtins in the validation triggers. you also cannot use go_block(..), go_item(..) are also restricted

     

    by: wasabi3689Posted on 2009-09-17 at 18:38:39ID: 25362459

    So, what is your solution? how to get rid of this message

    One quick question, can I do this statement

    copy( ' ', 'order.attribute14' );

    copy an empty value to 'order.attribute14, it seems it doesn't work, right?

     

    by: HenkaPosted on 2009-09-17 at 22:52:00ID: 25363174

    Is it about this message " "Do you want to save the changes you have made" Yes, No, Cancel " ? If it is so, then it means that in your form there is at least one record with status NEW or UPDATE. Do you want to change records in this form ? If yes then the message is right. If no then you ought to see post-query triggers and if there are any assignments then put
    set_record_property(:system.trigger_record,:system.trigger_block,status,QUERY_STATUS);
    at the end of code.

    To your quick question about copy( ' ', 'order.attribute14' ) - this is all right. If you use this statement and the item is not empty then there is another problem.

     

    by: wasabi3689Posted on 2009-09-18 at 10:00:21ID: 25367833

    This is non-customized form, I cannot see/change post-query trigger. I am modifying custom.pll to copy a flexfield from customer form to another flexfield on order form. That probably ask me if saved. The answer is no. How can do set_record_property(:system.trigger_record,:system.trigger_block,status,QUERY_STATUS in my code shown above

    I increase 50 points for this since this is additional question, but in the same project and related
    copy( ' ', 'order.attribute14' ) seems not working. But when I assign a value to '', it works - copy( 'N/A ', 'order.attribute14' )


    My question is if I can make it invisible when order.attribute14 = N/A. Sounds I need some formatting line. Here is the code

     if (p_tax_status is not null and p_ship_to_location is not null)  then

                 copy( p_tax_status, 'order.attribute14' );

               elsif (p_tax_status is null and p_ship_to_location is not null) then
                
                copy( 'N/A', 'order.attribute14' );
                
                      if (name_in('order.attribute14')= 'N/A') then
                            name_in('order.attribute14')='';
                      end if;

    My formatting part for N/A is not working, any advice?

     

    by: wasabi3689Posted on 2009-09-18 at 12:25:38ID: 25369140

    I use the following, still cannot erase

                --copy( 'N/A', 'order.attribute14' );
                   --copy( null, 'order.attribute14' );
                --ERASE ('order.attribute14');
                --DEFAULT_VALUE(null,'order.attribute14');

     

    by: nav_kum_vPosted on 2009-09-18 at 19:34:07ID: 25371286

    copy( null, 'order.attribute14' );--> i think this should work

    or try...

    name_in('order.attribute14'):=null;

     

    by: wasabi3689Posted on 2009-09-18 at 20:06:32ID: 25371378

    I tried copy( null, 'order.attribute14' );--> doesn't work



    then I tried name_in('order.attribute14'):=null;
    I have this error when I complie


    ERROR 220 at line 532, column 3
      simple name required in this context
    ERROR 0 at line 532, column 3
      Statement ignored
    Closing library CUSTOM...
    FRM-30312:Failed to compile the library.

     

    by: wasabi3689Posted on 2009-09-20 at 11:03:18ID: 25378235

    seems other people have the similar problem, but no solution

    http://oracle.ittoolbox.com/groups/technical-functional/oracle-dev-l/null-value-is-not-copied-to-descriptive-flex-field-through-custompll-2001912

    Null value is not copied to descriptive flex field through CUSTOM.pll

     

    by: HenkaPosted on 2009-09-20 at 22:42:06ID: 25380480

    "How can do set_record_property(:system.trigger_record,:system.trigger_block,status,QUERY_STATUS in my code shown above" - you can try this:

    if (p_tax_status is not null and p_ship_to_location is not null)  then
                 copy( p_tax_status, 'order.attribute14' );
    elsif (p_tax_status is null and p_ship_to_location is not null) then          
                copy( 'N/A', 'order.attribute14' );            
                if (name_in('order.attribute14')= 'N/A') then
                     name_in('order.attribute14')='';
                end if;
    end if;
    set_record_property(:system.trigger_record,:system.trigger_block,status,QUERY_STATUS);

    2) you can try this with NULL value:
    v_null:=null;
    copy(NAME_IN(v_null), 'order.attribute14' );

    By the way: is order.attribute14 an required item or not ? Because if it is the required item then I think that copying NULL value will be unsuccessfull.

     

    by: wasabi3689Posted on 2009-09-21 at 08:04:37ID: 25383635

    1). I have complie error

    ERROR 103 at line 551, column 24
      Encountered the symbol "SYSTEM" when expecting one of the following:
      "." "(" ")" "," "*" "%" "&" "|" "=" "-" "+" "<" "/" ">"
      "in" "mod" "not" "rem" ".." "an exponent (**)"
      "<> or != or ~=" ">=" "<=" <> "and" "or" "like" "between"
      "is null" "is not" "||" "indicator"
      . was inserted before "SYSTEM" to continue.
    ERROR 103 at line 551, column 47
      Encountered the symbol "SYSTEM" when expecting one of the following:
      "." "(" ")" "," "*" "%" "&" "|" "=" "-" "+" "<" "/" ">"
      "in" "mod" "not" "rem" ".." "an exponent (**)"
      "<> or != or ~=" ">=" "<=" <> "and" "or" "like" "between"
      "is null" "is not" "||" "indicator"
      . was inserted before "SYSTEM" to continue.
    Closing library CUSTOM...
    FRM-30312:Failed to compile the library.

    It seems these either lines
     name_in('order.attribute14')='';
    or
    set_record_property(:system.trigger_record,:system.trigger_block,status,QUERY_STATUS);

    cannot be accepted. After I comment out them, it pass

    2). I have this error popped after I query a record on the form

    FRM-40738:Argument 1 to builtin Name_IN canot not be null

    3) I have turned off  order.attribute14 required

     

    by: HenkaPosted on 2009-09-22 at 00:11:24ID: 25390240

    This is completly wrong
    name_in('order.attribute14')='';

    my_variable:=name_in('order.attribute14'); -- here my_variable gets the value of order.attribute14

    But in the library (pll) you must use COPY, if you want to set  order.attribute14 to ''
    COPY('',name_in('order.attribute14'));

    2)
    set_record_property(:system.trigger_record,:system.trigger_block,status,QUERY_STATUS);
    I have forgotten to write that in pll you must use instead of system variables - these are known in form - some variables from your library or directly
    set_record_property('1','my_block',status,QUERY_STATUS);

     

    by: wasabi3689Posted on 2009-09-22 at 08:38:55ID: 25394079

    Sorry, I don't follow. Can you provide a complete code again for option 1 and option 2? Thanks

     

    by: HenkaPosted on 2009-09-22 at 22:32:38ID: 25400243

    "1). I have complie error ...
    name_in('order.attribute14')='';
    or
    set_record_property(:system.trigger_record,:system.trigger_block,status,QUERY_STATUS);
    cannot be accepted."
    =>
    set_record_property(:system.trigger_record,:system.trigger_block,status,QUERY_STATUS);
    I have forgotten to write that in pll you must use instead of system variables - these are known in form - some variables from your library or directly
    set_record_property('1','order',status,QUERY_STATUS);
    if the name of block is order. But I think that in the custom.pll there are some variables pointed to triggered block and record.

    "After I comment out them, it pass

    2). I have this error popped after I query a record on the form

    FRM-40738:Argument 1 to builtin Name_IN canot not be null"

    This is completly wrong
    name_in('order.attribute14')='';
    It ought to be like this:
    my_variable:=name_in('order.attribute14'); -- here my_variable gets the value of order.attribute14

    But in the library (pll) you must use COPY, if you want to set  order.attribute14 to ' '
    COPY(' ',name_in('order.attribute14'));


     

    by: wasabi3689Posted on 2009-09-25 at 14:09:11ID: 25427276

    still doesn't work.still cannot copy a null or display a null value to  order.attribute14

    Here is my code
    ....
      my_variable VARCHAR2(100);

    ...
    my_variable:=name_in('order.attribute14');

    if (p_tax_status is not null and p_ship_to_location is not null)  then

                   copy( p_tax_status, 'order.attribute14' );
                   copy( '10'  , 'System.Message_Level' );

              elsif (p_tax_status is null and p_ship_to_location is not null) then

                copy( 'N/A', 'order.attribute14' );            
                      if (name_in('order.attribute14')= 'N/A') then
                      
                      name_in('order.attribute14')='';
                      COPY(my_variable, name_in('order.attribute14'));
                      end if;*/

              end if;
                
                set_record_property('1','order',status,QUERY_STATUS);
                

     

    by: wasabi3689Posted on 2009-09-27 at 19:03:49ID: 25436381

    Hi everyone,

    Let's forget the point how to fix copy a null value to a flexfield.I think it's a bug in Oracle form and it's not fixable. I have found a way to get around it. I use N/A to represent null, not use null. It works fine and my team is OK with it.

    Now, let's focus on this problem. I still have this message "Do you want to save the changes you have made" Yes, No, Cancel " ? bother me when I close the form.

    How to get rid of this message when I close the form

    IF name_in('SYSTEM.RECORD_STATUS') = 'CHANGED'
                and event_name = 'WHEN-VALIDATE-RECORD'
                then
                      
                      EXIT_FORM(NO_COMMIT, NO_VALIDATE);
                      
    end if;

    If I put the following code, it will come another message "close form" yes, no, cancel and the tool message bar will come up

    frm-40737:illegal restricted procedure exit_form in when-validate-record trigger

    So, how to fix this problem - get rid of message
    "Do you want to save the changes you have made" Yes, No, Cancel " ?
    or
    frm-40737:illegal restricted procedure exit_form in when-validate-record trigger

     

    by: HenkaPosted on 2009-09-27 at 22:52:08ID: 25436912

    Your problem is caused by changing the status of record from QUERY to CHANGED. I think that it is done by your new added code
    ...
    copy( p_tax_status, 'order.attribute14' );
    ...
    Here you change the value of item attribute14 in block order.
    If you don't want to save changes then you must change the status of record programmatically from changed to query by this statement:
    set_record_property('1','order',status,QUERY_STATUS); -- here I put '1' as record number
    This statement you can put at the end of your new code.

    This part of code is incorrect
    IF name_in('SYSTEM.RECORD_STATUS') = 'CHANGED'
                and event_name = 'WHEN-VALIDATE-RECORD'
                then
                       
                      EXIT_FORM(NO_COMMIT, NO_VALIDATE);
                     
    end if;
    so put it away.

     

    by: wasabi3689Posted on 2009-09-28 at 15:21:10ID: 25444126

    Still doesn't work

    I use your line set_record_property('1','order',status,QUERY_STATUS);

    When I open the form and query a record like customer_number, I cannot input the whole number such as 667654, the field only shown one digit in a second, I cannot query this record by query->enter. I don't understand what '1' used for.  You mentioned in your previous mail "these are known in form - some variables from your library or directly.." what doesn't mean?

    Then I use the following code,

    Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'),
                           NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
                           STATUS,
                           QUERY_STATUS);

    It has the same problem as i use '1' line you gave me.

    The I use




     IF name_in('SYSTEM.RECORD_STATUS') = 'CHANGED' and
                event_name = 'WHEN-VALIDATE-RECORD' then

                       Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'),
                           NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
                           STATUS,
                           QUERY_STATUS);

                   END IF;

    It works and the asking save message is gone. But the problem is when I want to change an existing  record and save it, it cannot allow me to do that and come up with the error as attached. When I hit Ok, still cannot save.

    What I want is when I don't change anything and just view the data and close the form, no asking save. But if I update an existing record and either go action-> or directly close the form, will ask me if wanting to save the record.

    I guess I need to switch around the mode changed->query->new...But I cannot overcome this error message or asking save message popped up even I don't change anything.

     

    
    if (form_name = 'OEXOEMOE' and block_name = 'ORDER') 
     
    then 
     
      declare
      
      p_tax_status varchar2(100);
      p_ship_to_site_use_id number;
      p_ship_to_location varchar2(100);
     
      begin  
    		
     
       	p_ship_to_site_use_id := name_in('order.ship_to_site_use_id');
    	p_ship_to_location := name_in('order.ship_to_location');
            
       	XX_ORDERS_PKG.populate_taxstatus_flexfield(p_ship_to_site_use_id, p_tax_status);
            
     
          	   if (p_tax_status is not null and p_ship_to_location is not null)  then
     
     
    		   copy( p_tax_status, 'order.attribute14' );
    		   --copy( '10'  , 'System.Message_Level' );
     
    	    elsif (p_tax_status is null and p_ship_to_location is not null) then
     
    		copy('N/A', 'order.attribute14');	
    		--copy( '10'  , 'System.Message_Level' );		
     
    	    end if;
     
    		
      end;
     
     
    		/*Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'), 
                           NAME_IN ('SYSTEM.TRIGGER_BLOCK'), 
                           STATUS, 
                           QUERY_STATUS);*/
    	
    		
    		
    		/*IF name_in('SYSTEM.RECORD_STATUS') = 'CHANGED' and 
    		event_name = 'WHEN-VALIDATE-RECORD' then
     
     
    		       Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'), 
                           NAME_IN ('SYSTEM.TRIGGER_BLOCK'), 
                           STATUS, 
                           QUERY_STATUS);
     
    		ELSIF name_in('SYSTEM.RECORD_STATUS') = 'QUERY' and 
    		event_name = 'WHEN-NEW-ITEM-INSTANCE' then
     
    			Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'), 
                           NAME_IN ('SYSTEM.TRIGGER_BLOCK'), 
                           STATUS, 
                           QUERY_STATUS);
    		
      		 END IF; */	
     
     
    end if;
                                                  
    1:
    2:
    3:
    4:
    5:
    6:
    7:
    8:
    9:
    10:
    11:
    12:
    13:
    14:
    15:
    16:
    17:
    18:
    19:
    20:
    21:
    22:
    23:
    24:
    25:
    26:
    27:
    28:
    29:
    30:
    31:
    32:
    33:
    34:
    35:
    36:
    37:
    38:
    39:
    40:
    41:
    42:
    43:
    44:
    45:
    46:
    47:
    48:
    49:
    50:
    51:
    52:
    53:
    54:
    55:
    56:
    57:
    58:
    59:
    60:
    61:
    62:
    63:
    64:
    65:
    

    Select allOpen in new window

     

    by: HenkaPosted on 2009-09-28 at 22:08:04ID: 25446173

    '1' means record number -> see SET_RECORD_PTOPERTY built-in in the on-line help. But I see that you have resolved problem by using NAME_IN:
    Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'),
                           NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
                           STATUS,
                           QUERY_STATUS);

    To FRM-40654 (from the Forms help):

    Cause:  Another user has updated this record since you performed a query and has changed at least one field in the record. Your actions have not changed the record in memory.

    Action:  You can update or delete this record now only if another user has restored the field values back to the way they were when you performed the query. Otherwise, you must re-query to fetch and display the new record into the form before you can update or delete it.

    Level:  20
    Type:  Error

     

    by: wasabi3689Posted on 2009-09-29 at 07:46:44ID: 25449611

    so, what is the solution? and how to modify the code?

     

    by: HenkaPosted on 2009-09-29 at 22:38:53ID: 25455874

    It is difficult to say what you can do.
    Where is this code ?
    IF name_in('SYSTEM.RECORD_STATUS') = 'CHANGED' and
                event_name = 'WHEN-VALIDATE-RECORD' then

                       Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'),
                           NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
                           STATUS,
                           QUERY_STATUS);

                   END IF;

    I think that if it is coming during WHEN-VALIDATE-RECORD trigger is firing then it is the problem (FRM-40654 error).
    All you can do is debug your form.

     

    by: wasabi3689Posted on 2009-09-30 at 15:11:07ID: 25464166

    this code is located in custom.pll.

    Yes, you are right. it's coming during WHEN-VALIDATE-RECORD trigger is firing then it is the problem (FRM-40654 error).

    Debug my form? this is difficult

    The form is not custom form and it's built-in form and how can I debug the form? Do you have other solution to get rid of "Do you want to save the changes you have made" Yes, No, Cancel " ? but at the same time, I can update/change a existing record?

     

    by: HenkaPosted on 2009-09-30 at 22:33:21ID: 25466174

    I think that if you change item's value then "Do you want to save ..."  will always come.
    So I would put away
    Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'),
                           NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
                           STATUS,
                           QUERY_STATUS);
    so user can update the existing record.

     

    by: wasabi3689Posted on 2009-10-01 at 07:36:04ID: 25469102

    But, the problem is when user just look at the record and don't make any changes, this message will always there too if I remove the set_record_property.

     

    by: HenkaPosted on 2009-10-01 at 22:31:13ID: 25475383

    Yes, it is true. But if you change the item's value then it is changed item.

    I ask you
    "Where is this code called from ?
    IF name_in('SYSTEM.RECORD_STATUS') = 'CHANGED' and
                event_name = 'WHEN-VALIDATE-RECORD' then

                       Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'),
                           NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
                           STATUS,
                           QUERY_STATUS);

                   END IF;
    "
    I know that it is located in custom.pll.

    When and where you use your new code ?

    The best you can do is calling your code in when-new-form-instance trigger after execute_query or in a post-query trigger.You have to remove
                event_name = 'WHEN-VALIDATE-RECORD'
    from the condition.

     

    by: wasabi3689Posted on 2009-10-06 at 14:48:22ID: 25510276

    Ok, after I put the following code, without using this

    Set_Record_Property (NAME_IN ('SYSTEM.TRIGGER_RECORD'),
                           NAME_IN ('SYSTEM.TRIGGER_BLOCK'),
                           STATUS,
                           QUERY_STATUS);

    everything seems working now.

     if (p_tax_status is not null and p_ship_to_location is not null
                and name_in('SYSTEM.RECORD_STATUS') = 'CHANGED'  
                and event_name = 'WHEN-VALIDATE-RECORD' )  then


                   copy( p_tax_status, 'order.attribute14' );
          

              elsif (p_tax_status is null and p_ship_to_location is not null
                and name_in('SYSTEM.RECORD_STATUS') = 'CHANGED'  
                and event_name = 'WHEN-VALIDATE-RECORD' ) then

                copy('N/A', 'order.attribute14');      
                

              end if;

    So, I will wait for few days for testing and will close this ticket with points for every one.

     

    by: wasabi3689Posted on 2009-10-08 at 09:33:16ID: 31625837

    Althought your answers are not exact to the solution, your inputs either hit the edge of the solution or provide valuable clues for me to try.

    Thank you so much.

    20120131-EE-VQP-002

    3 Ways to Join

    30-Day Free Trial

    The Experts

    98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

    He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

    The Experts

    97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

    The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

    Testimonials

    "...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

    Testimonials

    "I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

    Testimonials

    "WOW! You guys have great, active, and knowledgeable people on here." moore50

    Business Clients

    Business Clients

    In the Press

    "If you’ve got a question... Experts Exchange can supply an answer.”

    In the Press

    "...an invaluable aid for both IT professionals and those who require tech support."

    In the Press

    "where IT professionals provide quick answers on just about any topic"

    Business Account Plans

    Loading Advertisement...