Home » Developer & Programmer » Forms » get value
get value [message #259024] Tue, 14 August 2007 03:54 Go to next message
Rafeek
Messages: 159
Registered: April 2007
Location: egypt
Senior Member
hi all
i use NAME_IN function to get the value of variable in from 6i

example

V_LANGUAGE VARCHAR2(250); BOOLEAN;
BEGIN
V_LANGUAGE := NAME_IN('GLOBAL.LANGUAGE_ID');
end;

can i find any function in pl sql like it ?
thax
raeek
Re: get value [message #259037 is a reply to message #259024] Tue, 14 August 2007 04:45 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
In PL/SQL you define package variables. Those can be public or private. Public variables are defined in the package specification and can be accessed directly. Private variables cannot be accessed directly and are defined in the body. Here's an example:
CREATE OR REPLACE PACKAGE pck_var
IS
   v_public_var VARCHAR2(30);
   FUNCTION get_myvar RETURN VARCHAR2;
   PROCEDURE set_myvar( piv_myval IN VARCHAR2);
END pck_var;
/

CREATE OR REPLACE PACKAGE BODY pck_var
IS
   v_private_var VARCHAR2(30);
   
   FUNCTION get_myvar RETURN VARCHAR2
   IS 
   BEGIN
     RETURN v_private_var;
   END get_myvar;  
   
   PROCEDURE set_myvar( piv_myval IN VARCHAR2)
   IS
   BEGIN
     v_private_var := piv_myval;
   END set_myvar;
END pck_var;
/

set serverout on

Begin
-- set the public variable directly:
  pck_var.v_public_var := 'Hello';
-- set the private variable through the set procedure
  pck_var.set_myvar('world');


-- display the variables
  dbms_output.put_line( -- get the public variable directly:
                        pck_var.v_public_var||' '||
                        -- get the private variable through the function
                        pck_var.get_myvar
                      );
End;
/

DROP PACKAGE pck_var
/


Try the script to see what it does.

MHE
Re: get value [message #259044 is a reply to message #259037] Tue, 14 August 2007 04:57 Go to previous messageGo to next message
Rafeek
Messages: 159
Registered: April 2007
Location: egypt
Senior Member
my variable is :new.col_name in trigger and the cil_name is change

hi all
i use NAME_IN function to get the value of variable in from 6i

example

V_LANGUAGE := NAME_IN(':new.'|| col_name);end;
Cool
can i find any function in pl sql like it ?
thax
raeek
Re: get value [message #259046 is a reply to message #259044] Tue, 14 August 2007 05:00 Go to previous messageGo to next message
Michel Cadot
Messages: 64110
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No there is none.

Regards
Michel
Re: get value [message #259247 is a reply to message #259044] Tue, 14 August 2007 19:17 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have a look at dbms_sql.

David
Re: get value [message #259385 is a reply to message #259037] Wed, 15 August 2007 07:43 Go to previous messageGo to next message
Rafeek
Messages: 159
Registered: April 2007
Location: egypt
Senior Member
i cannt use v_public_var in form 6i
in when-button-pressed (trigger)
pck_var. v_public_var :='eee';

i get error

[Updated on: Thu, 16 August 2007 01:25]

Report message to a moderator

Re: get value [message #260751 is a reply to message #259385] Mon, 20 August 2007 19:11 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Please post all of the code that is in the trigger or procedure. Also post both the error code and the error message that the system is displaying to YOU. We can't see it and unless you tell us what you are seeing we can't help you!

David
Previous Topic: Populate 2nd List while some value selected in First list
Next Topic: How toexecute data by passing new values to a query??
Goto Forum:
  


Current Time: Mon Dec 05 10:59:42 CST 2016

Total time taken to generate the page: 0.25367 seconds