Getting value with an anonymous block using ODP
Hi all!
I have a problem I hope someone can help me with. I believe it to be a minor one. I am trying to imbed an anonymous block into my .net app and use it dynamically to get a value from the database depending on the values in a tables. Since my procedure is quite large I am displaying a small example proc for simplicity purposes. Basically I want to execute an anonymous block from my app that will return a value (not a row or rows) from the database. The code is below:
Private Sub test()
Dim cn As New OracleConnection(profileString)
Try
Dim sb As New System.Text.StringBuilder
sb.Append("Declare ")
sb.Append("v_maxnum varchar2(6); ")
sb.Append("Begin ")
sb.Append("Select max(to_number(email_address_id)) into ")
sb.Append("v_maxnum from CVWH14_CDRV_TEST.EMAIL_ADDRESS_TBL; ")
sb.Append("dbms_output.put_line(v_maxnum); ")
sb.Append("Exception ")
sb.Append("When Others ")
sb.Append("Then ")
sb.Append("dbms_output.put_line('Program run errors have occurred.'); ")
sb.Append("End; ")
Dim cmd As New OracleCommand(sb.ToString, cn)
With cmd
cmd.CommandType = CommandType.Text
Dim parm As New OracleParameter
parm.ParameterName = "v_maxnum"
parm.OracleType = OracleType.VarChar
parm.Direction = ParameterDirection.Output
parm.Size = 6
cmd.Connection.Open()
Dim ret As Object = cmd.ExecuteScalar()
Dim res As String = cmd.Parameters.Item(0).Value.ToString -- **Error is occuring here**
cmd.Connection.Close()
cmd.Dispose()
End With
Catch ex As Exception
MessageBox.Show(ex.Message, "Error")
'End If
If cn.State = ConnectionState.Open Then
cn.Close()
End If
End Try
End Sub
The exception error reads "Invalid Index 0 for this OracleParameterCollection with Count=0."
If I can figure out how to get a parameter value from the database via the anonymous block, I can apply the logic to the real application. Any help or direction I could receive would be greatly appreciated. Thanks for reading this post!
Thank you for responding. The code that I posted was just one of many ways I have tried. I retried the proc making just 2 changes:
Private Sub test()
Dim cn As New OracleConnection(profileString)
Try
Dim sb As New System.Text.StringBuilder
sb.Append("Declare ")
sb.Append("v_maxnum varchar2(6); ")
sb.Append("Begin ")
sb.Append("Select max(to_number(email_address_id)) into ")
sb.Append("v_maxnum from CVWH14_CDRV_TEST.EMAIL_ADDRESS_TBL; ")
sb.Append("dbms_output.put_line(:v_maxnum); ") -- !Changed this to a bind variable!
sb.Append("Exception ")
sb.Append("When Others ")
sb.Append("Then ")
sb.Append("dbms_output.put_line('Program run errors have occurred.'); ")
sb.Append("End; ")
Dim cmd As New OracleCommand(sb.ToString, cn)
With cmd
cmd.CommandType = CommandType.Text
Dim parm As New OracleParameter
parm.ParameterName = ":v_maxnum" -- !Changed this to a bind variable!
parm.OracleType = OracleType.VarChar
parm.Direction = ParameterDirection.Output
parm.Size = 6
cmd.Connection.Open()
Dim ret As Object = cmd.ExecuteScalar() -- !The error is now occuring here!
Dim res As String = cmd.Parameters.Item(0).Value.ToString
cmd.Connection.Close()
cmd.Dispose()
End With
Catch ex As Exception
MessageBox.Show(ex.Message, "Error")
If cn.State = ConnectionState.Open Then
cn.Close()
End If
End Try
End Sub
I am now getting the error message "Not all variables bound". Any more help or direction that you could throw my way would be greatly appreciated.
Similar Messages
-
How to get value with two parameter fro sharepoint list in SSRS reporting
Hi
I am using Sharepoint list and fetching data in SSRS.
Using three parameter as Department,Section and subsection.
with filter everything working fine,but if i use category All and Sub category all for particular department,unable to get record.
please let me know how to implement.
Help will be appreciated.
Hasan Jamal Siddiqui(MCTS,MCPD,ITIL@V3),Sharepoint and EPM Consultant,TCS
|
| TwitterHi Hasan,
Per my understanding you want to add mutilple value parameters to filter the data in the sharpoint list datasource report, right?
I have a test based on the step by step details information in below link and all works fine which will make the multiple value parameter works fine:
https://audministrator.wordpress.com/2014/02/17/sharepoint-list-add-distinct-parameter-value/
Add the custom code from above link
Parem1 is the parameter which get values from a query and with all the values(duplicate value),please setting as below:
Param2 is the parameter which will display in the report have done the deduplication, check the "Allow Multiple values" and then Specify the available value and default value using below expression:
=Split(Code.RemoveDups(JOIN(Parameters!Param1.Value, ",")), ",")
Add the filter and preview.
Similar thread below for your reference:
SSRS reporting with sharepoint list using Distinct and Multivalue
parameters
If i have some misunderstanding, please try yto provide more details information about your requirements.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support -
I have created a tabular form using the HTMLDB_ITEM functions and now in the javascript, I need to determine the value in another column created using the SELECT_LIST_FROM_LOV function and then set the value under certain circumstances. Unfortunately, I do not know the correct syntax. My Javascript function is being called properly, I am just unable to get or set the field.
I am calling my javascript function from another column on the tabular form passing in the current row number and f09 is my column.
Below is my code. Unfortunately, none of the below are working.
function f_setCurrency(a_row)
var l_Currency = html_GetElement('f09_'+a_row);
html_SetSelectValue(l_Currency, 2);
alert(html_GetSelectValue(l_Currency ));
alert($x(l_Currency).value);
alert($x('f09_'+a_row).value);
alert($v('f09_'+a_row));
alert($x('f09_'+a_row).innerHTML);
}Brian,
This example:
http://htmldb.oracle.com/pls/otn/f?p=31517:176
and this example:
http://htmldb.oracle.com/pls/otn/f?p=31517:160
may help you.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
Set and get values with vector
I have a class that that querys a db and sets a value of the result to a vector array. Is it possible to set and retrieve that vector array using the set and get methods?
ex:
my class:
sql = "Select ...";
Vector fName = new Vector();
rs = sqlStatement.executeQuery(sql);
if (rs != null) {
while (rs.next()) {
fName.add(rs.getString("fName") + "");
rs.close();
setFName(fName);
how would I set up the set and get methods???
thanksI am unsure of what you are asking:
A Vector has set and get methods for it, you use indexes of the array to say what element you want to work with.
If you are asking how do you know what elements of the Vector contain which data columns, you have to remember how you put them in.
If you are asking if you can use set to load the Vector: then NO, you have to have elemenets already there to change, use the add method.
If you are asking how to access the elements of the Vector you use an Enumeration:
for(java.util.Enumeration e = v.elements(); e.hasMoreElements();){
s = (java.lang.String) e.nextElement();
vl.add(s.substring(0, 12));
If you are asking something else: please elaborate what you want--my brain may not be very functional this morning. -
How to get value of jca.file.IsEof using fromproperties in file adapter
Hi Guys,
I have a scenario where i use a file adapter for syncread (for doing chunkRead).
While invoking this adapter i send jca.file.FileName and jca.file.Directory as input properties dynamically.
In response i expect jca.file.IsEOF and jca.file.IsMessageRejected, for this i have done the following steps.
1. Create a file adapter for SyncRead
2. Create an invoke activity and input/output variables along with it.
3. set input properties as below ..
4. get the values of jca.file.IsEOF and jca.file.IsMessageRejected using bplex:fromproerties
<invoke name="Invoke1"
inputVariable="Invoke1_SynchChunked_InputVariable"
outputVariable="Invoke1_SynchChunked_OutputVariable"
partnerLink="SamplSyncChunkRead"
portType="ns19:SynchChunked_ptt"
operation="SynchChunked"
bpelx:invokeAsDetail="no">
<bpelx:inputProperty name="jca.file.FileName"
variable="inputVariable"
part="payload"
query="/ns11:fileHeader/ns11:fileName"/>
<bpelx:inputProperty name="jca.file.Directory"
variable="inputVariable"
part="payload"
query="/ns11:fileHeader/ns11:directory"/>
<bpelx:fromProperties>
*<bpelx:fromProperty name="jca.file.IsEOF" variable="isEndofFile"/>*
*<bpelx:fromProperty name="jca.file.IsMessageRejected" variable="istheMessageRejected"/>*
</bpelx:fromProperties>
</invoke>
5. Flow of the project is fine but im not getting the fromProperty values assigned to variables.
Note : rather using from proerties like give below
<bpelx:fromProperties>
*<bpelx:fromProperty name="jca.file.IsEOF" variable="isEndofFile"/>*
*<bpelx:fromProperty name="jca.file.IsMessageRejected" variable="istheMessageRejected"/>*
</bpelx:fromProperties>
if i use output proerties as given below it is not working..
<bpelx:outputProperty name="jca.file.isEOF" variable="isEndofFile"/>
<bpelx:outputProperty name="jca.file.IsMessageRejected" variable="istheMessageRejected"/>
Any suggestions on this ???
Thanks in advance guys...Thanks veejai...
i have used the following properties in my code..
<bpelx:fromProperties>
<bpelx:fromProperty name="jca.file.IsEOF" variable="isEndofFile"/>
<bpelx:fromProperty name="jca.file.IsMessageRejected" variable="istheMessageRejected"/>
</bpelx:fromProperties>
if i use output proerties as given below it is not working..
<bpelx:outputProperty name="jca.file.isEOF" variable="isEndofFile"/>
<bpelx:outputProperty name="jca.file.IsMessageRejected" variable="istheMessageRejected"/>
any suggestion on <bplex:fromproperties> ?? -
I connected airport express and made it a secure network works fine with my IMAC desk top and copy machine but cant seem to get on line with my DELL laptop running windows vista does anyone know what i can do ? I put in my passpharse code but it says windows cant connect
So, when you are in the window that provides the Equivalent Network Password, you are saying that your WPA Password and the WPA Pre-Shared Key values are the same? That is, you are already using a 64-hex character password? (see image below)
-
hi there
if a method needs to return a value, but there maybe an exception caught in a try block, where should i place the return statement, outside the try bccok or inside
code...
public String readFrom()
String temp;
try
temp = br.readLine();
catch (IOException ex)
System.out.println(ex);
return temp;
}It should be coded as you have it. There should (ideally)
be only one exit point from a method. If an exception is
thrown, the code in the catch block will be executed and
processing will continue. You can use the catch block
to set the value of the variable that is being returned to
indicate that an error has occurred. In your example,
you could set the String temp to null.
Mark -
What is wrong with the anonymous block ??
when i am trying to execute the block it throws me an error
can anyone help ??
SQL> declare
2 asd number ;
3 begin
4 for i in( select tr,count(*) from test group by tr) loop
5 if i.count(*)<6 then
6 dbms_output.put_line("hello");
7 else
8 dbms_output.put_line("nice");
9 end if;
10 end loop;
11 end ;
12 /if i.count(*)<6 then
ERROR at line 5:
ORA-06550: line 5, column 12:
PLS-00103: Encountered the symbol "*" when expecting one of the following:
( ) - + case mod new not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable>
Message was edited by:
SHUBHSQL> declare
2 asd number ;
3 begin
4 for i in( select tr,count(*) from test group by tr) loop ---- select tr,count(*) cnt
5 if i.count(*)<6 then ----- if a.cnt < 6 then
6 dbms_output.put_line("hello"); -- dbms_output.put_line('hello')
7 else
8 dbms_output.put_line("nice"); ---double quotes
9 end if;
10 end loop;
11 end ;
Message was edited by:
jeneesh
Message was edited by:
jeneesh -
Getting started with OIM API'S using ECLIPSE
Dear All,
i got this error messages :
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at com.thortech.util.logging.Logger.createAndRegisterLogger(Unknown Source)
at com.thortech.util.logging.Logger.getLogger(Unknown Source)
at com.thortech.xl.util.config.ConfigurationFormatter.<clinit>(Unknown Source)
somebody help me.
Thanks.In general Add all the jar files present in the xlclient lib folder into your classpath before using any of the Thor API's as these jars are needed.
In your case i guess the classpath is missing the log4j jar file required.
You are using com.thortech.util.logging.Logger which references to xlLogger.jar.
When you decompile this xlLogger.jar present in the lib folder you will be able to see the following import statements.
import com.thortech.util.logging.helpers.ConfigFileWatchDog;
import com.thortech.xl.util.logging.FilePrintStream;
import com.thortech.xl.util.logging.PropertyConfigurator;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Hashtable;
import org.apache.log4j.Category;
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Level;
import org.apache.log4j.PatternLayout;
So during runtime it is searching for the log4j jar which is not present in the classpath. usually it is present in the xlclient ext folder. Please ensure that you add this jar into your classpath. The problem will be solved. Let me know if you still face any issue.
Edited by: Durgaprasad on Dec 4, 2011 4:03 AM -
Getting value with checkbox inside IR
close
Edited by: mang jose on Feb 4, 2011 7:49 PMHi,
You welcome.
I do not know details what you like do checked values.
Consider also insert/update all values in one go.
It is faster than looping , example like
DECLARE
BEGIN
INSERT INTO my_tbl (empno)
SELECT c001
FROM apex_collections
WHERE collection_name = 'EMP_CHK_COLLECTION'
and c002 = 'true'
END;Or
DECLARE
BEGIN
UPDATE my_tbl SET my_col_2 = 'SOMETHING'
WHERE EXISTS(
SELECT 1
FROM apex_collections
WHERE collection_name = 'EMP_CHK_COLLECTION'
AND c002 = 'true'
and c001 = my_tbl.empno_col
END;Regards,
Jari -
The output is always "anonymous block completed"
Hi ,
I have written a simple Stored Procedure as shown :
create or replace procedure display
ename out emp.ename%type
is
begin
select ename into ename from emp where empno='7369';
end;
I tried to execute the above using this block
declare
ename emp.ename%type;
begin
display(ename);
dbms_output.put_line(ename);
end;
I am always getting the Output as "anonymous block completed" and nothing else .
Please help . Thanks .Hi:
First type this to enable the output.
SET SERVEROUTPUT ON;Saad, -
What is "anonymous block completed" ?
I run the following package in sql developer but always come out " anonymous block completed"
I would like to what is "anonymous block completed" ? Is it an error? What we need to bear in mind?
BEGIN
PKG_VERIFICATION2.SP_CHK();
END;Each call to Oracle, returns a return or exit code.
For a successful call, the code ORA-0000 is returned.
Oracle assigned the text message "+ORA-0000: normal, successful completion+" to that code.
Many clients will however use a tad more meaningful messages. If the call was to create a table, the client can display "+Table created+" as the response message. Or "+Table altered+" for an alter table statement.
Likewise, for an anonymous PL/SQL block, the client can respond with a "+anonymous block completed+". -
Jsp:usebean How to get value of an object from a bean
I am new to JSP and am struggling from past few days to solve a problem. Consider the below scenario
Class Book{
private String author;
public void setAuthor(String author)
public String getAuthor(){
return author; }
Class Rack{
private Book []books;
public []Book getbooks()
return books;
public void setbooks([]Book val){....}
Suppose Books gets populated only using Rack and I have Rack populate in my session, using jsp:usebean or any other tag how can I get value of author? Does using tag handle null value check of books, if books are not set by any chance?
Regards,
DhyanI got a way out to access the attribute, i feel it is
<jsp:usebean id="myRack" class="settings.Rack"/>
<c:foreach var="book" item="myRack.books">
</c:foreach>
I am not able to check if this is correct or not because myRack.books is not having any value set by me in the request scope. How do i get instance of Rack class set by another page in the current request? I can get the value if i use scriptlet but i dont want to use scriptlet.
I am continiously trying, if I get an answer, I shall post, else pls somebody guide. -
ACL denied using Pkb but works using anonymous block with same user
I have a recent 11g installation with a developer that is getting a access denied message when using a package but is able to run the same code manually in sqlplus and it works.
eg. I have granted access to connect and resolve to the user BLAH.
from sqlplus, BLAH can do
select trim(substr(utl_inaddr.get_host_name,1,30)) from dual;
TRIM(SUBSTR(UTL_INADDR.GET_HOST_NAME,1,30))
serverhostname
and get the hostname successfully, but this same line in a pkb fails when called like so
exec func_name.something()
BEGIN func_name.something(); END;
ERROR at line 1:
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_INADDR", line 4
ORA-06512: at "SYS.UTL_INADDR", line 35
ORA-06512: at line 1
ORA-06512: at "BLAH.FUNC_NAME", line 83
ORA-06512: at line 1
but if you were to do this same bit of code in sqlplus as follows:
set serveroutput on
declare
mhost varchar(30);
begin
select trim(substr(utl_inaddr.get_host_name,1,30)) into mhost
from dual;
dbms_output.put_line(mhost);
end;
it works.
I do not understand this at all. This is the same user account that owns the pkb and is running it in sqlplus. The user has been granted the connect and resolve priv through being granted a role that has this permission.
Can anyone help me out here?Thanks, the oracle logic behind this doesn't make sense to me - if the user can do this action, then surely the user should be able to run the package...
Anyway, I will try to grant directly to the user that needs the privs, but then how do I grant this privilege to multiple users, it's some awkward bit of pl/sql just to grant it to one user.
Here is what I did:
dbms_network_acl_admin.create_acl(acl => 'filename.xml',
description => 'Network permissions for BLAH_USER to connect/resolve any host',
principal => 'BLAH_USER', is_grant => TRUE, privilege => 'connect');
dbms_network_acl_admin.add_privilege(acl => 'filename.xml', principal => 'BLAH_USER', is_grant => TRUE, privilege => 'resolve');
dbms_network_acl_admin.assign_acl(acl => 'filename.xml', host => '*');
grant execute on dbms_network_acl_admin to BLAH_USER;
but this only works for 1 user and I cannot recreate this as the acl now already exists. Would I have to change filename.xml every time and do all these steps for every user?
This is why I granted to a role and then granted that role to the BLAH_USER originally.
Any ideas on how to make this scalable to many users or to add users to this ACL? -
PL anonymous block does everything, but then gets stuck
We have a PL/SQL block that loops through a cursor, and inserts data into another table. We're having a strange issue with it... Every single line of code within it appears to function correctly... It does everything we want it to. The last line on it calls a simple function that writes a record to a table we made, to indicate it has completed. It does that, and we can see the record is inserted successfully.
The problem: even though we can see it did everything, it gets "stuck". If we run it as a anonymous block, the sql plus session will just stay stuck. Same thing if we turn it into a procedure and invoke it. It just stays stuck. Viewing it from OEM... We can see the session as "active", but it doesn't show that it's currently executing anything.
How can we go about figuring out what the problem is?
We've tried it on four databases... All windows platforms.. Three were oracle 10g, one was Oracle 11g. One more interesting note: one of the 10g ones... the problem does not occur... the script finishes fine. But, we don't know what is different about this database from the others.
We also notice the problem doesn't happen if we limit the amount of records... the initial cursor we process, if we limit it using "rownum < 100" or something like that, it will also always finish fine.
This is the script:
set echo on
set serveroutput on
declare
n_notes_count number;
n_records_read number;
dt_today date;
MYDATE DATE;
dt_comment_date date;
dt_updated_date date;
t_conv_exceptions "ODB"."CONVERSION_EXCEPTIONS" %ROWTYPE;
t_conv_exceptions_default "ODB"."CONVERSION_EXCEPTIONS" %ROWTYPE;
t_note_pad "ODB"."NOTE_PAD"%ROWTYPE;
t_note_pad_clear "ODB"."NOTE_PAD"%ROWTYPE;
t_pfcomm "PMI"."PFCOMM"%ROWTYPE;
c_created_by "ODB"."NOTE_PAD"."CREATED_BY" % type ;
-- Exceptions to be raised
ex_notes_number_blank EXCEPTION;
--ex_category_not_exists EXCEPTION;
--....more to come.....
CURSOR cur_notes IS
SELECT PF."MMNUM",
PF."MMLIN",
PF."MMDES",
PF."MMUSR",
PF."MMMM",
PF."MMDD",
PF."MMYY",
PF."MMCC",
--"pfcomm"."mmchr",
--"pfcomm"."mncmn",
--"pfcomm"."mmtype",
PF."MMUSRU",
PF."MMMMU",
PF."MMDDU",
PF."MMYYU",
PF."MMCCU"
FROM PMI."PFCOMM" PF
WHERE TRIM(PF."MMDES") IS NOT NULL
ORDER BY PF."MMNUM", PF."MMLIN";
BEGIN
-- Initialize variables
dt_today := "ODB"."PKG_APPLICATION_FUNCTION"."CURRENTDATETIME";
c_created_by :='PFCOMM';
-- Setup defaults for exceptions table
t_conv_exceptions_default."SCRIPT" := 'atlas_notes';
t_conv_exceptions_default."EXECUTION_DATE" := dt_Today;
t_conv_exceptions_default."CREATED_BY" := c_created_by;
-- Set up header record for exception
t_conv_exceptions := t_conv_exceptions_default;
t_conv_exceptions.column_01 := 'NOTES';
t_conv_exceptions.header := 'Y';
ODB.PKG_CONVERSIONS_EXCEPTIONS.writeException(t_conv_exceptions, false);
-- Count records in table
SELECT COUNT(*)
INTO n_records_read
FROM PMI."PFCOMM";
-- Delete previously inserted records
DELETE FROM "ODB"."NOTE_PAD" NP
WHERE NP."CREATED_BY" = c_created_by or NP."MODIFIED_BY" = c_created_by;
DELETE FROM "ODB"."NOTE_PAD" NP
WHERE NP."CREATED_BY" = 'PFCOMM2' or NP."MODIFIED_BY" = 'PFCOMM2';
DELETE FROM "ODB"."CONVERSION_EXCEPTIONS" CV
WHERE CV."CREATED_BY" IN (c_created_by,'PFCOMM2');
COMMIT;
/* Do Fetch here */
OPEN cur_notes;
LOOP
FETCH cur_notes
INTO t_pfcomm."MMNUM",
t_pfcomm."MMLIN",
t_pfcomm."MMDES",
t_pfcomm."MMUSR",
t_pfcomm."MMMM",
t_pfcomm."MMDD",
t_pfcomm."MMYY",
t_pfcomm."MMCC",
--"t_pfcommcomm"."mmchr",
--"t_pfcommcomm"."mncmn",
--"t_pfcommcomm"."mmtype",
t_pfcomm."MMUSRU",
t_pfcomm."MMMMU",
t_pfcomm."MMDDU",
t_pfcomm."MMYYU",
t_pfcomm."MMCCU";
EXIT
WHEN cur_notes % NOTFOUND;
-- Clear Variables
t_note_pad := t_note_pad_clear;
dt_comment_date := null;
dt_updated_date := null;
-- Begin variable assignments
t_conv_exceptions."COLUMN_01" := t_note_pad."NOTES";
t_note_pad."NOTES" := t_pfcomm."MMNUM";
t_note_pad."NOTES_TEXT" := t_pfcomm."MMDES";
-- Validate required fields
If t_note_pad."NOTES" is null Then
raise ex_notes_number_blank;
End if;
-- Sequence lines correctly
SELECT NVL( MAX("ODB"."NOTE_PAD"."NOTES_LINE"), 0)
INTO t_note_pad."NOTES_LINE"
FROM "ODB"."NOTE_PAD"
WHERE "ODB"."NOTE_PAD"."NOTES" = t_note_pad."NOTES"
-- Next note line number to insert
If t_note_pad."NOTES_LINE" is null Then
t_note_pad."NOTES_LINE" := 1;
Else
t_note_pad."NOTES_LINE" := t_note_pad."NOTES_LINE" + 1;
End if;
-- MMDDCCYY - Comment Date
If t_pfcomm."MMMM" > 0 Or t_pfcomm."MMDD" > 0 Or t_pfcomm."MMCC" > 0 Or t_pfcomm."MMYY" > 0 Then
SELECT TO_DATE(LPAD(t_pfcomm."MMMM",2,'0') || LPAD(t_pfcomm."MMDD",2,'0') || LPAD(t_pfcomm."MMCC",2,'0')|| LPAD( t_pfcomm."MMYY",2,'0'),'MMDDYYYY') INTO dt_comment_date FROM DUAL;
End if;
-- MMDDCCYY - Updated Date
If t_pfcomm."MMMMU" > 0 Or t_pfcomm."MMDDU" > 0 Or t_pfcomm."MMCCU" > 0 Or t_pfcomm."MMYYU" > 0 Then
SELECT TO_DATE(LPAD(t_pfcomm."MMMMU",2,'0') || LPAD(t_pfcomm."MMDDU",2,'0') || LPAD(t_pfcomm."MMCCU",2,'0')|| LPAD( t_pfcomm."MMYYU",2,'0'),'MMDDYYYY') INTO dt_updated_date FROM DUAL;
End if;
-- Updated user information
IF dt_updated_date is not null Then
t_note_pad."CREATED_BY" := TRIM(t_pfcomm."MMUSRU");
t_note_pad."CREATED_DATE" := dt_updated_date;
Elsif dt_comment_date is not null Then
t_note_pad."CREATED_BY" := TRIM(t_pfcomm."MMUSR");
t_note_pad."CREATED_DATE" := dt_comment_date;
Else
t_note_pad."CREATED_BY" := c_created_by;
t_note_pad."CREATED_DATE" := dt_today;
END IF;
/* Validate mandatory fields of TRAX table */
IF t_note_pad.NOTES = 0 THEN
t_note_pad.NOTES :=null;
End If;
IF t_note_pad.NOTES_LINE is null THEN
t_note_pad.NOTES_LINE := 1;
End If;
IF TRIM(t_note_pad.PRINT_NOTES) is null Then
t_note_pad.PRINT_NOTES := 'YES';
END IF;
IF TRIM(t_note_pad.NOTES_CATEGORY) is null THEN
t_note_pad.NOTES_CATEGORY := 'NORMAL';
END IF;
If TRIM(t_note_pad."CREATED_BY") is null Then
t_note_pad."CREATED_BY" := c_created_by;
End if;
If TRIM(t_note_pad."MODIFIED_BY") is null Then
t_note_pad."MODIFIED_BY" := c_created_by;
End if;
If TRIM(t_note_pad."MODIFIED_DATE") is null Then
t_note_pad."MODIFIED_DATE" := dt_today;
End if;
If TRIM(t_note_pad."CREATED_DATE") is null Then
t_note_pad."CREATED_DATE" := dt_today;
End if;
-- end structure validation
/* Do Insert here here */
insert into "ODB"."NOTE_PAD"
values t_note_pad;
commit;
END LOOP;
dbms_output.put_line('After loop.');
CLOSE cur_notes;
-- Update NOTES Switch
SELECT MAX(NT."NOTES") + 100
INTO n_notes_count
FROM "ODB"."NOTE_PAD" NT
UPDATE "ODB"."SYSTEM_TRAN_CONFIG"
SET "CONFIG_NUMBER" = n_notes_count,
"MODIFIED_BY" = 'TRAXCNV',
"MODIFIED_DATE" = dt_today
WHERE ( ODB."SYSTEM_TRAN_CONFIG"."SYSTEM_TRANSACTION" = 'CONFIGURATION' ) AND
( ODB."SYSTEM_TRAN_CONFIG"."SYSTEM_CODE" ='NOTES' )
COMMIT;
dbms_output.put_line('before audit.');
/* Do Save Audit record */
"ODB"."PKG_CONVERSIONS_EXCEPTIONS".writeAudit(t_conv_exceptions."SCRIPT",c_created_by,n_records_read,dt_today);
dbms_output.put_line('After audit.');
SELECT SYSDATE INTO MYDATE FROM DUAL;
-- Begin exception handling.
exception
when ex_notes_number_blank then
t_conv_exceptions.exception_description := 'Note number is blank.';
ODB.PKG_CONVERSIONS_EXCEPTIONS.writeException(t_conv_exceptions, false);
when others then
t_conv_exceptions.exception_description := substr(SQLERRM,1,1000);
ODB.PKG_CONVERSIONS_EXCEPTIONS.writeException(t_conv_exceptions, false);
RAISE;
-- End exception handling.
dbms_output.put_line('before end.');
END ;
/Avoid row-at-a-time processing if at all possible (cursor for loops, periodic commits, etc).
Try adding some calls to dbms_application_info.set_module (or set_action) in order to find out where your code is.
Maybe you are looking for
-
How much RAM can my computer support?
This computer has four memory slots but I don't want to buy memory that I don't need. Also I am currently running SDRAM-PC133-333, but most sites say that this model computer should run PC120, or 100, or something like that..........will I be ok runn
-
BlackBerry 10.2 OS Begins Roll Out, for the Q10
Read more here: BlackBerry 10.2 OS Begins Roll Out 1. If any post helps you please click the below the post(s) that helped you. 2. Please resolve your thread by marking the post "Solution?" which solved it for you! 3. Install free BlackBerry Protect
-
N97/FW21: is a camera flash fix included?
I'm about to return my N97 to Nokia, as they haven't been able to fix a flash flooding problem in the camera. Now with the new 2.1 FW I think the software is trying to compensate for the flood light, but the physiological problem is still there, resu
-
Connected to home wireless but not loading from web
I've seen all the answers here, especially some excellent and thorough information from user "Linc" but nothing is working for me. We have Comcast internet and the wireless network 'all of sudden' last week was very slow on my Mac mini. My wife has
-
How do i stop the Accounts iview in CRM Business package from bring back or opening to the previous accessed account? Basically if you open a account and exit with the GoTo in details option it reopens the account you last accessed with it details. I