How to prefix schema name to a called procedure?
Hi,
I have five different schemas and each and every schema has the same procedures and same set of tables.
In calling procedure, there is one IN parameter which is schema name. In this procedure I am calling another procedure. In this scenario how to prefix schema name parameter to the called procedure?
Urgent please.
Thank you.
Make use of Package constants:
[list]
[*]Create a package specification in each schema called REGION.
[*]Create a Package specification constant CURRENT_SCHEMA string literal equal the owner of the REGION package.
[*]This very very simple package (with no body) will be different in each of your five schemas. You must not transport this package between schemas.
[*]For the procedures you are calling, redefine the argument of schema_name with a DEFAULT REGION.CURRENT_SCHEMA value. This should give you what you are looking to do - making all the procedure code (except for the REGION package spec) portable between the schema.
[list]
Similar Messages
-
How to find the name of the calling procedure
Hi,
Can anybody please help me out urgently. Inside one procedure or function,i want to get the name of the procedure calling this procedure. In other words, i want to get the name of the calling procedure inside the called procedure.
Please reply soon.Have a nice time.
Thanks & Regards
JogeshHi Rod West,
Thanks for your reply. Can you please give an example how to use this.just simple example where it will display the name of the calling proc in the called proc.Please help.
Thanks & Regards
Jogesh -
How to exclude schema name from exported files (PL SQL Developer)
Dear all,
Just one question: I am using PL SQL Developer. My goal is to export some data (as .sql and .dmp files) from one database and to import them into the another database (both databases have identical structure - test database and production, just different database names and names of schema. In order to make it possible, I need to exclude schema name from generated export file. I believe that it is possible to do it automatically by setting up parameters of PL SQL Developer. How?
Thank you in advance,
Kindest regards,
DraganaIn the meantime, I have found the answer on my previous question:
Actually, the initial idea (how to exclude schema name from exported files) was wrong. No need for any intervention.
Trick is: Schema name can be changed during the import of exported files (PL SQL Developer during import gives possibility: From User (old schema) To User (new schema) .
Hope that this will be useful info for others.
Dragana -
How to retrive question name in msg in procedure by writing custom coding
how to retrive question name in message in procedure by writing custom coding.........
My apologies if I've completely missed the boat on where you are going with this...but it seems to me that embedded values in action messages are meant for variable text. In other words, you reference the question variable you want, but it will pull the actual response each time the detail runs, e.g. \AETERM\ will return whatever that is each time the edit fires.
If you are meaning to place non-variable text into an action message, generally, the fastest way to do this is to simply type it in. I'm sure there is custom code out there to do this, however, simply typing AETERM doesn't take very long--definitely not as long as developing custom code.
Again, sorry if I've missed the point entirely. -
Help!How can I find the name of a calling procedure from within a procedure/function?
Is there anyway to find out the name of calling procedure(database) from within a database stored procedure/function? This is required for creating an auditing module.
Thanks,
Abraham
===========
email:[email protected]You can use this query to get the procedure names that are calling your procedure.
SELECT name FROM all_Dependencies
WHERE upper(referenced_name) = 'YOUR_PROC_NAME'
In your procedure, you can get these values into a cursor and then use them one by one.
Hope this would help.
Faheem -
How to find out names of all stored procedures?
Hi All,
I need to find out the names of all stored procedures with parameters and return types. I can use DBA_SOURCE, but in this case I must parse TEXT to find out what I need. Is there any dictionary where the names, parameters and return types of stored procedures saved separately?
Thanks,
Andrej.Not much fair to bring this old post up, sorry!
I am still looking for an answer to my post
where are stored functions like ORA_HASH or GROUPING_ID -
How to avoid printer name prompt while calling Smartform
Hi All,
I am calling smartform FM from my program. I am passing following settings in Output-Options and Control-Parameters:
wa_outputoptions-tddest = 'LP01'. "Printer name
wa_outputoptions-tdnewid = 'X'. "New request
wa_controlpara-device = 'PRINTER'. "Device
wa_controlpara-no_dialog = 'X'. "No dialog
Even after these settings I am getting prompt which asks printer name and other details.
Please tell me how I can avoid the prompt which asks printer name and other settings such as new spool request and print immediately.
Thanks in Advance.
Regards,
VijayHi Vijay,
Try like this.
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
<b> control_parameters = wa_controlpara</b>
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
<b>output_options = wa_outputoptions
user_settings = space</b>
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = tab_otf_data
JOB_OUTPUT_OPTIONS =
TABLES
it_tab = itab[]
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
Regards,
SP. -
How to prefix member names in Planning with EPMA load?
Hi
I use Planning 11.1.2.1 and load the metadata with EPMA.
I would like to add a prefix for all my members (P_TEST instead of the TEST I have in my source file).
I don't find how to do that :-(
thanks in advance for your help
FannyHi
You can export the dimensions using EPMA file generator to a text file. You can then edit the file (i.e. add prefixes) preferably using Excel and load it back into EPMA again.
http://download.oracle.com/docs/cd/E17236_01/epm.1112/epma_file_gen_user/frameset.htm?launch.html
Cheers,
Alp -
How to use table name dynamically in report procedure
Hello every body
I want to use table name dynamically means at runtime i want to pass table name.
I can do this by lexical parameter in main query.
But my problem is that i want to crate new format trigger or new function that use 1 cursor in which that lexical parameter : table name is used.
so how to do that?
i can not use that lexical parameter it is giving error.
please help me how to do that.Call a database function which you pass the lexical parameter. Then in the database function you use dynamic sql or the execute immediate option to build the SQL string.
Return the information from this function to build your business logic on in your format trigger.
Marcos -
How to find the name of calling procedure or package?
Hi all..
Is it possible to find the name of the calling procedure or package?
I mean..if proc_1 is calling proc_2 How can i find in proc_2 that proc_1 is calling?
Proc_2 is being called from different procedures? I need to write to small code which needs to fire depends on the Proc it is calling?
Please help me to solve this.
ThanksNot sure, if this is what you're looking for
SQL> create or replace procedure p0 as
2 begin
3 dbms_output.put_line(dbms_utility.format_call_stack);
4 end;
5 /
Procedure created.
SQL> create or replace procedure p1 as
2 begin
3 p0;
4 end;
5 /
Procedure created.
SQL> create or replace procedure p2 as
2 begin
3 p1;
4 end;
5 /
Procedure created.
SQL> set serveroutput on
SQL> begin
2 p2;
3 end;
4 /
----- PL/SQL Call Stack -----
object line object
handle number name
3a7f2d618 3 procedure INV_ADM.P0
39abfeef0 3 procedure INV_ADM.P1
39c5ae7a0 3 procedure INV_ADM.P2
3a0f3a538 2 anonymous block
PL/SQL procedure successfully completed.
SQL> -
Passing schema name at runtime in batch file
I am having a batch file where i am prompting users to tell the schema name to which they wish to connect at runtime. I am calling one .sql fil within that batch file to execute where i need user to connect to the specific schema at runtime
My batch file looks like as
set serveroutput on;
set linesize 500;
set scan on;
spool test_bat.log
Accept a PROMPT 'Enter the schema name you wish to connect: '
Accept a_pw PROMPT 'Enter the password?: ' HIDE
Accept a_connstr PROMPT 'Enter the connect string : '
conn &a/&a_pw@&a_connstr
Now after getting connected to the specified schema i would like to call some .sql file within the batch file which seems to be as
select count(*) from <schema entered above>.table_name
I want to use the above schema name (a) to get data from the tables.
Please let me know how to get this.
Thanksuser11200661 wrote:
That's fine but still i want to prefix the schema name within the .sql file. My .sql should contain the name of that parameter only as i want to get that parameter replaced by the schema name at runtime. Some other users are using the same .sql file and they have access to that specific schema only. i want to make the .sql file more general so that it can be used by everyone without altering it every time.Sorry, your requirement no longer makes sense.
If people have to access a specific schema because they need the script for general use, then you will have to hard code the schema name into it.
If the script is to prompt for the schema name and connect to that schema and then use that schema name inside the called sql script, then people would not be able to use it generically, as it would be reliant upon the schema name being passed in.
It sounds as if you're trying to write one generic thing that needs to do two different tasks.
Just have two scripts and make life simple. -
Hi,
Schema name is hardcoded in the DB adpater even if I am not selecting the schema name while creation.
<jca:operation
SchemaName="APPS"
PackageName="XX_PKG"
ProcedureName="POPULATE_DATA"
InteractionSpec="oracle.tip.adapter.db.DBStoredProcedureInteractionSpec" >
How do I make it generic? Can I remove SchemaName parameter?
My JNDI Url may change dynamically and the target database may have different schemas.
Thanks,
RishiThe adapter uses the schema name to qualify the stored procedure invocation (e.g. "APPS.XX_PKG.POPULATE_DATA"). Having the schema name means that you can invoke a stored procedure in a schema other than the one associated with your connection. If you remove the schema name then the qualified execution will be "XX_PKG.POPULATE_DATA" and the schema will be your connection schema. So be careful about removing the schema name because the stored procedure qualified by package name alone may not be enough to resolve it for execution. In other words, the package containing your stored procedure may not exist in the schema associated with your connection.
-
Transform the schema name with APPLY_DML_HANDELER
Hello:
I have referred following notes, but I was trying to transform the schema name from schema_name_A to Schema_name_B in APPLY_DML_HANDELER, which does not seem like working.
264035.1 How To Transform Schema Name In Streams
309575.1 How To Transform A Schema Name In Streams for DML and Simple DDL Operations
313766.1 Streams Heterogeneous Apply To SQL*Server
Please confirm, if what I am trying to do it doable or not? Below is handler code.
CREATE OR REPLACE PROCEDURE APPLY_DML_HANDLER(in_any_data IN SYS.ANYDATA) IS
v_in_lcr SYS.lcr$_ROW_RECORD;
v_in_lcr_status PLS_INTEGER;
BEGIN
v_in_lcr_status := in_any_data.GETOBJECT(v_in_lcr);
v_in_lcr.set_object_owner('CSRREP');
v_in_lcr.EXECUTE(TRUE);
END;
All gets compiled good and runs, but dba_apply_errors shows Ora-23416.
Thanks,
RohitHi Rohit,
ORA-23416: table "string"."string" does not contain a primary key constraint
Cause: The master table does not constaint a primary key constraint or the primary key constraint has been disabled.
Action: Create a primary key constraint on the master table or enable the existing constraint.
It is doable. I've done already done that in 9i. Be conscious that that kind of handler is executed for each LCR. So, that's highly paid.
I think there are new features to do it in a better way in 10g but I haven't tried it yet.
I had a bug somewhat similar that I fixed doing the following:
dbms_rule_adm.grant_object_privilege(
privilege => SYS.DBMS_RULE_ADM.EXECUTE_ON_RULE_SET,
object_name => v_ruleset_name,
grantee => v_new_owner
); -
Hi,
I have installed SAP Netweaver 2004s on Oracle 10g, windows 2000 server.
I want to know the schema name. Can you guys help me how to find schema name.
Thanks,
ChakriHello Chakri,
the in oracle user name = schema name .. so you can query dba_users:
> sqlplus "/ as sysdba"
> select username from dba_users;
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_4174.htm#sthref2759
In SAP NW2004s the schema name should be SAPSR3.
Regards
Stefan -
Find the name of the calling stored procedure
Is there a built-in available in oracle PL/SQL to find the name of the calling stored procedure
For e.g
If procedure A calls procedure B,
I want to use some built-in in procedure B, to identify the name of the calling procedure (in this case "A")Try out How Can I find out who called me or what my name is
Maybe you are looking for
-
MacBook Pro 8,1 – Intel Core i5 – 2.23 GHz (early 2011) New with OSX 10.6 – current on all updates. I successfully installed rEFit. I used Boot Camp to install Win 7. All was great. Then installed debian 6. Somehow after the debian install and rest
-
I can't activate my iPad2 after upgrading to ios6?
I download ios6 for my ipad2, but it can NOT activate?
-
How to move my itunes library to my other hard drive?
Urgently need to move my music in my itunes library to my other hard drive to free up space. Trouble is I can't seem to do this. Can anyone help?
-
Can no longer find "Go to a page in another document"
please see attachment The screengrab is from an older version of Acrobat. I use the newest CC version. However, I can no longer find how to access "Go to another page in a document" under Execute menu items for button parameters. Have not used Acroba
-
Generic Sync: How to register 2 Outbound Methods
Hello, i am developing a generic sync application. I have registered a method for inbound+outbound. It works well.Now i have a second method in the same application. I made the mapping in BWAFMAPP,but when i try to create a outbound container for the