How to pass a parameter into a select statement using a bulk collect
Using a cursors I can use execute immediate to pass a parameter to specify a table name.
I have modified the procedure not to use the cursor. I am using a collection using a bulk insert into a nested table. How can I specify the table the table name as a parameter without using the execute immediate statement.
Thank you
Hi Donald,
The functionality of using a parameter in a function is only available in the formula editor and not in SQL Expression. Parameters cannot be passed to the SQL Expression, the main purpose of the SQL Expression is to make use of Database functions to make calculations at the database level but the current functionality of the product only allows you to use Database fields.
There is an article that talks on SQL Expressions and can be useful http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2016184&sliceId=&dialogID=6018612&stateId=1%200%206020316
Regards,
Vinay
Similar Messages
-
How to pass datetype parameter in Sql Select Statements to
public void Mountain()
String dat=lastcollecteddatestr.substring(0,2);
String mon=lastcollecteddatestr.substring(3,5);
String yr=lastcollecteddatestr.substring(6,10);
try
SimpleDateFormat sdf = new SimpleDateFormat("yyyy"+"MM"+"dd");
java.util.Date utilDate = new java.util.Date(Integer.parseInt(yr)-1900,Integer.parseInt(mon),Integer.parseInt(dat));
Date newdate=sdf.parse(yr+"-"+mon+"-"+dat);
System.out.println(newdate);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection(url);
Statement stat = con.createStatement();
ResultSet rs=stat.executeQuery("select empcd,date from mmm where date = '"+newdate+"' ");
while(rs.next())
String str1= new String(rs.getString("empcd"));
String str2= new String(rs.getString("date"));
System.out.println(str1+"\t"+str2);
}catch(Exception ex){System.out.println(ex);}
Error : [MicroSoft] [ODBC Visual FoxPro Driver]Operator/operand type mismatch.
myNote: There is no Problem with connecting to database of something like that
its working well with Different SQL Statment
like: ("select empcd,date from mmm where empcd = '"+empcdstr+"' ")
This is not Working and giving errors
like: ("select empcd,date from mmm where date = '"+newdate+"' ")
HOW TO SOLVE THIS PLZ HELP. It's Urgent.You will see this error if the search condition was entered with an invalid or missing relational operator.
You need to include a valid relational operator such as
=, !=, ^=, <>, >, <, >=, <=, ALL, ANY, [NOT] BETWEEN, EXISTS, [NOT] IN, IS [NOT] NULL, or [NOT] LIKE in the condition. in the sql statement.
Can you throw some more light on how are you designing your project? -
How to Pass multiple parameter into single store procedure
How to Pass multiple parameter into single store procedure
like a one to many relationship.
it is possible then reply me immediatlyyou mean like this .....
CREATE OR REPLACE procedure display_me(in_param in varchar2,in_default in varchar2 := 'Default') is
BEGIN
DBMS_OUTPUT.put_line ('Values is .....'||in_param || '....'||in_default);
END display_me;
CREATE OR REPLACE procedure display_me_2 as
cnt integer :=0;
BEGIN
For c1_rec In (SELECT empno,deptno FROM test_emp) Loop
display_me(in_param => c1_rec.empno);
cnt := cnt+1;
end loop;
DBMS_OUTPUT.put_line('Total record count is ....'||cnt);
END display_me_2;
SQL > exec display_me_2
Values is .....9999....Default
Values is .....4567....Default
Values is .....2345....Default
Values is .....7369....Default
Values is .....7499....Default
Values is .....7521....Default
Values is .....7566....Default
Values is .....7654....Default
Values is .....7698....Default
Values is .....7782....Default
Values is .....7788....Default
Values is .....7839....Default
Values is .....7844....Default
Values is .....7876....Default
Values is .....7900....Default
Values is .....7902....Default
Values is .....7934....Default
Values is .....1234....Default
Total record count is ....18 -
How to pass a parameter into RMAN script
Hello,
I have the following rman script :
run {
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\ora_df%t_s%s_s%p';
This script called configure.rman is launch by a .bat script with the following command:
rman target 'sys/sys12@ORCL102 as sysdba' @c:\oracle\RmanORCL102\configure.rman
How can I pass a parameter into rman script, I want to pass an additional directory like this:
rman target 'sys/sys12@ORCL102 as sysdba' @c:\oracle\RmanORCL102\configure.rman v_dir_name
And use it in rman script:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\$v_dir_name\ora_df%t_s%s_s%p';
Is it a way to do this?
Regards,
ElodieOne option would be to create a file called backup.bat with the following:
echo run {
echo CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
echo CONFIGURE CONTROLFILE AUTOBACKUP OFF;
echo CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
echo CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\%1\ora_df%t_s%s_s%p';
echo } ) | rman target sys/sys12@orcl102and then call the script as:
c:\> backup.bat backup_directory_name -
How to pass a parameter into execute sql task and later use it into dataflow task?
i am in a situation, where i have a logging table in which i have a primary key called ETL_log_ID which is an identity column and acts as a foreign key for various fact table and dimension tables which are populated using SSIS packages. Now i wanna use the
ETL_log_ID as a parameter in the execute sql task which populates the log table and pass the same value in the data flow task which populates the facts and dimension. Can you let me know how to pass the parameter in a step by step procedure.
Thanks,
Nikhil
Nikhil,
You can check the following :
http://www.programmersedge.com/post/2013/03/05/ssis-execute-sql-task-mapping-parameters-and-result-sets.aspx
http://stackoverflow.com/questions/7610491/how-to-pass-variable-as-a-parameter-in-execute-sql-task-ssis
Regarding the usage in Dataflow task, Can you elaborate on that a little?
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'> -
How to pass a parameter into a sql expression?
How to pass a report parameter into a sql expression?
Hi Donald,
The functionality of using a parameter in a function is only available in the formula editor and not in SQL Expression. Parameters cannot be passed to the SQL Expression, the main purpose of the SQL Expression is to make use of Database functions to make calculations at the database level but the current functionality of the product only allows you to use Database fields.
There is an article that talks on SQL Expressions and can be useful http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2016184&sliceId=&dialogID=6018612&stateId=1%200%206020316
Regards,
Vinay -
HOW to pass page parameter into table function in HTMLDB
I created this object and table function in database.
create or replace TYPE date_flow_type
AS OBJECT (
time date,
max_time number,
avg_total NUMBER,
sum_total NUMBER,
max_total NUMBER,
change_rate number
create or replace TYPE date_flow_table_type AS TABLE OF date_flow_type;
create or replace function ret_date(p_date date default sysdate) return date_flow_table_type is
v_tbl1 date_flow_table_type :=date_flow_table_type();
begin
v_tbl1.extend;
v_tbl1(v_tbl1.last):=date_flow_type (p_date,1,1,1,1,1);
return v_tbl1;
end;
and it is correct in htmldb when using in these ways
SELECT TIME da,
max_time max_time,
sum_total total,
max_total max_total,
change_rate
FROM TABLE ( ret_icp_date_flow ) a;
SELECT TIME da,
max_time max_time,
sum_total total,
max_total max_total,
change_rate
FROM TABLE ( ret_icp_date_flow( sysdate-1 )) a;
but return error
ORA-00904: "RET_ICP_DATE_FLOW": 无效的标识符
when pasing page parameter into the table function
SELECT TIME da,
max_time max_time,
sum_total total,
max_total max_total,
change_rate
FROM TABLE ( ret_icp_date_flow( to_date(:p1_date,'yyyy-mm-dd') )) a
and this sql is correct while running in sqlplus .Hi!
Thanks for your reply!
I have tried this solution but it doesn't work!
When I do getInitParameter in the init function, the servlet take the default values...
Maybe I have wrote something wrong?
Excuse me for my english,
Thanks -
How to pass a string into an IN statement
I want to run an update command where the user types in a CSV value and the query runs. If I simulate 1 number it works, but if I put in 2 variable it returns nothing (but doesn't fail) any idea what I am doing wrong?
declare @SITE_ID int
declare @txtSchedule varchar (500)
set @SITE_ID=1
set @txtSchedule='5,6'
select * from Schedules WHERE SITE_ID=@SITE_ID and WEEK IN(@txtSchedule )
Jimyou are passng that as a string = '5,6' does not exist
try this : http://www.mssqltips.com/sqlservertip/1771/splitting-delimited-strings-using-xml-in-sql-server/
declare @table table(sno int)
insert into @table values(5),(6)
DECLARE @xml as xml,@txtSchedule as varchar(100),@delimiter as varchar(10)
SET @txtSchedule='5,6'
SET @xml = cast(('<X>'+replace(@txtSchedule,',','</X><X>')+'</X>') as xml)
select * from @table WHERE sno IN ( select N.value('.', 'varchar(10)') as value FROM @xml.nodes('X') as T(N))
Hope it Helps!! -
How to insert a parameter into MySql from JSP using bean
Hai.........
The files i hav used are: DbConnection.java, LogBean.java, login.jsp, checkUser.jsp, existingUser.jsp, newUser.jsp...................
I hav problem in newUser.jsp................................................
ie: plz giv an appropriate code for this code:.........................................
resultSet = connectionBean.execUpdate("insert into userLogin values('"+uName+"','"+pWord+"') ");
Message was edited by:
jaseemkhanHere is the code fragment.
File file = new File ("c:\\t.gif");
FileInputStream in = new FileInputStream (file);
int len = (int)file.length();
PreparedStatement pst = null;
pst = conn.prepareStatement ("insert into blob_table values (1, ?)");
pst.setBinaryStream (1, in, len);
pst.executeUpdate();
pst.close();
conn.commit(); -
Getting Username to pass into LOV select statement
Hello!
I'm wondering if its possible to get the username of the current user logged in and pass it as a variable into a select statement used in a dynamic LOV in Oracle AS Portal?
What I'm attempting to do is pull all the values from a table that equal the current user's username to user on a portal report
so (as a rough example)
select color from mytable where username = 'whatever the user name is would be here'
And then the current user would get a list of values from which to select based off of the values entered in this table.
The issue I'm having is determing how to fill the 'whatever the user name is would be here' portion with the actual logged in user's username (or even if its possible). I know on the actual portal one can do #USER.FULLNAME# to display their username, is there a similar "variable" one may use to get the username for a LOV sql call?
I can get it to work if I statically fix the username to a particular value (ex: where username = 'Joe.Hacker') but I'm unsure if theres a variable or bind value (for lack of a better term) to grab the username on the fly.. dynamically.portal.wwctx_api.get_user can be used in the SQL query of your portal report to get the user_name of the currently logged-in portal user. For more info on wwctx_api, see the 10.1.2 or 10.1.4 portal API docs at http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1012/index.html or http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1014/index.html
-
How to pass src value into img tag in ADF
Hi,
My Dev : 11.1.2.3.0
How to pass row values into <img> tag.,I used the below code but it's taking empty.,
I tried both ways like #{row.CdFilePath} and ${row.CdFilePath}
<af:iterator var="row"
value="#{bindings.xxx.collectionModel}"
id="i2">
<img src='/ShowImage?src=#{row.CdFilePath}' border='0' style="width:100px; height:100px; margin:5px;"/>
</af:iterator>
Please tell me any other option is there..
ThanksThis works if you use a normal table so I guess it should work here too.
Are you sure the el #{row.CdFilePath} return something?
Why don't you use the adf image tag <af:image source="/ShowImage?src=#{row.CdFilePath}".../> instead of the html img tag?
Should the src property not be enclosed with " instead of your '?
Timo -
How to pass the parameter of a stored procedure to iReport
Hi... i don't know how to pass the parameter of the stored procedure to the iReport.
In the Report Query, i tried
1. sp_storedprocedure ' value'
2. sp_storedprocedure +''''+$P{parameter}+''''+
3. sp_storedprocedure +$V+$P{parameter}++$F($F is a variable having a value of ' (a single quote))may you enlighten us please? thank youFor M$ SQL server I find that it only works when U use the fully qualified name...
e.g. catalod.dbo.my_procedure_name 'variable'
My full query in the Report Query window is something like this:
EXEC arc.dbo.jasper_Invoice 1000
Note that you may find that selecting from VIEWS / TABLES fails for no apparent reason and iReport will prompt you with the usual very unhelpful (we have what we "pay" for) prompt, stating that "The document is empty".
To work around this issue, where a statement like "SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id=1000" does not work, simply create a PROC, something like:
CREATE PROC jasper_MyProc (@my_rec_id integer) AS
SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id= @my_rec_id integer
...to wrap your SELECT statement, then call the PROC
Edited by: Sylinsr on Apr 22, 2008 4:23 PM -
How to pass Cascading Parameter in SSRS using Java
How to pass Cascading Parameter in SSRS using Java---
We are having a problem with dependent parameters.There are three drop down--
1.first dropdown is of Country.When we select a country--Accordingly next dropdown(State)will populate
2.Second dropdown is of State. When we select a state--Accordingly next dropdown(City)will populate.
I have three data sources are
CountryList-
SELECT CountryRegionCode, Name
FROM Person.CountryRegion
ORDER BY Name
StateList
SELECT StateProvinceID, StateProvinceCode, CountryRegionCode
FROM Person.StateProvince
WHERE CountryRegionCode = @CountryRegionCode
ORDER BY StateProvinceCode
CityList
SELECT StateProvinceID, City
FROM Person.Address
GROUP BY StateProvinceID, City
HAVING (StateProvinceID = @StateProvinceID)
ORDER BY City
Ihave to show report that has been deployed on server on the besis of these parameters
I am using ReportViewer in JSP Page through url--
http://192.168.90.149/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project1%2fCascading_Parameters&rs:Command=Render&rs:parameter=true&Country="+Country+"&State="+State;
But it is not accepting parameter if they are cascaded.It is working fine if Both parameters are independent.
Edited by: kaushlee on May 11, 2010 9:22 PMTake a look at set_custom_property:
public static final ID SETTEXT = ID.registerProperty("SETTEXT");
public boolean setProperty(ID pid, Object value)
if (pid == SETTEXT)
String text = value.toString();
and in forms
set_custom_property('beans.bean_item', 1, 'SETTEXT', 'some text');
cheers -
How to pass dynamic parameter to a database function in OBIEE
Hi,
I have a requirement like this. I have to create one report in OBIEE which was in Discoverer. Now in discoverer report there are some calculated item in the worksheet based on database pkg.functions. The parameter which user gives at run time that parameters are then passed to the discoverer calculated items dynamically. But I am not able to do this in OBIEE answers.
Can anyone tell me step by step how I can able to pass the user selected parameter values in OBIEE answer level.
The example:
GET_COMM_VALUE_PTD("AFE Cost & Commitment".Afe Id,:"Period Name(AFE)","AFE Cost & Commitment".Data Sel,"AFE Cost & Commitment".Org Id)
GET_COMM_VALUE_PTD --- Function database
("AFE Cost & Commitment".Afe Id,:"Period Name(AFE)","AFE Cost & Commitment".Data Sel,"AFE Cost & Commitment".Org Id --- Parameters... :"Period Name(AFE)" is the dynamic parameter selected run time by user.
Please help.
Thanks
TitasHi,
I already did that. But the existing discoverer re value report is showing correct value but the OBIEE report with EVALUATE function shows incorrect value.
The requirement is to create a OBIEE Dashboard from a Discoverer existing report. Now in discoverer report theere are several calculated items in worksheet level where database custom function is used and user selected parameter value is passed run time in that function. But when that is created in OBIEE with EVALUATE function in RPD, the report shows incorrect data. Could not understand how to pass the parameter value runtime.
Below is the discoverer 'Show SQL' query and EVALUATE function syntax which has been used.
SELECT APPS.XXBG_PL_PROJ_ANALYSIS_AFE_PKG.GET_COMM_VALUE_PTD(XXBG_PL_PROJ_AFE_V.AFE_ID,
:"Period Name(AFE)",
XXBG_PL_PROJ_AFE_V.DATA_SEL,
XXBG_PL_PROJ_AFE_V.ORG_ID),
XXBG_PL_PROJ_AFE_V.AFE_DESC,
XXBG_PL_PROJ_AFE_V.AFE_NUMBER,
XXBG_PL_PROJ_AFE_V.APPROVED_AFE_AMOUNT
FROM APPS.PA_PERIODS_ALL PA_PERIODS_ALL,
APPS.XXBG_PL_PROJ_AFE_V XXBG_PL_PROJ_AFE_V
WHERE ((XXBG_PL_PROJ_AFE_V.ORG_ID = PA_PERIODS_ALL.ORG_ID))
AND (XXBG_PL_PROJ_AFE_V.DATA_SEL = :"Data Selection(AFE)")
AND (PA_PERIODS_ALL.PERIOD_NAME = :"Period Name(AFE)")
AND (XXBG_PL_PROJ_AFE_V.AFE_NUMBER = :"AFE Number(AFE)")
AND (XXBG_PL_PROJ_AFE_V.OPERATING_UNIT = :"Operating Unit(AFE)")
The EVALUATE function syntax is as below:
EVALUATE('XXBG_PL_PROJ_ANALYSIS_AFE_PKG.GET_COMM_VALUE_PTD(%1,%2,%3,%4)' AS FLOAT , "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Afe Id", "BG PL Project Analysis Report_1"."Periods 1"."Periods 1.Period Name", "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Data Sel", "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Org Id")
The PERIOD needs to be passed at run time which user will select.
Please help to solve the issue. -
How to pass a default value in selection screen of logical database pnpce
Dear All,
Can any one tell me how to pass a default value in selection screen of logical database pnpce .
Regards
Rakesh SinghHi Rakesh,
Go to SE36 (logical database Builder).First enter PNPCE in Logical Database and press documentation,here you will get the details of exactly what is PNPCE and how it works.After that select selections in subojects in se36 only and enter display ,there you have the include from where you acn get the idea.
Regards,
Rahul
Maybe you are looking for
-
Questions on using templates [CS3]
Greetings, I'm trying to figure out the best way to approach an InDesign task, and my rank-novice-level experience isn't cutting it. Normally I'd read through a gazillion help pages and do a bunch of tutorials to try and teach myself enough to answer
-
Problem installing Win XP Pro SP2 on 2008 Mac Pro running 10.6.8
Okay, I have never setup or ran a bootcamp partition so I apologize in advance for my ignorance on the subject. I have been attempting to install win xp pro (SP2). I am using the Boot Camp Assistant v3.0.4. I have created a 32GB FAT32 partition and
-
Adobe Presenter using pre-recorded video
is there a way for adobe presenter 8 to take a pre-recorded video instead a webcam for video input? so i have a pre-recorded video file, and I can run it side by side with the slide, and program when the transition supposed to be, when the video and
-
Tried everything to increase BT Broadband speed ov...
Quick background story to my question Used to live a few hundred metres from the exchange. Had BE* for years. Life was good. T'internet was superspeedyfast. In time, we needed a new place to live. Wife and I moved to new house almost just before Chri
-
I have an older system, added a hard drive to system and it is now asking to activate Photoshop CS, worked fine before adding this drive, tried over phone to activate but system is saying that I have not entered enough numbers for the activation numb