Run Stores Procedure, RadioButton - Important
Hi everyone,
I am trying to run this Stored Procedure, I have the following:
PROMPT(RADIOBUTTON,%MESES%,"seleccionar meses a promediar",1,{"1 mes"," 2 meses"," 3 meses"," 5 meses"},{"1","2","3","5"})
TASK(Execute formulas,LOGICFILE,%APPPATH%..AdminApp%APP%TestAlldoraVentas2.lgf)
TASK(Execute formulas,FORMULASCRIPT,"*FUNCTION VIGENCIA=%MESES%")
Im just passing the time (year.month) and a number called Vigencia which is the number of months chosen in time.
I.e. : jan, feb, mar , vigencia= 3
jan, feb, mar, apr, may vigencia = 5
Having as max, 12 months for vigencia.
I know that Run_Stored_Procedure is not supposed to coexist with WHEN/ENDWHEN structures... however, I still posted it in my script logic, therefore I got this error:
Start time --->1:09:54 PM - Date:8/2/2011 (build code:7.5.105)
User:ENGABRIE-M04PL0Administrator
Appset:EPlanning
App:ALLDORA_VENTAS
Logic mode:1
Logic by:
Scope by:
Data File:
Debug File:C:PC_MSDataWebfoldersEPlanningALLDORA_VENTASPrivatePublicationsAdministratorTempFilesDebugLogic_1270_01442641174.Log
Logic File:C:PC_MSDataWebFoldersEPlanningALLDORA_VENTAS
..AdminAppALLDORA_VENTASTestAlldoraVentas2.lgf
Selection:C:PC_MSDataWebFoldersEPlanningALLDORA_VENTASPrivatePublicationsAdministratorTempFilesFROM_1270_.TMP
Run mode:1
Query size:0
Delim:,
Query type:0
Simulation:0
Calc diff.:0
Formula script:*FUNCTION VIGENCIA=3
Max Members:
Test mode:0
Is Modelling:1
Number of logic calls:1
Call no. 1, logic:C:PC_MSDataWebFoldersEPlanningALLDORA_VENTAS
..AdminAppALLDORA_VENTASTestAlldoraVentas2.lgf
Building sub-query 1
Query Type:0
Max members:
Executing PROMEDIO 'ALLDORA_VENTAS','3','2011.ENE,2011.FEB,2011.MAR','SPSCOPE_706810','SPLOG_185742'
error running stored procedure PROMEDIO 'ALLDORA_VENTAS','3','2011.ENE,2011.FEB,2011.MAR','SPSCOPE_706810','SPLOG_185742': Could not find stored procedure 'PROMEDIO'.
The outcome, is all the records for the next year posted with ZEROS..... Please help me out...
Script:
*SELECT(%vapi%,"id","conceptos","vap='i'")
*SELECT(%vapc%,"id","conceptos","vap='c'")
*SELECT(%vape%,"id","conceptos","vap='e'")
*SELECT(%toner%,"id","consumibles","tipo='T'")
*SELECT(%drum%,"id","consumibles","tipo='D'")
*SELECT(%fusor%,"id","consumibles","tipo='F'")
*SELECT(%otros%,"id","consumibles","tipo='O'")
*XDIM_MEMBERSET conceptos=%vapi%,%vapc%,%vape%
*XDIM_MEMBERSET consumibles=consumibles_dummy,%toner%,%fusor%,%drum%,%otros%
*XDIM_MEMBERSET lob=servicios_out
*XDIM_MEMBERSET metrica=precio_r,pieza_r,hojas_r,metros_r
*XDIM_MEMBERSET moneda=usd,mxn
*XDIM_MEMBERSET oi oi_dummy
*XDIM_MEMBERSET vendedor = 01,02,03,04,05
*RUN_STORED_PROCEDURE=promedio('%app%','VIGENCIA','%tiempo_set%','%scopetable%','%logtable%')
*COMMIT
*WHEN conceptos
*IS %vapi%
*WHEN metrica
*IS hojas_r,metros_r,precio_r
*WHEN tiempo
*IS %tiempo_set%
*WHEN versiones
*IS Real_2011
*FOR %anio%=2012
*FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
*REC(expression= %value% / %meses%, tiempo=%anio%.%mes%,versiones="esperado_2012")
*NEXT
*NEXT
*IS Real_2012
*FOR %anio%=2013
*FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
*REC(expression= %value%, tiempo=%anio%.%mes%,versiones="esperado_2013")
*NEXT
*NEXT
*IS Real_2013
*FOR %anio%=2014
*FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
*REC(expression= %value%, tiempo=%anio%.%mes%,versiones="esperado_2014")
*NEXT
*NEXT
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT
Thanx
Velázquez
Hi James,
In this company there is only 1 person that works in the BPC technical area, and this is me. Im a beginner, so I pretty much know very little about this whole application.
Thanx for the information you provide, is very useful, specially since there is no info in the manuals about this stuff.
I only have 2 appsets, Apshell and this one, and I cant find a S. Procedure... however i'll look for the default at least.
If i just need to copy it and rename it, i'd be glad if you can confirm.
If this forum is not about solving issues like this, I dont know what is the usage for.
Thanx again
Velázquez
Similar Messages
-
Unable to run Store Procedure based deski report in Infoview
Hi All,
I have a Deski report which is created using Store Procedure. I am able to run report in Full Client Deski. But I am unable to run / schedule same report thorough infoview.
More details about report
- Report uses 3 store procedures. When I ran report in infovew I get error message as "SP2 Dataprovider did not refresh properly". -- SP2 is Dataprovider name.
- Same report I am able to run in Dev environment. After migration to Model, report fails to run in model infoview.
- I am able to Run report only for 1st. When I refresh and run with same parameter report shows error.
Any input will be great help.
Thanks,
NVHi,
Could you please test the following solutions to resolve the issue.
Solution1:
Test the issue by inserting the following parameter in .SBO file.
<Parameter Name="Force SQLExecute">Always</Parameter> .
Solution2
Just put SET NOCOUNT OFF in the end of the stored procedure SQL.
If the above doesnu2019t works then please try the following solution.
Solution3
Make the new connection from the scratch using ODBC connection and test the issue.
I hope this will help you.
Regards,
Sarbhjeet Kaur -
I want to know the top 10-20 Store procedures used in the table.
Hello All,
There are total 3500+ Store procedures created in the server. So, I want to know the top 10-20 Store procedures used in the table. Like which store procedures are important and what are they, is there any code to find them?
I think the question might be very silly, but i don't know which store procedure to look at it.
Please help me on this issue.
Thanks.
Thanks, Shyam.By what? CPU? Memory? Execution count?
Glenn Berry wrote this
-- HIGH CPU ************
-- Get Top 100 executed SP's ordered by execution count
SELECT TOP 100 qt.text AS 'SP Name', qs.execution_count AS 'Execution Count',
qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()) AS 'Calls/Second',
qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',
qs.total_worker_time AS 'TotalWorkerTime',
qs.total_elapsed_time/qs.execution_count AS 'AvgElapsedTime',
qs.max_logical_reads, qs.max_logical_writes, qs.total_physical_reads,
DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache'
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
WHERE qt.dbid = db_id() -- Filter by current database
ORDER BY qs.execution_count DESC
-- HIGH CPU *************
-- Get Top 20 executed SP's ordered by total worker time (CPU pressure)
SELECT TOP 20 qt.text AS 'SP Name', qs.total_worker_time AS 'TotalWorkerTime',
qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',
qs.execution_count AS 'Execution Count',
ISNULL(qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()), 0) AS 'Calls/Second',
ISNULL(qs.total_elapsed_time/qs.execution_count, 0) AS 'AvgElapsedTime',
qs.max_logical_reads, qs.max_logical_writes,
DATEDIFF(Minute, qs.creation_time, GetDate()) AS 'Age in Cache'
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
WHERE qt.dbid = db_id() -- Filter by current database
ORDER BY qs.total_worker_time DESC
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Using store procedures with SQLJ - please help!
I have two questions:
1.I wrote simple test appllication that uses SQLJ to run store
procedures from SQL package. It compiles and work fine from
JDeveloper 3 if I use java version JDK1.2.2_JDeveloper.
It compiles OK in regular JDK1.2.2 but raise the following
exception when running:
profile
com.itrade.trserver.truser.dbqueries.ItrHistorian_SJProfile0 not
found: java.io.InvalidClassException: [Ljava.lang.Object;;
Serializable is incompatible with Externalizable
Does it mean that I have to use JDeveloper JDK?
2.When I give other then default package for *.sqlj file the
*.sqlj file is added to project but I cannot see it in specified
package (the *.sqlj file is created in the its directory).
After I compile the project the I can see *.java file in the
specified package, but compiler gives errors about redefined
symbols. If I remove *.sqlj file from the project it compiles OK.
What I am doing wrong?
Yakov Becker
nullThank you for the response.
I don't create jar file. I run it from JDeveloper environment.
What do you mean by "I made sure to also copy over the
: the .ser file"? What purpose of the *.ser file in this case?
Yakov
JDeveloper Team (guest) wrote:
: I have come across this error before..
: I'm assuming that your jar file is in the classpath as
: specified in the Jserv configuration?
: When I had the error, I made sure to also copy over the
: the .ser file.
: In my case, I happened to have both my class files and
: the .ser file outside of a jar file and it worked..
: Hope this helps!
: Yakov Becker (guest) wrote:
: : I have two questions:
: : 1.I wrote simple test appllication that uses SQLJ to run
store
: : procedures from SQL package. It compiles and work fine from
: : JDeveloper 3 if I use java version JDK1.2.2_JDeveloper.
: : It compiles OK in regular JDK1.2.2 but raise the following
: : exception when running:
: : profile
: : com.itrade.trserver.truser.dbqueries.ItrHistorian_SJProfile0
: not
: : found: java.io.InvalidClassException: [Ljava.lang.Object;;
: : Serializable is incompatible with Externalizable
: : Does it mean that I have to use JDeveloper JDK?
: : 2.When I give other then default package for *.sqlj file the
: : *.sqlj file is added to project but I cannot see it in
: specified
: : package (the *.sqlj file is created in the its directory).
: : After I compile the project the I can see *.java file in the
: : specified package, but compiler gives errors about redefined
: : symbols. If I remove *.sqlj file from the project it
compiles
: OK.
: : What I am doing wrong?
: : Yakov Becker
null -
Error when run crystal report with store procedure in JSP
I try to run report which is developed by crystal report XI and store procedure (SQL 2005) with JSP.
But it occurs error that is "com.crystaldecisions.reports.reportengineinterface.JPEReportSource - failed to process getPage request: No results were returned by the query."
How can I do for solving this problem? Pls, help me !!!!!
(In other report which is not used store procedure I can run fine.)
Message was edited by:
Bonds_IdentityWhat version of CR are you using?
What CR updates are you using?
See sample apps here:
https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
in particular check out vbnet_win_pass_dataset_main_sub.zip
The [Crystal Reports for Visual Studio 2005 Walkthroughs|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23] will also be good to look at.
Ludek
Follow us on Twitter
http://twitter.com/SAPCRNetSup -
How to pass a run time parameter in a customized store procedure
Hi Friend
I have created customized Store Procedure for some logic. Presently i am executing the Store Procedure through the Data Manager Package.
But i need to pass a run time parameter at the time of execution the data manager package. Basically i want pass the Materail Dimension Member at the time of data manager execution .
Looking forward to your views on the same.
thanks
krishHi Krish,
For this, you maintain a script logic and from the script you call the stored procedure alongwith its parameters. Now build a DM on top of the script logic. While running the DM, it should ask the user to select the material members. These members will be automatically passed to the script through %MATERIAL_SET%. In your script, call the stored proc and once of the parameters should be %MATERAIL_SET%.
Hope this helps. -
How to run a SQL server store procedure from Apex (oracle)?
Our application needs to call a store procedure in the SQLserver database. The sotre procedure works fine in the SQL server side. However, when I tried to call the store procedure in TOAD as:
exec my_store_procedure(para1, para2);
I kept getting the error message:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'my_store_procedure'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
I have searched online but couldn't find the solution. This is an emergency, so prompt reply is Highly Appreciated!
LucHow is Oracle connecting to the SQL Server?
With the Transparent Gateway or Generic Connectivity?
I don't think that Generic Connectivity supports stored procedures.
The documentation for Heterogeneous Connectivity is here:
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14232/toc.htm
You'd probably get better answers from the Heterogeneous Connectivity forum:
Heterogeneous Connectivity -
How to find what values were passed onto a store procedure at the last run
my web application is calling a store procedure but not returning the desired results in the ASP.net page
when i execute the store procedure in sql server by providing the same values i get the desired result
is there any way i could tell what values were passed onto the store procedure when it was called by the web page
i am using sql server 2012 expressTo add to the Profiler suggestion, you can also capture this information using Extended Events. Below is a script example to capture RPC and batch completed events. This can be done from the SSMS Object Explorer as well:
--create ExtendedEvent session
CREATE EVENT SESSION [ParameterTrace] ON SERVER
ADD EVENT sqlserver.rpc_completed(
ACTION(sqlserver.sql_text)),
ADD EVENT sqlserver.sql_batch_completed(
ACTION(sqlserver.sql_text))
ADD TARGET package0.event_file(SET filename=N'C:\Temp\ParameterTrace.xel')
WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)
GO
--start session
ALTER EVENT SESSION [ParameterTrace] ON SERVER
STATE = START;
GO
--stop session
ALTER EVENT SESSION [ParameterTrace] ON SERVER
STATE = STOP;
--query trace data
SELECT CAST(event_data AS XML) AS event_data
FROM sys.fn_xe_file_target_read_file(N'C:\temp\ParameterTrace*', default, default, default);
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
UNABLE TO EXECUTE THE CMDSQL SCRIPT IN A STORE PROCEDURE.
I am trying to call a .sql file from sql cmd mode.
The requirement is to pass the .sql file as parameter value to the cmd script which I have able to achieve,here is the code which is working fine .
declare @x sysname
set @x = 'C:\Users\testuser\Desktop\testing.sql'
:OUT $(TEMP)\GetServerName1.sql
PRINT ':SETVAR FilePath'+ ' ' + @x
GO
:OUT stdout
:r $(TEMP)\GetServerName1.sql
GO
:r $(FilePath)
But when I try to wrap this code in store procedure it is giving the message fatal error but when I run it without wrapping it in store proc it is doing its job with no error . When I looked into the store proc I found the code as
ALTER proc [dbo].[testing]
as
declare @x sysname
set @x = 'C:\Users\testuser\Desktop\testing.sql'
PRINT ':SETVAR FilePath'+ ' ' + @x
It seems like the sqlcmd code disappears automatically. I have no clue why it is happening.
Can anyone help in letting me knw how to wrap the above code in store proc.
Thanks SauravIt is important to keep in mind that you have two entities in play here. One client and one server. The lines that start with a colon never sent to SQL Server, nor are the lines which reads "go". They are intercepted client-side. For instance :r
instructs SSMS to read a local file and out: redirects the output. And "go" breaks up the code in batches.
Erland Sommarskog, SQL Server MVP, [email protected] -
Permission problem calling a java object from a store procedure
When I run my store procedure
CREATE OR REPLACE PACKAGE BODY confirms_write_to_file
AS
FUNCTION translate(in_en_var in VARCHAR2)
RETURN VARCHAR2
AS LANGUAGE JAVA
NAME 'translate.translatePath(java.lang.String) return java.lang.String';
PROCEDURE write_to_file(in_file_name IN VARCHAR, in_en_var IN VARCHAR)
IS
file_handle UTL_FILE.FILE_TYPE;
file_location VARCHAR2(50);
BEGIN
file_location := translate(in_en_var);
dbms_output.put_line ('opened file location' ||file_location);
END write_to_file;
END confirms_write_to_file;
I get the following error:
exec confirms_write_to_file.write_to_file('zzzz','$RIMS_LOG');
SQL> exec confirms_write_to_file.write_to_file('zzzz','$RIMS_LOG');
Exception java.security.AccessControlException: the Permission
(java.io.FilePermission <<ALL FILES>> execute) has not been granted by
dbms_java.grant_permission to
SchemaProtectionDomain(RIMS|PolicyTableProxy(RIMS))
opened file locationProcess problem
PL/SQL procedure successfully completed.
When I try to to grant myself the permissions
begin
dbms_java.grant_permission('rims','java.io.FilePermission','*','execute');
dbms_java.grant_permission('rims', 'java.lang.RuntimePermission', '*','writeFileDescriptor' );
end;
I get the following Error:
oracle.aurora.vm.IdNotFoundException: rims is not a user or role
at oracle.aurora.rdbms.DbmsRealm.getId(DbmsRealm.java)
at oracle.aurora.rdbms.DbmsRealm.getId(DbmsRealm.java)
at
oracle.aurora.rdbms.security.PolicyTableManager.findAll(PolicyTableManager.java)
at oracle.aurora.rdbms.security.PolicyTableManager.find(PolicyTableManager.java)
at
oracle.aurora.rdbms.security.PolicyTableManager.activate(PolicyTableManager.java
at
oracle.aurora.rdbms.security.PolicyTableManager.grant(PolicyTableManager.java)
begin
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
oracle.aurora.vm.IdNotFoundException: rims is not a user or role
ORA-06512: at "SYS.DBMS_JAVA", line 0
ORA-06512: at line 2
My java code is as follows
import java.io.*;
import java.util.*;
class translate
public static String translatePath(String envar)
Runtime rt = Runtime.getRuntime();
int bufSize = 4096;
byte buffer[] = new byte[bufSize];
String path = null;
Process p = null;
int len = 0;
try
p = rt.exec("echo "+envar);
BufferedInputStream bis = new BufferedInputStream(p.getInputStream());
while ((len = bis.read(buffer, 0, bufSize)) != -1)
System.out.write(buffer, 0, len);
path = new String(buffer);
p.waitFor();
catch(Exception e)
System.out.println("Exception "+e);
return "Process problem ";
return path;Tony,
I answered this very same question that you posted at the JavaRanch forum.
Good Luck,
Avi. -
How to load and define Java Store Procedures using Consolidator Manager??
Hi,
I am trying to create a store procedure with a very easy example and I can not succeed. i am a bit new with OLite and I will appreciate any help from your side. I am quite lost now regarding of using java with OLite and it is becoming quite urgent for me. Thanks a lot in advanced.
Those are the steps that I follow:
- Creating the java class
I create the java file MYUPPER.java with next code :
public class MYUPPER {
public static String doUpper( String p_text )
return p_text.toUpperCase();
I compile it and I create the jar file:
C:\>javac MYUPPER.java
C:\>jar cf MYUPPER.jar MYUPPER.class
- This is an abstract of my java code using the API:
( m_cm is ConsolidatorManager)
// Create the java resource
m_cm.createStoredProc( "MYUPPER.jar", "MYUPPER", "doUpper", "doUpper");
// Add it to the publication
m_cm.addJavaResource( "PMTS", "MYUPPER" );
- After running that code I do not receive any exception and checking into the repository looks ok:
a) From the Mobile Server I can see the Java Ressource MYUPPER for that publication
b) I can see the entries in C$Resouces and in C$Pub_Objects as well
*** ON THE CLIENT:
Then I go to the client device a Windows XP labtop where I did install the jre 5.0 and I added the bin path to the system variable PATH.
- I get a POL-8000 error when synchronizing (could not start the Java Visrtual Machine)
- Anyway, I can see the MYUPPER.class file deployed in the same directory than the databases are.
- I have also tried next from msql:
c:\>msql system/manager@jdbc:polite:tomeu_conscli
Oracle Lite MSQL Version 10.3.0.2.0
Copyright (c) 1997, 2008, Oracle. All rights reserved.
Connected to: Oracle Lite ORDBMS
Database Name: CONSCLI (Read Write)
Database Version: 10.3.0.2.0
Auto Commit: off
Driver Name: oracle.lite.poljdbc.POLJDBCDriver (OLite 4.0)
SQL> select * from c$resources;
PUB_NAME | DB_NAME | RESOURCE_NAME | RESOURCE_TYPE | RESOURCE_DATA
PMTS | pmts | MYUPPER | JAVA CLASS | -¦¦¥ 1
1 row(s) returned
SQL>
SQL> exit
Disconnected from CONSCLI
c:\>msql system/*****@jdbc:polite:tomeu_pmts
Oracle Lite MSQL Version 10.3.0.2.0
Copyright (c) 1997, 2008, Oracle. All rights reserved.
Connected to: Oracle Lite ORDBMS
Database Name: PMTS (Read Write)
Database Version: 10.3.0.2.0
Auto Commit: off
Driver Name: oracle.lite.poljdbc.POLJDBCDriver (OLite 4.0)
SQL> select doUpper('fhjdjf') from dual;
[POL-8035] no such attribute or method
SQL> create table sp (id number(1) primary key );
Table created
SQL> alter table sp attach java source "MYUPPER" in '.';
[POL-8028] error in calling a Java method
SQL> commit;
Commit complete
SQL> select sp.doUpper('fhjdjf') from dual;
[POL-8035] no such attribute or method
Lost... :(
Tomeusorry to bother, similar like above, i tried many times on my computer to load a simple image in java application.. here's my code:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.net.*;
import javax.swing.*;
public class View extends JFrame {
private URL imageURL;
private File file;
private Image sourceImage;
private String name, title, message;
private int width, height;
public static void main(String[] args) {
System.out.println( "Hello Eros!!!" );
View img = new View();
public View() {
name = "D:/shared/inputpic.gif";
file = new File( name );
Toolkit toolkit = Toolkit.getDefaultToolkit();
try {
imageURL = new URL("http://www.google.com.my/images/logo_sm.gif" );
} catch (MalformedURLException e) {
if ( file == null ) {
sourceImage = Toolkit.getDefaultToolkit().getImage( name );
System.out.println( file );
} else {
sourceImage = toolkit.getImage( imageURL );
System.out.println( file );
width = sourceImage.getWidth( this );
height = sourceImage.getHeight( this );
System.out.println( "Pixel = " + width + "x" + height );
if ( width * height == 1 ) {
title = "Greetings"; // Shown in title bar of dialog box.
if ( file == null ) {
message = "Unable to load the file " + name;
} else {
message = "Unable to load the link " + imageURL;
JOptionPane.showMessageDialog(null, message, title, JOptionPane.INFORMATION_MESSAGE);
}could anyone test this n give my the reason i couldnt even load the image -
hello, we need to remove the dirty data from MDS, but we found we can only do this from MDS web, and we need to do this by store procedure to make this process automatically. is there any easy method to remove the data from MDS automatically? thank.
WarrenHi Warren,
Assuming the dirty data is easily identifiable, all you need to do is use the staging process with import type of 5 (de-activate - i.e., soft delete) or import type of 6 (hard delete).
Could give more details if I knew the version of MDS you are running (SQL 2008R2 or SQL 2012).
Kind regards,
M -
Store procedure doesn't return resultset
hi guys
i m stuck in a prob.I am using "com.microsoft.jdbc.sqlserver.SQLServerDriver"
when i call a normal query it run fine but when i try to call a store procedure it gives no result set was produce, is it a problem with driver but if i use jdbsodbc driver it work fine.
code:-
pStmt= conn.prepareStatement("{call insertOpacResultsTemp(?,?,?,?,?)}");
pStmt.setString(1,sUserID);
//and other parameters
Resultset=pStmt.executeQuery();
plz guys help me outHello Amit,
Oracle Stored Procedure
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
create or replace package test_package as
type my_cursor is ref cursor;
procedure test_procedure (name in varchar2,sys_cursor out my_cursor);
end test_package;
create or replace package body test_package
as
procedure test_procedure (name in varchar2,sys_cursor out my_cursor)
as
l_sys_cursor my_cursor;
begin
open l_sys_cursor
for select * from krm_system
where parameter_id = name;
sys_cursor:= l_sys_cursor;
end test_procedure;
end test_package;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Java code for getting result set
import java.sql.*;
import oracle.sql.*;
import oracle.jdbc.driver.*;
public class StoredProcTester{
public static void main(String args[]){
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:isorcl","user_id","password");
CallableStatement cstmt = conn.prepareCall("{call test_package.test_procedure(?,?)}");
cstmt.setString(1,"MAX_MEMORY");
cstmt.registerOutParameter(2,OracleTypes.CURSOR);
cstmt.execute();
ResultSet rs = (ResultSet)cstmt.getObject(2);
while(rs.next()){
System.out.println("ID\t" + rs.getString(1));
}catch(Exception e){
e.printStackTrace();
} -
Writing a stored procedure to import SQL Server table data into a Oracle table
Hello,
As a new DBA I have been tasked with writing a stored procedure to import SQL Server table data into an Oracle table. I have been given many suggestions on how to do it from SQL Server but I I just need to write a stored procedure to run it from the Oracle side. Suggestions/guidance on where to start would be greatly appreciated! Thank you!
I started to write it based on what I have but I know this is not correct :/
# Here is the select statement for the data source in SQL Server...
SELECT COMPANY
,CUSTOMER
,TRANS_TYPE
,INVOICE
,TRANS_DATE
,STATUS
,TRAN_AMT
,CREDIT_AMT
,APPLD_AMT
,ADJ_AMT
,TRANS_USER1
,PROCESS_LEVEL
,DESCRIPTION
,DUE_DATE
,OUR_DATE
,OUR_TIME
,PROCESS_FLAG
,ERROR_DESCRIPTION
FROM data_source_table_name
#It loads data into the table in Oracle....
Insert into oracle_destination_table_name (
COMPANY,
CUSTOMER,
TRANS_TYPE,
INVOICE,
TRANS_DATE,
STATUS,
TRANS_AMT,
CREDIT_AMT,
APPLD_AMT,
ADJ_AMT,
TRANS_USER1,
PROCESS_LEVEL,
DESCRIPTION,
DUE_DATE,
OUR_DATE,
OUR_TIME,
PROCESS_FLAG,
ERROR_DESCRIPTION)
END;CREATE TABLE statements would have been better as MS-SQL and Oracle don't have the same data types.
OUR_DATE, OUR_TIME will (most likely) be ONE column in Oracle.
DATABASE LINK
Personally, I'd just load the data over a database link:
insert into oracle_destination_table_name ( <column list> )
select ... <transform data here>
from data_source_table@mssql_db_link
As far as creating the database link from Oracle to MS-SQL ... that is for somebody else to answer.
(most likely you'll need to use an ODBC driver)
EXTERNAL TABLE
If the data from MS-SQL is in a CSV file, just use and external table.
same concept:
insert into oracle_destination_table_name ( <column list> )
select ... <transform data here>
from data_source_external_table
MK -
Problem listing code of a store procedure
i am trying to list code of a store procedure by running following sql
select text from user_source where name = 'sp_insert_hpemployee' and type = 'procedure';
it says
no rows selected
can you please let me know where i am going wrong.select text from user_source where UPPER(name) = 'SP_INSERT_HPEMPLOYEE' and upper(type) = 'PROCEDURE';
or
select dbms_metadata.get_ddl('PROCEDURE','SP_INSERT_HPEMPLOYEE') from dual;
Maybe you are looking for
-
Hard drive crashed how do I get my tunes back
How do I recreate the itunes that I have purchased...I didn't back them up and my hd crashed...
-
I have an ad with no skip or close button on my words with friends ap. how can i close it without removing and reloading the ap?
-
Acrobat PDF Maker -- Mail Merge (WORD 10)
I am mail merging from a three tab excel. While using the second tab to drive the merge I selected "Automatically send...by email" however, the "To:" field does not tie to the excel tab I am working from. (just sent a bunch of emails to the wrong f
-
How does iPhoto v. 8 name the folders inside iPhoto Library?
iPhoto used to name the folders (holding original photos) the same as the event name. Now it seems to use the date of the photo, but does not change the folder name to the event name. Is this the case with the newer version? thx
-
IWeb "failure reading disk quota"
Every time I have tried to publish from iWeb to my .Mac account I have been met with the following error: " Failure reading iDisk quota". I can connect to my iDisk just fine otherwise and I have all my space allocated to it. I called Apple technical