Procedure into procedure.
procedure A1
A1 -- start
A1 -- end
procedure B1
B1 --start
A1.. -- i am calling A1 procedure.
B1 --end
if i execute procedure A1 is compile fine.
if i execute procedure B1 is compile fine.
A1 -- start
B1 calling B1 procedure. ( some condition).
A1 -- end
My problem is unable to complie the program successfully.
any solutions
???
My problem is unable to complie the program successfully.
any solutions
???Typical scenerio that justifies usage of Packaged procedure above Standalone ones, packages break dependency chains and allow Forward Declarations.
Read [url http://asktom.oracle.com/pls/asktom/f?p=100:11:2898281757877174::::P11_QUESTION_ID:286816015990]reply from Tom to a similar question.
Similar Messages
-
Passing a table into a procedure to be used in a curor
Hi,
I'm using Oracle 9.2.0.6
I have a procedure that searches all objects for a passed in string value. The procedure is below.
CREATE OR REPLACE PROCEDURE Find_String (
pin_referenced_name IN dba_dependencies.referenced_name%TYPE)
IS
cursor cur_get_dependancy
is
SELECT distinct owner, name, type
FROM [email protected]
WHERE lower(referenced_name) = lower(pin_referenced_name) --'ftbv_salesrep_all_1d'
AND referenced_type != 'SYNONYM'
order by name;
v_owner varchar2(40);
v_name varchar2(50);
v_type varchar2(40);
BEGIN
dbms_output.put_line(upper(pin_referenced_name)||' is found in the following objects.');
dbms_output.put_line(' ');
dbms_output.put_line(RPAD('OWNER', 30, ' ')||RPAD('NAME', 60, ' ')||RPAD('OBJECT TYPE', 30, ' '));
dbms_output.put_line('-------------------------------------------------------------------------------------------------------------------');
FOR i IN cur_get_dependancy
LOOP
v_owner := RPAD(i.owner, 30, ' ');
v_name := RPAD(i.name, 45, ' ');
v_type := RPAD(i.type, 30, ' ');
dbms_output.put_line(v_owner ||v_name|| v_type);
END LOOP;
END find_string;I was wondering if there's any way I could pass in the table name, and the name of the DB link to be used in the cursor, into the procedure and rig the cursor to be able to accept that as a parameter. I want our users to be able to search different databases using this utility code.
I thought of NDS, and that would be a way to do it, however I'm not sure if I could use an NDS statement in conjunction with a cursor.
Does anybody have any suggestions?
ThanksOne approach (there are obviously many ways to skin this particular cat)
SQL> ed
Wrote file afiedt.buf
1 declare
2 c1 sys_refcursor;
3 l_val number;
4 l_table_name varchar2(30) := 'dual';
5 begin
6 open c1 for 'select 1 from ' || l_table_name;
7 loop
8 fetch c1 into l_val;
9 exit when c1%notfound;
10 dbms_output.put_line( l_val );
11 end loop;
12 close c1;
13* end;
SQL> /
1
PL/SQL procedure successfully completed.Justin -
Hi,
How do I return two values from a
stored procedure into an "Execute SQL Task" please? Each of these two values need to be populated into an SSIS variable for later processing, e.g. StartDate and EndDate.
Thinking about stored procedure output parameters for example. Is there anything special I need to bear in mind to ensure that the SSIS variables are populated with the updated stored procedure output parameter values?
Something like ?
CREATE PROCEDURE [etl].[ConvertPeriodToStartAndEndDate]
@intPeriod INT,
@strPeriod_Length NVARCHAR(1),
@dtStart NVARCHAR(8) OUTPUT,
@dtEnd NVARCHAR(8) OUTPUT
AS
then within the SSIS component; -
Kind Regards,
Kieran.
Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/Below execute statement should work along the parameter mapping which you have provided. Also try specifying the parameter size property as default.
Exec [etl].[ConvertPeriodToStartAndEndDate] ?,?,? output, ? output
Add a script task to check ssis variables values using,
Msgbox(Dts.Variables("User::strExtractStartDate").Value)
Do not forget to add the property "readOnlyVariables" as strExtractStartDate variable to check for only one variable.
Regards, RSingh -
Procedure with multiple Loops and Insert into table
Hello All,
I am trying to create the Procedure to create a new table for our DWH.
In this Case, I have 2 tables and I need to create Loop for each value from one table and get the respective data from second table based on first table data.
Please find the below example:
First table: TABLE_A
X Y Z
1 a 10
1 b abc
1 c xy
1 e $
2 a 11
2 c asf
2 d tal
2 f ghs
Second Table: TABLE_B
A B C D E F
10 abc xy sd ew 100
10 jhy xy sd ew 100
11 ght asf tal ss ghs
11 ght afr tal ss ghs
O/P Table from Procedure: OUTPUT_TABLE
A B C D E F X
10 abc xy sd ew 100 1
11 ght asf tal ss ghs 2
Business Logic In the Procedure:
CREATE OR REPLACE PROCEDURE OP_TAB_PROCEDURE IS
BEGIN
-- First get the DISTINCT values from the TABLE_A to generate the Loop
FOR ID (SEELCT DISTINCT X FROM TABLE_A_
LOOP
-- For Each ID get the Y ,Z values from TABLE_A other than $ in Z
TEMP:
SELECT Y, Z FROM TABLE_A WHERE X = ID.X AND Z <> '$' ;
Based on above SELECT statement, I need to construct dynamic SQL query to get the data from TABLE_B
OP_EACH_ID:
SELECT * , ID.X AS X FROM TABLE_A WHERE [In this place I need generate sql cond dynamically. For Example, For X=1 in TABLE_A , the where cond must A=10 AND B='abc' AND C='xy'
For X=2 , the Where cond must be WHERE A=11 AND C='asf' AND D='tal' AND F='ghs']
-- I need to INSERT all the values from OP_EACH_ID into OUT_PUT_TABLE
END LOOP ;
END;
I am new to PL/SQL , so please help me on the above case.duplicate post
-
hi,
Every thing is set now. But only one issue is left over.
CREATE OR REPLACE package dyn_query_MBU21
is
type r_cur is ref cursor;
procedure get_query(p_scorecard_id in integer,p_user_id in integer,p_start_bu in integer,p_end_bu IN INTEGER,p_parent_srsid in integer);
procedure printQuery(p_scorecard_id integer,p_user_id integer,p_start_bu integer,p_end_bu integer,p_parent_srsid integer);
end dyn_query_MBU21;
CREATE OR REPLACE package body dyn_query_MBU21
is
procedure get_query(p_scorecard_id in integer,p_user_id in integer,p_start_bu in integer,p_end_bu IN INTEGER,p_parent_srsid in integer)
is
l_query VARCHAR2(32700);
v_temp varchar2(300);
v_strLength integer;
val integer;
--p_start_bu INTEGER;
--p_end_bu INTEGER;
--v_cur r_cur;
l_buCount integer default 0;
BEGIN
l_query := 'select
a.PLAN_TO_WIN PTWID,
a.SPQRC SPQRCID,
l.NAME Plan_to_Win,
m.NAME BPD,
a.metric_id,
a.NAME Key_Measures,
a.DESCRIPTION,
c.DATE_MONTH_DIM_KEY,
c.CALENDAR_MONTH_NBR,
c.CALENDAR_YEAR_MONTH_CDE,
e.SRS_ID,e.YEAR_VALUE,
f.YTD_VALUE YTD,
g.CALENDAR_YEAR_NBR,
h.FIRST_NAME || h.LAST_NAME Scorecard_Owner
, j.TYPE_NAME Management_Level,
k.NAME Business_Unit
, N.SCORECARD_ID
, N.NAME
, K.LOC_CURRENCY_ID
--decode(ltrim(rtrim(k.PARENT_SRS_ID)),' || p_parent_srsid || ', k.NAME) Parent_BU ';
, decode(ltrim(rtrim(k.PARENT_SRS_ID)),3,''Bill Boggs'') Parent_BU ';
for x in ( select distinct NAME from SRS_DIM where parent_srs_id = p_parent_srsid and rownum < 20)
loop
l_buCount := l_buCount + 1;
l_query := l_query ||
' , decode(ltrim(rtrim(K.NAME)),'''||ltrim(rtrim(x.NAME))||''', D.MONTH_VALUE ) '||replace(to_char(x.NAME),' ','_');
-- dbms_output.put_line('this is the query'||l_query);
end loop;
l_query := l_query ||
' FROM
METRIC_DIM A,TARGET_MONTH B,DATE_MONTH_DIM C,METRIC_SRS_MONTH_EVAL D,TARGET_YEAR E,METRIC_SRS_YTD_EVAL F,DATE_YEAR_DIM G,
GM_USER_DIM H,USER_PRIV I,SRS_ITEMTYPE_DIM J,SRS_DIM K,PLAN_TO_WIN_DIM L,SPQRC_DIM M,SCORECARD_DIM N
WHERE
L.PLAN_TO_WIN_ID= A.PLAN_TO_WIN
AND M.SPQRC_ID= A.SPQRC
AND A.METRIC_ID=B.METRIC_ID
AND B.DATE_MONTH_DIM_KEY=C.DATE_MONTH_DIM_KEY
AND B.SRS_ID=K.SRS_ID
AND B.SRS_ID=F.SRS_ID
AND D.SRS_ID=F.SRS_ID
AND D.SRS_ID=K.SRS_ID
AND D.DATE_DIM_KEY=C.DATE_MONTH_DIM_KEY
AND D.METRIC_ID = B.METRIC_ID
AND D.METRIC_ID = E.METRIC_ID
AND D.METRIC_ID = F.METRIC_ID
and d.SRS_ID=b.SRS_ID
and d.DATE_DIM_KEY=b.DATE_MONTH_DIM_KEY
AND E.SRS_ID = F.SRS_ID
AND G.DATE_YEAR_DIM_KEY = E.DATE_YEAR_DIM_KEY
AND G.CALENDAR_YEAR_NBR = C.CALENDAR_YEAR_NBR
AND F.DATE_DIM_KEY = E.DATE_YEAR_DIM_KEY
AND K.PARENT_SRS_ID =n.SRS_ID
AND N.SCORECARD_ID= :p_scorecard_id
AND H.USER_ID = :p_user_id
AND K.SRS_ID BETWEEN :p_start_bu AND :p_end_bu
--AND P_PARENT_SRS_ID = :p_parent_srsid1
-- ANd n.Scorecard_id=2
-- AND H.USER_ID = 7000001
AND J.TYPE_ID = :p_parent_srsid
--AND K.SRS_ID = 8
GROUP BY
a.PLAN_TO_WIN,
a.SPQRC,
l.NAME,
m.NAME,
a.metric_id,
a.NAME,
a.DESCRIPTION,
c.DATE_MONTH_DIM_KEY,
c.CALENDAR_MONTH_NBR,
c.CALENDAR_YEAR_MONTH_CDE,
e.SRS_ID,
e.YEAR_VALUE,
f.YTD_VALUE,
g.CALENDAR_YEAR_NBR,
h.FIRST_NAME || h.LAST_NAME,
j.TYPE_NAME,
K.NAME,
l.PLAN_TO_WIN_ID,
m.SPQRC_ID,
N.SCORECARD_ID,
N.NAME,
K.LOC_CURRENCY_ID,
--decode(ltrim(rtrim(k.PARENT_SRS_ID)),' || p_parent_srsid || ', k.NAME) Parent_BU ';
, decode(ltrim(rtrim(k.PARENT_SRS_ID)),3,''Bill Boggs'') Parent_BU ';
for x in (select distinct NAME from SRS_DIM where parent_srs_id = p_parent_srsid and rownum < 20 )
loop
l_query := l_query ||' , decode(ltrim(rtrim(K.NAME)),''' || x.NAME || ''', D.MONTH_VALUE ) ';
end loop;
l_query := l_query ||'order by a.PLAN_TO_WIN';
-- open p_cur for l_query using p_scorecard_id,p_user_id,p_start_bu,p_end_bu,p_parent_srsid;
select (length(l_query)/255) + 1 into v_strLength from dual;
dbms_output.put_line('String Lenghth is :'||v_strLength);
for c in 1..v_strLength
loop
if c = 1 then
v_temp := SUBSTR(l_query, 1, 255);
else
if length(l_query) > (255 * c) then
v_temp := SUBSTR(l_query, 255 * (c-1) , 255);
end if;
end if;
dbms_output.put_line(v_temp);
end loop;
end get_query;
procedure printQuery(p_scorecard_id in integer,p_user_id in integer,p_start_bu in integer,p_end_bu IN INTEGER,p_parent_srsid in integer) is
Begin
get_query(p_scorecard_id,p_user_id,p_start_bu,p_end_bu,p_parent_srsid);
End printQuery;
end dyn_query_MBU21;
I want to split this procedure into 6 procedures to make it look easier.
1.getSQLSelect
2.getSQLFrom
3.getSQLWhere
4.getSQLGroupBY
5.getSQLOrderBY
add another proc...getSQL that returns all the above procs ie,
I need to build the entire sql & call "Open Cursor" meaning...getSQLSelect||getSQLFrom()...
How to do this ?
Thanks in AdvanceYou're missing a comma.
-
Procedure to save the output of a query into excel file or flat file
Procedure to save the output of a query into excel file or flat file
I want to store the output of my query into a file and then export it from sql server management studio to a desired location using stored procedure.
I have run the query --
DECLARE @cmd VARCHAR(255)
SET @cmd = 'bcp "select * from dbo.test1" queryout "D:\testing2.xlsx;" -U "user-PC\user" -P "" -c '
Exec xp_cmdshell @cmd
error message--
SQLState = 28000, NativeError = 18456
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'user-PC\user'.
NULL
Goel.AmanHello,
-T:
Specifies that the bcp utility connects to SQL Server with a trusted connection using integrated security. The security credentials of the network user,
login_id, and password are not required. If
–T is not specified, you need to specify
–U and –P to successfully log in.
-U:
Specifies the login ID used to connect to SQL Server.
Note: When the bcp utility is connecting to SQL Server with a trusted connection using integrated security, use the
-T option (trusted connection) instead of the
user name and password combination
I would suggest you take a look at the following article:
bcp Utility: http://technet.microsoft.com/en-us/library/ms162802.aspx
A similar thread regarding this issue:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b450937f-0ef5-427a-ae3b-115335c0d83c/bcp-connection-error-sqlstate-28000-nativeerror-18456?forum=sqldataaccess
Regards,
Elvis Long
TechNet Community Support -
Passisng array from Java into PL/SQL procedure
Hi everybody!
I have type created with :
CREATE OR REPLACE TYPE my_type IS TABLE OF number;
Next I have procedure withinin a package which has parameters:
PROCEDURE my_proc
(p_Result OUT NUMBER,
p_Id table.column%TYPE,
p_MyType my_type
I call this procedure from Java :
import javax.sql.*;
import java.sql.*;
import oracle.jdbc.*;
import oracle.sql.ARRAY;
import oracle.sql.ArrayDescriptor;
public class MyClass extends QueryClient {
private int Id;
private int type;
private Integer[] List;
private int result;
public MyClass(int Id, eType type,
Integer[] List) throws SQLException {
this.Id = Id;
this.type = (type.equals(eType.TYPE_EXPORT) ? 1 : 0);
this.List = List;
this.execute("{call my_package.my_proc(?,?,?,?)}");
public void body(CallableStatement stmt) throws SQLException {
ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("MY_USER.MY_TYPE", getCon());
ARRAY array_to_pass = new ARRAY(descriptor, getCon(), this.List);
// register the type.
stmt.registerOutParameter(1, OracleTypes.NUMBER); // result of procedure calling
stmt.setInt(2, this.Id );
stmt.setInt(3, this.type);
stmt.setArray(4, array_to_pass);
// execute and retrieve the result set
stmt.execute();
this.result = stmt.getInt(1);
public int getResult() {
return result;
EVERYTHING WORKS FINE, BUT when I move type "my_type" into package header
TYPE my_type IS TABLE OF number;
I receive error after calling procedure
java.sql.SQLException: invalid name pattern: MY_USER.MY_TYPE
I dropped type my_type after moving it into package. So there is only one my_type, in the package.
User who call procedure is owner of the package.
So questions are:
1. Is it possible to have my_type within package without error?
2. Is it possible to describe my_type without having a connection to database? My aim is eliminate number of connections to database.
Thanks all.
Matus.You can't use the packaged type for this. You need to use the original collection type (i.e. via the CREATE TYPE syntax) as you have discovered yourself.
Regards -
How do I import an existing finalised movie clip into a new developing project ? I go through the imovie 11 procedure for importing and the list of clips (finalised and un-finalised) appears, but always "greyed out" which makes it impossible to create anything. I have tried placing it on the desk top and dragging but this doesn't work either.
AppleMan Thanks very much for the information, however I could't make it work. I followed your instructions to the letter, in fact I tried every which-way. I created a dedicated file into which I copied and pasted the project from "package contents" but it was still greyed out when I went to retrieve it. I also found that the file size was reduced to only a few Kb. Any further step-by-step instructions would be appreciated as I am obviously doing something wrong. Babowa It appears that in imovie everything has to be "finalised" before it can be used or shared elsewhere in the same way as a disk has to be to be played elsewhere. Funnily enough an MOV file I converted to Mp4 was not greyed out and I was able to import it.... an exercise I am not keen on because of resolution loss during conversion
-
Hi,
Iam new to the xml,
can u please anyone help me how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
<?xml version="1.0"?>
<DiseaseCodes>
<Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
</DiseaseCodes>.
Regards,
vikram.here is the your XML parse in 11g :
select *
from xmltable('//Entity' passing xmltype
'<?xml version="1.0"?>
<DiseaseCodes>
<Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
</DiseaseCodes>
') columns
"dcode" varchar2(4000) path '/Entity/dcode',
"ddesc" varchar2(4000) path '/Entity/ddesc',
"reauthflag" varchar2(4000) path '/Entity/reauthflag'
dcode ddesc reauthflag
0 (I87)Other disorders of veins - postphlebitic syndrome 0
0 (J04)Acute laryngitis and tracheitis 0
0 (J17*)Pneumonia in other diseases - whooping cough 0
SQL>
Using this parser you can create procedure as
SQL> create or replace procedure myXMLParse(x clob) as
2 begin
3 insert into MyXmlTable
4 select *
5 from xmltable('//Entity' passing xmltype(x) columns "dcode"
6 varchar2(4000) path '/Entity/dcode',
7 "ddesc" varchar2(4000) path '/Entity/ddesc',
8 "reauthflag" varchar2(4000) path '/Entity/reauthflag');
9 commit;
10 end;
11
12 /
Procedure created
SQL>
SQL>
SQL> exec myXMLParse('<?xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>');
PL/SQL procedure successfully completed
SQL> select * from MYXMLTABLE;
dcode ddesc reauthflag
0 (I87)Other disorders of veins - postphlebitic syndrome 0
0 (J04)Acute laryngitis and tracheitis 0
0 (J17*)Pneumonia in other diseases - whooping cough 0
SQL>
SQL>
Ramin Hashimzade -
How do I insert multiple values into different fields in a stored procedure
I am writing a Stored Procedure where I select data from various queries, insert the results into a variable and then I insert the variables into final target table. This works fine when the queries return only one row. However I have some queries that return multiple rows and I am trying to insert them into different fields in the target table. My query is like
SELECT DESCRIPTION, SUM(AMOUNT)
INTO v_description, v_amount
FROM SOURCE_TABLE
GROUP BY DESCRIPTION;
This returns values like
Value A , 100
Value B, 200
Value C, 300
The Target Table has fields for each of the above types e.g.
VALUE_A, VALUE_B, VALUE_C
I am inserting the data from a query like
INSERT INTO TARGET_TABLE (VALUE_A, VALUE_B, VALUE_C)
VALUES (...)
How do I split out the values returned by the first query to insert into the Insert Statement? Or do I need to split the data in the statement that inserts into the variables?
Thanks
GB"Some of the amounts returned are negative so the MAX in the select statement returns 0 instead of the negative value. If I use MIN instead of MAX it returns the correct negative value. However I might not know when the amount is going to be positive or negative. Do you have any suggestions on how I can resolve this?"
Perhaps something like this could be done in combination with the pivot queries above, although it seems cumbersome.
SQL> with data as (
2 select 0 a, 0 b, 0 c from dual -- So column a has values {0, 1, 4},
3 union select 1 a, 2 b, -3 c from dual -- column b has values {0, 2, 5},
4 union select 4 a, 5 b, -6 c from dual ) -- column c has values {0, -3, -6}.
5 --
6 select ( case when max.a > 0 then max.a else min.a end) abs_max_a
7 , ( case when max.b > 0 then max.b else min.b end) abs_max_b
8 , ( case when max.c > 0 then max.c else min.c end) abs_max_c
9 from ( select ( select max(a) from data ) a
10 , ( select max(b) from data ) b
11 , ( select max(c) from data ) c
12 from dual ) max
13 , ( select ( select min(a) from data ) a
14 , ( select min(b) from data ) b
15 , ( select min(c) from data ) c
16 from dual ) min
17 /
ABS_MAX_A ABS_MAX_B ABS_MAX_C
4 5 -6
SQL> -
Line 390 Under the (Insert into SALES_TRADEIN Table)
I need to insert (TradeIn_1_VIN) Values If there is no values in (TradeIn_1_VIN) then i have to insert (TradeIn_2_VIN) values to the (SALES_TRADEIN) Table.
After i run then below script only (TradeIn_2_VIN) values are get inserted in the table. (TradeIn_1_VIN) are not getting loaded in to the table.
I think there is the problem from Line No (404 to 414) Please help me change those particular lines to insert (TradeIn_1_VIN) Values also.If there is no details then (TradeIn_2_VIN) need to be inserted.
-- =============================================
-- Stored Procedure for Flatfile_Sales
-- =============================================
USE [IconicMarketing]
---==========Sales_Cursor
--USE [IconicMarketing]
--GO
DECLARE
@FileType
varchar(50),
@ACDealerID
varchar(50),
@ClientDealerID
varchar(50),
@DMSType
varchar(50),
@DealNumber
varchar(50),
@CustomerNumber
varchar(50),
@CustomerName
varchar(50),
@CustomerFirstName
varchar(50),
@CustomerLastName
varchar(50),
@CustomerAddress
varchar(50),
@CustomerCity
varchar(50),
@CustomerState
varchar(50),
@CustomerZip
varchar(50),
@CustomerCounty
varchar(50),
@CustomerHomePhone
varchar(50),
@CustomerWorkPhone
varchar(50),
@CustomerCellPhone
varchar(50),
@CustomerPagerPhone
varchar(50),
@CustomerEmail
varchar(50),
@CustomerBirthDate
varchar(50),
@MailBlock
varchar(50),
@CoBuyerName
varchar(50),
@CoBuyerFirstName
varchar(50),
@CoBuyerLastName
varchar(50),
@CoBuyerAddress
varchar(50),
@CoBuyerCity
varchar(50),
@CoBuyerState
varchar(50),
@CoBuyerZip
varchar(50),
@CoBuyerCounty
varchar(50),
@CoBuyerHomePhone
varchar(50),
@CoBuyerWorkPhone
varchar(50),
@CoBuyerBirthDate
varchar(50),
@Salesman_1_Number
varchar(50),
@Salesman_1_Name
varchar(50),
@Salesman_2_Number
varchar(50),
@Salesman_2_Name
varchar(50),
@ClosingManagerName
varchar(50),
@ClosingManagerNumber
varchar(50),
@F_AND_I_ManagerNumber
varchar(50),
@F_AND_I_ManagerName
varchar(50),
@SalesManagerNumber
varchar(50),
@SalesManagerName
varchar(50),
@EntryDate
varchar(50),
@DealBookDate
varchar(50),
@VehicleYear
varchar(50),
@VehicleMake
varchar(50),
@VehicleModel
varchar(50),
@VehicleStockNumber
varchar(50),
@VehicleVIN
varchar(50),
@VehicleExteriorColor
varchar(50),
@VehicleInteriorColor
varchar(50),
@VehicleMileage
varchar(50),
@VehicleType
varchar(50),
@InServiceDate
varchar(50),
@HoldBackAmount
varchar(50),
@DealType
varchar(50),
@SaleType
varchar(50),
@BankCode
varchar(50),
@BankName
varchar(50),
@SalesmanCommission
varchar(50),
@GrossProfitSale
varchar(50),
@FinanceReserve
varchar(50),
@CreditLifePremium
varchar(50),
@CreditLifeCommision
varchar(50),
@TotalInsuranceReserve
varchar(50),
@BalloonAmount
varchar(50),
@CashPrice
varchar(50),
@AmountFinanced
varchar(50),
@TotalOfPayments
varchar(50),
@MSRP varchar(50),
@DownPayment
varchar(50),
@SecurityDesposit
varchar(50),
@Rebate
varchar(50),
@Term varchar(50),
@RetailPayment
varchar(50),
@PaymentType
varchar(50),
@RetailFirstPayDate
varchar(50),
@LeaseFirstPayDate
varchar(50),
@DayToFirstPayment
varchar(50),
@LeaseAnnualMiles
varchar(50),
@MileageRate
varchar(50),
@APRRate
varchar(50),
@ResidualAmount
varchar(50),
@LicenseFee
varchar(50),
@RegistrationFee
varchar(50),
@TotalTax
varchar(50),
@ExtendedWarrantyName
varchar(50),
@ExtendedWarrantyTerm
varchar(50),
@ExtendedWarrantyLimitMiles
varchar(50),
@ExtendedWarrantyDollar
varchar(50),
@ExtendedWarrantyProfit
varchar(50),
@FrontGross
varchar(50),
@BackGross
varchar(50),
@TradeIn_1_VIN
varchar(50),
@TradeIn_2_VIN
varchar(50),
@TradeIn_1_Make
varchar(50),
@TradeIn_2_Make
varchar(50),
@TradeIn_1_Model
varchar(50),
@TradeIn_2_Model
varchar(50),
@TradeIn_1_ExteriorColor
varchar(50),
@TradeIn_2_ExteriorColor
varchar(50),
@TradeIn_1_Year
varchar(50),
@TradeIn_2_Year
varchar(50),
@TradeIn_1_Mileage
varchar(50),
@TradeIn_2_Mileage
varchar(50),
@TradeIn_1_Gross
varchar(50),
@TradeIn_2_Gross
varchar(50),
@TradeIn_1_Payoff
varchar(50),
@TradeIn_2_Payoff
varchar(50),
@TradeIn_1_ACV
varchar(50),
@TradeIn_2_ACV
varchar(50),
@Fee_1_Name
varchar(50),
@Fee_1_Fee
varchar(50),
@Fee_1_Commission
varchar(50),
@Fee_2_Name
varchar(50),
@Fee_2_Fee
varchar(50),
@Fee_2_Commission
varchar(50),
@Fee_3_Name
varchar(50),
@Fee_3_Fee
varchar(50),
@Fee_3_Commission
varchar(50),
@Fee_4_Name
varchar(50),
@Fee_4_Fee
varchar(50),
@Fee_4_Commission
varchar(50),
@Fee_5_Name
varchar(50),
@Fee_5_Fee
varchar(50),
@Fee_5_Commission
varchar(50),
@Fee_6_Name
varchar(50),
@Fee_6_Fee
varchar(50),
@Fee_6_Commission
varchar(50),
@Fee_7_Name
varchar(50),
@Fee_7_Fee
varchar(50),
@Fee_7_Commission
varchar(50),
@Fee_8_Name
varchar(50),
@Fee_8_Fee
varchar(50),
@Fee_8_Commission
varchar(50),
@Fee_9_Name
varchar(50),
@Fee_9_Fee
varchar(50),
@Fee_9_Commission
varchar(50),
@Fee_10_Name
varchar(50),
@Fee_10_Fee
varchar(50),
@Fee_10_Commission
varchar(50),
@ContractDate
varchar(50),
@InsuranceName
varchar(50),
@InsuranceAgentName
varchar(50),
@InsuranceAddress
varchar(50),
@InsuranceCity
varchar(50),
@InsuranceState
varchar(50),
@InsuranceZip
varchar(50),
@InsurancePhone
varchar(50),
@InsurancePolicyNumber
varchar(50),
@InsuranceEffectiveDate
varchar(50),
@InsuranceExpirationDate
varchar(50),
@InsuranceCompensationDeduction
varchar(50),
@TradeIn_1_InteriorColor
varchar(50),
@TradeIn_2_InteriorColor
varchar(50),
@PhoneBlock
varchar(50),
@LicensePlateNumber
varchar(50),
@Cost varchar(50),
@InvoiceAmount
varchar(50),
@FinanceCharge
varchar(50),
@TotalPickupPayment
varchar(50),
@TotalAccessories
varchar(50),
@TotalDriveOffAmount
varchar(50),
@EmailBlock
varchar(50),
@ModelDescriptionOfCarSold
varchar(50),
@VehicleClassification
varchar(50),
@ModelNumberOfCarSold
varchar(50),
@GAPPremium
varchar(50),
@LastInstallmentDate
varchar(50),
@CashDeposit
varchar(50),
@AHPremium
varchar(50),
@LeaseRate
varchar(50),
@DealerSelect
varchar(50),
@LeasePayment
varchar(50),
@LeaseNetCapCost
varchar(50),
@LeaseTotalCapReduction
varchar(50),
@DealStatus
varchar(50),
@CustomerSuffix
varchar(50),
@CustomerSalutation
varchar(50),
@CustomerAddress2
varchar(50),
@CustomerMiddleName
varchar(50),
@GlobalOptOut
varchar(50),
@LeaseTerm
varchar(50),
@ExtendedWarrantyFlag
varchar(50),
@Salesman_3_Number
varchar(50),
@Salesman_3_Name
varchar(50),
@Salesman_4_Number
varchar(50),
@Salesman_4_Name
varchar(50),
@Salesman_5_Number
varchar(50),
@Salesman_5_Name
varchar(50),
@Salesman_6_Number
varchar(50),
@Salesman_6_Name
varchar(50),
@APRRate2
varchar(50),
@APRRate3
varchar(50),
@APRRate4
varchar(50),
@Term2
varchar(50),
@SecurityDeposit2
varchar(50),
@DownPayment2
varchar(50),
@TotalOfPayments2
varchar(50),
@BasePayment
varchar(50),
@JournalSaleAmount
varchar(50),
@IndividualBusinessFlag
varchar(50),
@InventoryDate
varchar(50),
@StatusDate
varchar(50),
@ListPrice
varchar(50),
@NetTradeAmount
varchar(50),
@TrimLevel
varchar(50),
@SubTrimLevel
varchar(50),
@BodyDescription
varchar(50),
@BodyDoorCount
varchar(50),
@TransmissionDesc
varchar(50),
@EngineDesc
varchar(50),
@TypeCode
varchar(50),
@SLCT2
varchar(50),
@DealDateOffset
varchar(50),
@AccountingDate
varchar(50),
@CoBuyerCustNum
varchar(50),
@CoBuyerCell
varchar(50),
@CoBuyerEmail
varchar(50),
@CoBuyerSalutation
varchar(50),
@CoBuyerPhoneBlock
varchar(50),
@CoBuyerMailBlock
varchar(50),
@CoBuyerEmailBlock
varchar(50),
@RealBookDate
varchar(50),
@CoBuyerMiddleName
varchar(50),
@CoBuyerCountry
varchar(50),
@CoBuyerAddress2
varchar(50),
@CoBuyerOptOut
varchar(50),
@CoBuyerOccupation
varchar(50),
@CoBuyerEmployer
varchar(50),
@Country
varchar(50),
@Occupation
varchar(50),
@Employer
varchar(50),
@Salesman2Commission
varchar(50),
@BankAddress
varchar(50),
@BankCity
varchar(50),
@BankState
varchar(50),
@BankZip
varchar(50),
@LeaseEstimatedMiles
varchar(50),
@AFTReserve
varchar(50),
@CreditLifePrem
varchar(50),
@CreditLifeRes
varchar(50),
@AHRes
varchar(50),
@Language
varchar(50),
@BuyRate
varchar(50),
@DMVAmount
varchar(50),
@Weight
varchar(50),
@StateDMVTotFee
varchar(50),
@ROSNumber
varchar(50),
@Incentives
varchar(50),
@CASS_STD_LINE1
varchar(50),
@CASS_STD_LINE2
varchar(50),
@CASS_STD_CITY
varchar(50),
@CASS_STD_STATE
varchar(50),
@CASS_STD_ZIP
varchar(50),
@CASS_STD_ZIP4
varchar(50),
@CASS_STD_DPBC
varchar(50),
@CASS_STD_CHKDGT
varchar(50),
@CASS_STD_CART
varchar(50),
@CASS_STD_LOT
varchar(50),
@CASS_STD_LOTORD
varchar(50),
@CASS_STD_URB
varchar(50),
@CASS_STD_FIPS
varchar(50),
@CASS_STD_EWS
varchar(50),
@CASS_STD_LACS
varchar(50),
@CASS_STD_ZIPMOV
varchar(50),
@CASS_STD_Z4LOM
varchar(50),
@CASS_STD_NDIAPT
varchar(50),
@CASS_STD_NDIRR
varchar(50),
@CASS_STD_LACSRT
varchar(50),
@CASS_STD_ERROR_CD
varchar(50),
@NCOA_AC_ID
varchar(50),
@NCOA_COA_ADDSRC
varchar(50),
@NCOA_COA_MATCH
varchar(50),
@NCOA_COA_MOVTYP
varchar(50),
@NCOA_COA_DATE
varchar(50),
@NCOA_COA_DELCD
varchar(50),
@NCOA_COA_RTYPE
varchar(50),
@NCOA_COA_RTNCD
varchar(50),
@NCOA_COA_LINE1
varchar(50),
@NCOA_COA_LINE2
varchar(50),
@NCOA_COA_CITY
varchar(50),
@NCOA_COA_STATE
varchar(50),
@NCOA_COA_ZIP
varchar(50),
@NCOA_COA_ZIP4
varchar(50),
@NCOA_COA_DPBC
varchar(50),
@NCOA_COA_CHKDGT
varchar(50),
@NCOA_COA_CART
varchar(50),
@NCOA_COA_LOT
varchar(50),
@NCOA_COA_LOTORD
varchar(50),
@NCOA_COA_URB
varchar(50),
@NCOA_COA_Z4LOM
varchar(50),
@NCOA_COA_ACTION
varchar(50),
@NCOA_COA_QNAME
varchar(50),
@NCOA_DPV_AA
varchar(50),
@NCOA_DPV_A1
varchar(50),
@NCOA_DPV_BB
varchar(50),
@NCOA_DPV_CC
varchar(50),
@NCOA_DPV_M1
varchar(50),
@NCOA_DPV_M3
varchar(50),
@NCOA_DPV_N1
varchar(50),
@NCOA_DPV_P1
varchar(50),
@NCOA_DPV_P3
varchar(50),
@NCOA_DPV_RR
varchar(50),
@NCOA_DPV_R1
varchar(50),
@NCOA_DPV_STATUS
varchar(50),
@NCOA_DPV_F1
varchar(50),
@NCOA_DPV_G1
varchar(50),
@NCOA_DPV_U1
varchar(50),
@myerror
varchar(500),
@SalesID
int,
@errornumber int,
@errorseverity varchar(500),
@errorstate int,
@errorprocedure varchar(500),
@errorline varchar(50),
@errormessage varchar(1000);
DECLARE Sales_Cursor CURSOR FOR
SELECT * from FLATFILE_SALES;
OPEN Sales_Cursor;
:r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT @VehicleVIN ;
--===============================================================================
-- ****************** insert into Sales Table ***********
BEGIN TRY
INSERT INTO Sales
IconicDealerID,
DealNumber,
CustomerNumber,
DMSType,
ContractDate
VALUES (@ClientDealerID,@DealNumber,@CustomerNumber,@DMSType,@ContractDate);
END TRY
BEGIN CATCH
SELECT
@errornumber = ERROR_NUMBER()
,@errorseverity = ERROR_SEVERITY()
,@errorstate = ERROR_STATE()
,@errorprocedure = ERROR_PROCEDURE()
,@errorline = ERROR_LINE()
,@errormessage = ERROR_MESSAGE();
:r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
@errornumber ,
@errorseverity ,
@errorstate,
@errorprocedure,
@errorline,
@errormessage);
END CATCH
PRINT @errornumber;
PRINT @errorseverity;
PRINT @errorprocedure;
PRINT @errorline;
PRINT @errormessage;
PRINT @errorstate;
set @myerror = @@ERROR;
-- This PRINT statement prints 'Error = 0' because
-- @@ERROR is reset in the IF statement above.
PRINT N'Error = ' + @myerror;
set @SalesID = scope_identity();
PRINT @SalesID;
--================================================================================
--Insert into SALES_TRADEIN Table
BEGIN TRY
INSERT INTO SALES_TRADEIN
SalesID,
TradeIn_VIN,
TradeIn_Make,
TradeIn_Model,
TradeIn_ExteriorColor,
TradeIn_Year,
TradeIn_Mileage,
TradeIn_Gross,
TradeIn_Payoff,
TradeIn_ACV,
TradeIn_InteriorColor
VALUES
@SalesID,
case when @TradeIn_1_VIN is not null then @TradeIn_2_VIN end,
case when @TradeIn_1_Make is not null then @TradeIn_2_Make end,
case when @TradeIn_1_Model is not null then @TradeIn_2_Model end,
case when @TradeIn_1_ExteriorColor is not null then @TradeIn_2_ExteriorColor end,
case when @TradeIn_1_Year is not null then @TradeIn_2_Year end,
case when @TradeIn_1_Mileage is not null then @TradeIn_2_Mileage end,
case when @TradeIn_1_Gross is not null then @TradeIn_2_Gross end,
case when @TradeIn_1_Payoff is not null then @TradeIn_2_Payoff end,
case when @TradeIn_1_ACV is not null then @TradeIn_2_ACV end,
case when @TradeIn_1_InteriorColor is not null then @TradeIn_2_InteriorColor end
END TRY
BEGIN CATCH
SELECT
@errornumber = ERROR_NUMBER()
,@errorseverity = ERROR_SEVERITY()
,@errorstate = ERROR_STATE()
,@errorprocedure = ERROR_PROCEDURE()
,@errorline = ERROR_LINE()
,@errormessage = ERROR_MESSAGE();
:r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
END CATCHThis is what I've understood from your question. You want to replace @TradeIn_2_VIN value if @TradeIn_1_VIN
is NULL, else the value of @TradeIn_1_VIN.
If this is the requirement then, your CASE statement is missing ELSE part. You can re-write this as below
case when @TradeIn_1_VIN is null then @TradeIn_2_VIN
ELSE @TradeIn_1_VIN end,
or simply you can replace the CASE statement with the below
COALESCE function,
COALESCE(@TradeIn_1_VIN, @TradeIn_2_VIN),
Krishnakumar S -
Mergeing multiple procedures into a single package ???
Hello Gurus,
I m moving the data from the from one schema i,e source(SRC) schema to the another schema i,e target(trg) table, only selected columns of few tables (i,e for 4 tables)
I m writing procedures to accomplish this and put this procedures to a scheduler on a daily basis to load
I m writing 4 procedures one for each of the table .....here is the procedure i have got
create or replace procedure mov_tbl1
is
cursor tbl1_cur as
select src.col1,
src.col2,
src.col3,
src.col4
from source.tbl1 src
where col1 = ' xyz'
tbl1_cur_rec tbl1_cur%rowtype;
begin
for tbl1_cur_rec in tbl1_cur
loop
insert into tgt.tabl1(col1,col2,col3,col4)
values ( tbl1_cur_rec.col1,
tbl1_cur_reccol2,
tbl1_cur_rec.col3,
tbl1_cur_rec.col4);
commit
exception
when others then
rollback;
end loop;
end;
---for table 2
create or replace procedure mov_tbl2
is
cursor tbl2_cur as
select src.col1,
src.col2,
src.col3,
src.col4
from source.tbl2 src
where col3 = ' abc'
tbl2_cur_rec tbl2_cur%rowtype;
begin
for tbl2_cur_rec in tbl2_cur
loop
insert into tgt.table2(col1,col2,col3,col4)
values ( tbl2_cur_rec.col1,
tbl2_cur_reccol2,
tbl2_cur_rec.col3,
tbl2_cur_rec.col4);
commit
exception
when others then
rollback;
end loop;
end;
similarly procedures for table 3 and table 4....
here is my question....
1.How can i build a single package for all these four procedures in one package ???
2. ANd i don't want to call each procedure every time ...so can i do it by passing parameters ??? how can i accomplish that ??
I m new to writing packages ....any help is greatly appriciated ....Thank you so much gurus!!!!First of all your code doesn't compile because the exception block is inside the loop while begin and end are outside.
You have to decide whether a single row error has to invalidate the full load or if the single wrong row has to be rejected but all the other rows have to be loaded.
I suppose you need the latter hence I'm changing the code as follows:
create or replace procedure mov_tbl1
is
cursor tbl1_cur as
select src.col1,
src.col2,
src.col3,
src.col4
from source.tbl1 src
where col1 = ' xyz'
-- the record variable declaration is implicit in FOR LOOP
begin
for tbl1_cur_rec in tbl1_cur
loop
begin
insert into tgt.tabl1(col1,col2,col3,col4)
values ( tbl1_cur_rec.col1,
tbl1_cur_reccol2,
tbl1_cur_rec.col3,
tbl1_cur_rec.col4);
-- REMOVED COMMIT, Commit outside or at the end.
exception
when others then
null; -- May be is better to (somehow) log the error ...
end;
end loop;
end;About the package, you create it this way:
create or replace package p is
procedure upd (tab1 in boolean, tab2 in boolean, tab3 in boolean, tab4 in boolean);
end;
create or replace package p is
procedure upd (tab1 in boolean, tab2 in boolean, tab3 in boolean, tab4 in boolean) is
begin
if tab1=true then
mov_tbl1;
end if;
if tab2=true then
mov_tbl2;
end if;
if tab2=true then
mov_tbl2;
end if;
if tab2=true then
mov_tbl2;
end if;
end;
procedure mov_tbl1 is
cursor tbl1_cur as
select src.col1,
src.col2,
src.col3,
src.col4
from source.tbl1 src
where col1 = ' xyz'
-- the record variable declaration is implicit in FOR LOOP
begin
for tbl1_cur_rec in tbl1_cur
loop
begin
insert into tgt.tabl1(col1,col2,col3,col4)
values ( tbl1_cur_rec.col1,
tbl1_cur_reccol2,
tbl1_cur_rec.col3,
tbl1_cur_rec.col4);
-- REMOVED COMMIT, Commit outside or at the end.
exception
when others then
null; -- May be is better to (somehow) log the error ...
end;
end loop;
end;
procedure mov_tbl2 is ...
procedure mov_tbl3 is ...
procedure mov_tbl4 is ...
end;
/You can call the upd procedure (that calls the others) this way:
begin
p.upd(true,false,true,false);
end;
/To update only table1 and table3.
Max
http://oracleitalia.wordpress.com -
How to create a procedure in oracle to write the data into file
Hi All,
I am just wondered on how to create a procedure which will do following tasks:
1. Concat the field names
2. Union all the particular fields
3. Convert the date field into IST
4. Prepare the statement
5. write the data into a file
Basically what I am trying to achieve is to convert one mysql proc to oracle. MySQL Proc is as follows:
DELIMITER $$
USE `jioworld`$$
DROP PROCEDURE IF EXISTS `usersReport`$$
CREATE DEFINER=`root`@`%` PROCEDURE `usersReport`(IN pathFile VARCHAR(255),IN startDate TIMESTAMP,IN endDate TIMESTAMP )
BEGIN
SET @a= CONCAT("(SELECT 'User ID','Account ID','Gender','Birthdate','Account Registered On') UNION ALL (SELECT IFNULL(a.riluid,''),IFNULL(a.rilaccountid,''),IFNULL(a.gender,''),IFNULL(a.birthdate,''),IFNULL(CONVERT_TZ(a.creationDate,'+0:00','+5:30'),'') INTO OUTFILE '",pathFile,"' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' FROM account_ a where a.creationDate>='",startDate,"' and a.creationdate <='",endDate,"')");
PREPARE stmt FROM @a;
EXECUTE stmt;
DEALLOCATE PREPARE stmt ;
END$$
DELIMITER ;
Regards,
Vishal G1. Concat the field names
Double Pipe (||) is the concatenation operator in Oracle. There is also a function CONCAT for this purpose
2. Union all the particular fields
Not sure what do you mean by UNION ALL particular fields? UNION ALL is a set operation applied on two different result sets that have the same projection.
3. Convert the date field into IST
SQL> select systimestamp "Default Time"
2 , systimestamp at time zone 'Asia/Calcutta' "IST Time"
3 from dual;
Default Time IST Time
05-05-15 03:14:52.346099 AM -04:00 05-05-15 12:44:52.346099 PM ASIA/CALCUTTA
4. Prepare the statement
What do you mean by prepare the statement?
5. write the data into a file
You can use the API UTL_FILE to write to a file. -
I wish to convert my Matlab files into .dll's so that I can use them in LabVIEW. I am using 'mcc' and 'mbuild' of Matlab to convert my .m files into .c and .dll.
When I try to run the .dll's in LabVIEW, I get an error message in a modal window stating some required .dll or procedure is not found.
How should I resolve this issue. Should I add any other Matlab .dll's in course of making my .dll?
Please help in solving this issue... Thankyou very much.KJV wrote in message news:<[email protected]>...
> When I run the matlab generated dll, it is stating 'matllb.dll not
> found'. Is it that I should set the path for matlab\bin to include
> all the dll's before I compile? When I make dll from C, it works fine
> in LabVIEW. The problem is from .m to .dll. The problem also arises
> when I convert my .m to .exe. The same error of 'matllb.dll not
> found' comes over. Should I change my matlab compiler options or
> something else? Please help me?
I have the same question,I don't know how to use the matlab DLL file in labview,
I hope someone can descripe the procedure in detail. -
Calling a stored procedure runs into an error
Hello,
We are testing the Database Adapter.
In our database we created the following
- Table tt
- Package ttpackage, with a procedure with 1 input and 1 output parameter which inserts a record in the tt table.
(see scripts at bottom of message)
We created a Database Adapter based upon this Package (Call a stored procedure or function) and register this Database Adapter with the Integration Server.
When we invoke this Database Adapter and enter the input, we can see in the database that 4 records are created. The Web Service returns after a minute with an error
How can we solve this problem?
Regards Leon Smiers
ERROR
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>env:Server</faultcode><faultstring>oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
at java.util.Vector.get(Vector.java:710)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.readResponseHeader(Unknown Source)
SCRIPT
drop table tt
drop sequence seq_tt;
drop package ttpackage;
create table tt
(field1 number(10) not null
,field2 varchar2(25) not null
,status varchar2(1) not null
,primary key (field1)
create sequence seq_tt;
create or replace package ttpackage is
procedure insert_tt(
pi_field2 in tt.field2%type,
po_status out klacht_data.status%type);
end;
show errors
create or replace package body ttpackage is
procedure insert_tt(
pi_field2 in tt.field2%type,
po_status out klacht_data.status%type) is
begin
po_status:='I';
insert into tt
(field1, field2,status)
values(seq_tt.nextval,pi_field2,po_status);
end insert_tt;
end;
show errors
/Hello Dave,
Thanks for the quick fix.
I've tested the fix. The 'Array index out of range: 0' disappeared.
I get, unfortunately, the following error. I already described the steps I take in the first message. Based upon the TTpackage I create a Database adapter, register it with the ESB and invoke the URL from the ESB.
Regards Leon
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>env:Server</faultcode><faultstring>oracle.tip.esb.server.common.exceptions.BusinessEventRetriableException: An unhandled exception has been thrown in the ESB system. The exception reported is: "oracle.xml.parser.v2.XMLDOMException: Ongeldige naamruimte http://xmlns.oracle.com/pcbpel/adapter/db/OCOP/TTPACKAGE/INSERT_TT/ voor prefix xmlns
at oracle.xml.parser.v2.XMLElement.setAttributeNS(XMLElement.java:1015)
at oracle.tip.esb.utils.DOMUtil.copyContentsTo(Unknown Source)
at oracle.tip.esb.server.service.impl.soap.EventOracleSoapProvider.raiseEvent(Unknown Source)
at oracle.tip.esb.server.service.impl.soap.EventOracleSoapProvider.processMessage(Unknown Source)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:869)
at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:349)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:460)
at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:114)
at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:96)
at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:177)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
</faultstring><faultactor></faultactor></env:Fault></env:Body></env:Envelope> -
T-sql 2008 r2 place results from calling a stored procedure with parameters into a temp table
I would like to know if the following sql can be used to obtain specific columns from calling a stored procedure with parameters:
/* Create TempTable */
CREATE TABLE #tempTable
(MyDate SMALLDATETIME,
IntValue INT)
GO
/* Run SP and Insert Value in TempTable */
INSERT INTO #tempTable
(MyDate,
IntValue)
EXEC TestSP @parm1, @parm2
If the above does not work or there is a better way to accomplish this goal, please let me know how to change the sql?declare @result varchar(100), @dSQL nvarchar(MAX)
set @dSQL = 'exec @res = TestSP '''+@parm1+''','' '''+@parm2+' '' '
print @dSQL
EXECUTE sp_executesql @dSQL, N'@res varchar(100) OUTPUT', @res = @result OUTPUT
select @result
A complicated way of saying
EXEC @ret = TestSP @parm1, @parm2
SELECT @ret
And not only compliacated, it introduces a window for SQL injection.
Erland Sommarskog, SQL Server MVP, [email protected]
Maybe you are looking for
-
Cannot fill forms created by LiveCycle Designer
Dear all, By using Adboe Reader for iPad, I can fill the forms created by Adobe Pro, but cannot view pdf and fill the forms created by LiveCycle Designer. Any idea? Thanks, Jackson
-
Workflow Substitutions in Inbox
Is it possible to set up workflow substitutions via the Office Inbox within ESS/MSS? If so where?!
-
Itunes locks up every time i try to play a movie.
Anyone else have this problem? What did you do about it?
-
What would cause the TOC and top Search bar in the Flash Help I've generated to be blank on some user's local PCs and not others. I've search the KB and internet and can't find anything. Is it something to do with Flash Settings? IE? Has anyone exper
-
Sharing sequence and related files with an editor
How do I share the edl and related files with an editor I'm working with? Basically, need to copy both the project and the related files to another computer.