Passing Global Variable in Sql Object
Hi
How can i pass my global variable into SQL object? I tried to pass it but then I tried to update the schema it giving me the error at varble
Please advise me
The Update schema is used only to get the structure for the Output.
Once you have a valid structure and the SQL Parses without any variables use the syntax for applying variables as in any Script within DI.
$GV_MyVar enclosed within square brackets will be replaced by Value of the variable.
$GV_MyVar enclosed within curly brackets will be replaced by Value of the variable enclosed in single quotes.
When the job runs, the variables will be replaced with values OR values with quotes. It is at this time, the SQL send to the database is validated for syntax.
Therefore, you will not know the validity of your SQL with Global Variables until you run the job.
Hope this helps!
Thanks & Regards
Tiji
Edited by: Tiji Mathew on May 8, 2009 3:40 PM
The actual syntax was being posted as a link. edited to make the text descriptive.
Similar Messages
-
Passing global variable values from databse to forms
I am using forms 6i and database is oracle 9i.
I am trying to run a form stand alone ( by pressing CTRL-R) without putting it in the application.
since when this form is placed in the application menu it works fine as it has been passed global variables values from the database .
now i am trying to run the form without menu and thus i want to pass the values of global variables .please let me know where should i pass these values in form .is it be WHEN-NEW-FORM-Instance trigger or in Pre-form trigger.
i know what are the global variable values passing into the form from database.
i can hard code any values to check if the form runs well or not.If you intend to do this sort of testing regularly you might want to consider creating a seperate form with a control block which allows entry of the name of the form you want to run, the names of the globals and their values, and do a CALL_FORM.
-
Passing a variable from SQL*Plus to Korn
Sorry if this isn't the correct forum, not sure where to post this otherwise. And excuse the poor shell script programming - I have no excuse.
I have a shell script that generates another shell script to delete database related files. I have no problems getting the filenames for the datafiles or the control files or the redo logs (just for info its to clone and rename a prod database and we don't have RMAN in place yet).
I do have a problem with the spfile. I'm using this :
V_SPFILE=`sqlplus -s "/ as sysdba" << EOF
set feedback off;
set pagesize 0;
select value
from v\\\$parameter
where name like 'spfile%';
exit;
EOF`
which passes "?/dbs/[email protected]" to V_SPFILE. Then later on in my script I'd like to do something like :
mv $V_SPILE OLD${V_SPFILE}${TDATE}
TDATE is todays date BTW.
Trouble is, the "?" is passed to the shell script. I know that I could put something like :
$V_SPFILE = $ORACLE_HOME/dbs/spfile${SID}.ora
as a global variable, but I want to be sure that the spfile that is in use is renamed.
So, how does one deal with the "?" passed to the shell script?Having the same problem...getting variable values FROM captivate to my inserted .swf (not widgets).
I can set the value from the .swf to the captivate using Object(parent.parent.parent.parent).captivateVariable but not the other way around.
Very frustrating.
I hope someone answers your query. -
Passing Unix variable into sql
Hi,
I have a shell script with embedded SQL.
In the script I have a Unix variable that has a char value
id="P_test".
I need to pass this variable to a select in a where condition like
select * from table where camp1=$id.
The problem is $id returns P_test rather than 'P_test' so that the select can work.
Any ideea how to change the clause where to make the select work?
I could also change the variable id as to have id=" 'P_test' " , but this variable comes from a file parsed and I don't know how to get 'P_test' instead of P_test.
Thanksanother option may be like this example -
$OH10/bin/sqlplus -s > $CIGDEM_LOG_DIR/step1_$CIGDEM_DATE.log 2> $CIGDEM_LOG_DIR/step1_$CIGDEM_DATE.err <<EOF
$CIGDEM_USERNAME1/$CIGDEM_PASSWORD1@$OTNS10
@$CIGDEM_DIR/step1.sql $CIGDEM_EXP_DIR $CIGDEM_USERNAME3 $CIGDEM_PASSWORD3 $PERMANANT_TABLESPACE $TEMPORARY_TABLESPACE
exit ;
EOF
"@$CIGDEM_DIR/step1.sql $CIGDEM_EXP_DIR $CIGDEM_USERNAME3 $CIGDEM_PASSWORD3 $PERMANANT_TABLESPACE $TEMPORARY_TABLESPACE" here we call step1.sql with arguments, they will be used with &n symbol inside sql statement -
.. CREATE USER &2 IDENTIFIED by &3 TEMPORARY TABLESPACE &5 DEFAULT TABLESPACE &4 ; ..http://tonguc.wordpress.com/2007/11/29/linux-and-shell-scripting-part-2/ -
Pass Global Variables to another forms(urgent)
Hi,
Can someone tell me what is the best way to pass a global variable from one form to another forms. I havn't trouble with that.
Please advise.
Thank you very much
Tim
nullYou can use a parameter.
Helena
null -
Passing SessionBean variable to sql query editor
Hi,
I am trying to pass a variable that I define locally in SessionBean to sql query via the query editor.
SELECT ALL comments.id,
comments.comment,
comments.comment_date
FROM comments
WHERE comments.id = **SessionBean1.id**How do I specify **SessionBean1.id** in the WHERE clause?
Thanks for your help.
--izumiUse this SQL query:
SELECT ALL comments.id,
comments.comment,
comments.comment_date
FROM comments
WHERE comments.id = ?Then in the page that uses this (wherever the query is executed) provide the variable value with:
<your row set name>.setObject(1, getSessionBean1().getCommentId()); -
How to pass global variables to call stored procedure in form personalizati
Hi,
We want to call a custom store procedure with 2 paramterts, I am storing values into 2 global variables.
We want call the custom store procedure with global variable values in form personalizations.
We tried like
='declare
begin
SUR_TEST_ORDER_LINE_UPD.update_order_line (:global.xx_line_id, :global.ship_set_id);
end'
Could you please suggest.
Advance Thanks
SubbuHi,
Doc number (MOS Doc 743490.) is avaiable in metalink or ?Yes.
Note: 743490.1 - Customization in Oracle Applications
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=743490.1
Regards,
Hussein -
Is it possible to pass Presentation Variable into SQL code?
Is it possible to create a Prompts that can pass data inputted in the Prompt to a SQL statement?
Example
User inputs
Dashboard Prompt: Date Between today date AND yesterday's date
Which pass information to a measure and labels the the information:
CASE WHEN "Date.Datetable" = {@}DATE1 THEN 'Today' Else 'Yesterday' END FROM "TABLE_Example"You can pass a selected value from prompt to filter a measure or display it as a dynamic label/column header.
To set the label like a dynamic column header:
http://total-bi.com/2011/03/obiee-dynamic-column-headings/
If that is for the measure value then use presentation variable and use them in the formula of the column.
If that is to pass value to the physical layer or bmm layer then use session variable, set it using request variable in prompt and use the session variable in bmm or physical layer view.
Let me know if this helped.
Regards,
Jay -
I am currently using Station Globals for sharing values among the main sequence and subsequence files. But I constantly need to add the variables on the many computers we own.
I tried using the File Globals in the main sequence file, but the variables are not displayed in or passed to the subsequence file. It works just like a local variable.
I also tried selecting the option "propagnate to subsequence" for the local variable in the main sequence, but still didn't get passed to the subsequence.
Thanks!
ph2ph2 wrote:
I am currently using Station Globals for sharing values among the main sequence and subsequence files. But I constantly need to add the variables on the many computers we own.
I tried using the File Globals in the main sequence file, but the variables are not displayed in or passed to the subsequence file. It works just like a local variable.
I also tried selecting the option "propagnate to subsequence" for the local variable in the main sequence, but still didn't get passed to the subsequence.
Thanks!
ph2
I'd recommend you consider using sequence parameters rather than globals. If you use globals, and you someday want to switch to a multi-socket test system, you might have to make signficant changes to your code because you likely would not want all of the threads using the same globals. If you use parameters instead, then every thread already would automatically have its own copy of the variables. Also parameters do not have the problem you are asking about here.
-Doug -
How can I pass Global Variable from Page1 to Page2
I have the following senario.
Pag1 - report is based on following PL\SQL
declare
g1 varchar2(100);
begin
g1 = select * from emp where dept = 10;
return g1;
end;
Now I have Page2 - based on following PL\SQL
declare
g2 varchar2(100);
begin
g2 := g1; -- here i want to use variable g1???
return g2;
end;
My question is - How can I use variable g1 from P1 in my new page P2.
Thanks,
DeepakHi Andy,
Thanks for the clarification.
I did exactly the same, created a new Region with HTML (PL\SQL) and got the output. it was fine.
Now when I am using exactly the same code in a Report (PL/SQL function returning a SQL Query), I am getting the following error.
DECLARE
g VARCHAR2(100);
BEGIN
g := 'This is a test string';
APEX_UTIL.SET_SESSION_STATE('G_SQL_STRING', g);
htp.p(v('G_SQL_STRING'));
END;
ERR-1002 Unable to find item ID for item "FLOW_SECURITY_GROUP_ID" in application "4000".
ERR-1002 Unable to find item ID for item "G_SQL_STRING" in application "4000".
I am doing the same thing, nothing changed....only difference is in 1st case I am using HTML (PL\SQL) Region and in 2nd case using the REPORT Region (PL/SQL function returning a SQL Query)
thanks,
deepak -
HI,
WHEN-Button-pressed on first from
:global.a_sale_order_no := :sale_order.sale_order_no;
open_FORM('C:\test_report\final_to_be_added_to_main\DELEVERY_MASTER_new');ANd the open_form DELEVERY_MASTER_new
WHEN-NEW-FROM-INSTANCE(code) is
Set_Window_Property('DELIVERY_DETAIL', WINDOW_STATE, Maximize);
SELECT s.cust_id,s.SALE_ORDER_NO,s.PARTY_NAME,s.SEASON_YEAR, s.DEL_DATE,c.CURRENCY,S.delivery_address,S.SHOWROOM_ADDRESS,
S.INVOICE_ADDRESS,s.SHIP,s.PAYMENT_TERM,s.CONTACT_PERSON||chr(10)||s.CONTACT_NO,s.vat_no INTO :delivery_master.cust_id,
:delivery_master.sale_order_no,:delivery_master.CUSTOMER_NAME,:delivery_master.SEASON,:delivery_master.DEL_PERIOD,
:delivery_master.CURRENCY,:delivery_master.DELIVERY_ADDRESS,:delivery_master.CUSTOMER_ADDRESS,
:delivery_master.ACCOUNTS_ADDRESS,:delivery_master.SHIPPER,:delivery_master.PAYMENT_TERMS,
:delivery_master.CONTACT_INFORMATION,:delivery_master.vat_no
FROM sale_order s,customer_master c
WHERE c.CUST_ID=s.cust_id and SALE_ORDER_NO = :global.a_sale_order_no ;I want when i press the button on first form then if sale_order_no already in delevery_master_new then message already in delevery_master_new
Please Guide
Thanks And Regards
Vikas SinghalVikas,
Change the WHEN-BUTTON-PRESSED trigger in first form with this one. And giving file path in the OPEN_FORM built-in is not advisable.
DECLARE
CURSOR Cur_SOrder IS SELECT COUNT(*) FROM DELIVERY_MASTER WHERE SALE_ORDER_NO = :SALE_ORDER.SALE_ORDER_NO;
Num_Temp NUMBER := NULL;
BEGIN
OPEN Cur_SOrder;
FETCH Cur_SOrder INTO Num_Temp;
CLOSE Cur_SOrder;
IF NVL(Num_Temp, 0) > 0 THEN
MESSAGE('Already in Delivery Master');
RAISE FORM_TRIGGER_FAILURE;
END IF;
:GLOBAL.a_sale_order_no := :SALE_ORDER.SALE_ORDER_NO;
OPEN_FORM('DELEVERY_MASTER_new');
END;Regards,
Manu.
If my response or the response of another was helpful, please mark it accordingly -
Global variable in anonymous block
Hi Folks,
I am new to the PLSQL,As i have requirement to define a global variable in .sql file and pass the value into unix.
Can you people please guide me?
Thanks in advance992368 wrote:
Hi Folks,
I am new to the PLSQL,As i have requirement to define a global variable in .sql file and pass the value into unix.
Can you people please guide me?
Thanks in advancePL/SQL and UNIX are completely different environments and how or why to pass values between them is diffcult though possible. How to do this depends on what you are trying to do.
Explain what problem you are trying to solve and how you are going to go about it. -
Set value of substitution string or global variable
Hi all,
is it possible to set the value of a substitution string or a global variable via sql or something else?
it means is there a procedure like apex_application_install.set_application_alias() to set a value?
Thanks,
KirstenSo for each file I loop through I have:
T.box = A1 (or A2, A3, etc...)
InTable = true/false...
T.box.setSelected(InTable) or
(T.box.toString().setSelected(InTable), but it still
recognizes the T.box as a String instead of the
JCheckBox.T.box IS a String.
What are the variables you are reading in? The name of the JCheckBox? Do you mean the name of the reference to a JCheckBox? So, initially you have a bunch of JCheckBoxes you created like
JCheckBox box1 = new JCheckBox("Box1");and then you read in the "box1" from your file and another value that indicates whether it is checked or not?
If this is the correct assessment then I would agree with the other post. When you create the JCheckBoxes, store them in a Hashmap(or something similar) with the 'name' as the key and the JCheckBox object as the value. Then, when you read in your values you just do:
((JCheckBox)boxMap.get(A1)).setSelected(InTable); -
How to pass environment variables in Host file
Hi Gurus,
I'm having a requirement where I need to send my report output file as an attachment to customer. I achieved this by using host program and connecting to db server by using ftp. I am placing my output file in db server. From there onwards by using pl/sql scripts I am sending output file as attachment. The program is working fine for me no issues.
Now in this program i am hardcoding ip number, user name of Ip and pwd of ip. Our client don't want all those info needs to be displayed in the host(.prog) FILE.
For this i've written all variables in the .env file. But the .prog file triggers from application server. And I've written my variables in .env file which is in db server(different ip). When I am reading these values in the .prog it is throwing error saying the .env does not exists in the application server. Which is true since this is residing at db server.
Please help me how can i pass global variables to this .prog file. Remeber that I am able to send output file by hardcoding user name and password.
Appreciate your help in advance.
Regards,
NagendraHi Hussain,
Thanks for your reply.
My requirment is not related to the apps password. I know the four parameters which we can default, my requirement is further ahead.
In my host program I am connecting to db server. As it is evident .prog file runs from appl server. I need to transfer file from appl server to db server. For that I want to use global variables kind. Like if I write in .env file then I can use that parameters in across all the programs. But what I've seen from instance is that my .env file resides in db server means if i want to initialize those global variables i need to connect db server then only I can connect.
Now I need to use global variables in appl server where I don't have any .env file at this level. If say parameters through program we can pass but it is password of db server which I need to secure from users and rest others for that I need to declare global variables at appl server level. How is that possible.
The threads I've checked them already those are related to passing parameters which is possible but my requirement is to pass parameter which is hidden and through programatically it has to trigger in to the program. If my program is pure shell file and resides and db server then no issues. Here the complexity is that .prog file resides in appl server and I want to do transfer from appl server to db server.
Thaks for your patience.
Regards,
Nagendra
Edited by: 838961 on Mar 19, 2012 12:23 AM -
How can I pass a value field to a global variable?
I have a doubt,
I wnat to know if is possible to pass a value field to a global variable inside of DataFlow?
That a try to do is at the time to execute a JOB on line (real time), depending of the value field that i receive, only certain DATAFLOWS will be executed depending of the value field.
I hope you can help me.
Kind regards!!!It can be done via various ways, your approach is kind of odd, though.
You are saying you have one kind if Input message, depending on the flag you want to do different transformations. The way you envision that is by loading that flag into a global variable and use different dataflows then.
Can you use different dataflows within one Realtime Job? Yes, usually the first loads an in-memory datastore.
Can you write into a global variable? Yes and No. Not directly, but you can write the value into e.g. a database and using the sql() function read it from there. But why would you. You could write it into the in-memory datastore. And then you run your n dataflows, each has a filter. So only one of these dataflows will actually process the data.
Are there other approaches? I would have a Case transform at the beginning and route the data into different queries depending on the data. So all in one dataflow. Your approach is fine for a batch dataflow where a dataflow is started, does something and then ends. But that's not how it works in Realtime!
Maybe you are looking for
-
Js submenu doesn't appear in windows 8 phones
js submenu doesn't appear in windows 8 phones but works on iphone. any solution?
-
How to get the preference of Acrobat/Adobe Reader?
I know i can use AVAppGetPreference(AVPrefsType preference) to get the preference what i want. but there is no documention of AVPrefsType, so i don't know what should i set. I search the api document and head file, no result. I need to get the dpi of
-
Hi, can anyone guide me how to export in level format (essbase level). topnode|parent|child1|1st children of child1|etc tried generation export using inverted level option but it is not returning correct results. can anyone here guide in taking expor
-
I am preparing to upgrade to yosemite. Should I upgrade iphoto before or afterwards? I have Snow Leopard and iphoto 8.1.2 which I gather will not be useable on yosemite.
-
Process keyboard commands without prompting
I am 5 weeks into my first Java course with no previous programming background. We are implementing John Conways game "LIFE" a 2D Cellular Automata. From the command line I read in 5 args, width, height, cell size, delay and a random seed value. I ha