How to catch the date error
Hi Experts,
i have two date picker in this if i type Wrong format automatically system show error "type the correct format", That means i will show the two error message.
But my requirement is i want to catch that error and i will give my own error message,please tell me its urgent
Regards,
Nutan
Edited by: nutan champia on Apr 23, 2008 9:20 AM
create a Error message in Message Pool
e.g: name - INV_DATE,
Message: Invalid date {} // {} will take arguments
use this code where you want to display/check exception and rename attributes and context variables in the code
IWDNodeElement elemnt = wdContext.currentContextElement();
// your date element
IWDAttributeInfo info = wdContext.getNodeInfo().getAttribute("date1");
// date attibute
wdComponentAPI.getMessageManager().raiseInvalidContextAttributeMessage(
elemnt,info, IMessageCreatePDF.INV__DATE, new String[] {}, true);
// IMessage<YourComponentName>.<Messages>
// this will araise exception
nikhiL
Similar Messages
-
How to handle The Date error???
Actually I am using three dropdown list as day,month and year
day contains 31 items and same values i.e., 1,2,3...31
and month contains jan,feb,....dec
year 1981,1982,.....2007
and I am concateded these three to form date as
d:=:day||'-'||:month||'-'||:year;
Now my problem is
when i am selecting values 31 jun 1980,30 feb 1980 i.e., non existing dates then it is throwing
"Unhandled trigger ..... "
please tell me how to handle it?There are a number of different exceptions you can get with dates.
SELECT To_Date('10132007','DDMMYYYY') FROM dual;
ORA-01843: not a valid month
SELECT To_Date('99122007','DDMMYYYY') FROM dual;
ORA-01847: day of month must be between 1 and last day of month
SELECT To_Date('10-FEB-2007','DDMMYYYY') FROM dual;
ORA-01858: a non-numeric character was found where a numeric was expectedFor this I would just trap the ORA-01847 and 'when others' exceptions. -
How to catch the error occurred in Integration Process, and then save it?
1. how to catch the error occurred in Integration Process, and then save the detailed error message to the file?
2. there are fault message type for inbound message interface, how to use the fault message type in IR?
Thanks,
Michael
Message was edited by: Spring Tang
inital
Message was edited by: Spring Tang
detailed message output
Message was edited by: Spring Tang
fault message typeHi Spring,
If u give an exception step along with your Transformation Step, whenever some error occurs in your message mapping, this exception block wil be triggered.
You can configure your exception block to do all exception processing that you want. This exception handling is like any other java Exceptio n Handler. You can do anything that you want in your exception handler block on the basis of your requirements.
<i>If an exception is triggered at runtime, the system first searches for the relevant exception handler in surrounding blocks. If it does not find the correct exception handler, it continues the search in the next block in the block hierarchy.
When the system finds the correct system handler, it stops all active steps in the block in which the exception handler is defined and then continues processing in the exception handler branch. Once the exception handler has finished processing, the process is continued after the block.
If the system fails to find an exception handler, it terminates the integration process with an error.</i>
Regards,
Bhavesh -
[MESSAGE.GENERAL] How can take the actual error text for ABAP proxy error?
Hi...
I'm a ABAPer.
I got to create outbound abap proxy for synchronous server proxy and described below.
My problem is program can not catch the actual error message when occurred error during send data to XI.
The return message is just 'MESSAGE.GENERAL'.
But according to the XI part, 'Key error' is actual reason.
So... how can i take the actual error text like 'Key error'?
<b>* Only MESSAGE.GENERAL is return message for all kind of errors.</b>
Thanks.
Below----
TRY.
CREATE OBJECT abap_proxy.
CALL METHOD abap_proxy->execute_synchronous
EXPORTING
output = gs_out
IMPORTING
input = gs_in.
Exception Handling
<b> CATCH cx_ai_system_fault INTO go_sys_exception.
g_sys_result = go_sys_exception->get_text( ).</b>
CATCH cx_ai_application_fault INTO go_app_exception.
g_app_result = go_app_exception->get_text( ).
ENDTRY.
COMMIT WORK.
Return status 'D' is succeeded.
if gs_in-sales_group_rer_sap-xstat <> 'D'.
WRITE:/ 'System Error Message :', g_sys_result.
WRITE:/ 'Application Error Message :', g_app_result.
endif.
*--Result--
System Error Message : MESSAGE.GENERAL
Application Error Message :
Message was edited by: Miju cho
Message was edited by: Miju choThanks guys, this was useful.
My scenario is for Asynchronous communication.
I guess Fault messages are used in case of Synchronous communication for handling application errors. So if there was something wrong at the JDBC end then I could use the fault messages.
Have i got this right?
I also came across this piece on Acknowledgements. But is says that they can be used with the following Receivers:
The following receivers support acknowledgments:
ABAP and Java proxies (XI 3.0 SP1 for the latter)
Integration processes
IDocs (note that IDocs only return acknowledgments when they have been configured using the ALE audit)
Receiver adapters support system acknowledgments but not application acknowledgments
My Receiver is JDBC. So I guess I cannot use acknowledgements either.
Hence, I need to know what I can do to replicate the system errors eg. failed server etc...so that I can get catch these errors during sending.
I'll tell you abt what happened earlier.
My XI server was down. I executed the code for the sender ABAP Proxy and it did not catch the error. In SXMB_MONI in the R/3 system, I could see the messages queued up. When the XI server started, the messages were transferred to XI.
I need to handle such errors...ie. If the server is down or message did not reach XI then my ABAP program that sends data via ABAP proxy needs to know that something went wrong.
Thanks and Regards,
Ashwin -
How to catch the value in sum(control break statement).
hi,
can any one tell me how to catch the value in sum in control break satament.
ex.
at end of brtwr.
sum.
endat.
I need to print the value in sum only.
I tried to declare a varaible of type i and assigned sum to this variable.
it is giving syntax error that sum is not identified.
How should i do this.
regards.Hi Siva,
In control break statement when we use SUM. it added all the amount fields and stores its in the work area of that field.
look below code.
DATA : BEGIN OF itab OCCURS 0,
name(10),
num TYPE i,
END OF itab.
DATA : num TYPE i .
itab-name = 'salman'.
itab-num = 100.
APPEND itab.
itab-name = 'salman'.
itab-num = 200.
APPEND itab.
itab-name = 'akshay'.
itab-num = 500.
APPEND itab.
LOOP AT itab.
AT END OF name.
SUM.
WRITE : / itab-num.
ENDAT.
ENDLOOP.
here the SUM value is stored in Workarea,
the output will be 300 & 500.
regards
Kumar M -
hi, can anyone tell me how to handle the ora errors, let say when a usere doesnt have the priveleges to add data in database this exception is generated:
ORA-06550: line 1, column 19: PL/SQL: ORA-01031: insufficient privileges ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored i want to display my message when this errors occure.Can i use the classes in the SRDEmo to catch the ora exceptions?
thanks in advance:)What we did is make our own "filterOracleUserException". In this class we replace the 'default' ORA-<error>-<errortext> with our own error message which is read from a bundle:
Here is the code:
private static String filterOracleUserException(String input) {
if (input != null) {
String[] lines = input.split("[\r\n]");
if (lines.length > 0) {
Matcher m = ORACLE_USER_ERROR.matcher(lines[0]);
if (m.matches()) {
return m.group(1).trim();
m = ORACLE_ERROR.matcher(lines[0]);
if (m.matches()) {
try {
String errorCode = lines[0].substring(4,9);
return JSFUtils.getStringFromBundle("AnError.ORA." + errorCode
,input);
} catch (IndexOutOfBoundsException ex) {
return input;
return input;
good luck with it
Luc Bors
Message was edited by:
lucbors -
How to Catch the state of the Entity Object
I have Location Entity object. With JClient I am testing it.
I want to insert the data,
due to validations (wrong data) insert fails.
Then I am correcting data, still to another view object it is passing old data.
After correcting the data when I try to click commit it is not executing the code from getEntityState = STATUS_NEW
Can someone also please let me know how to catch the state of the entity
ThanksHi Juli,
I am totally new to using Jdeveloper and I need ur humble help letting me know how to access an Entity object for invoking the insert, update and delete statements. It would be great if u can provide me with some error-free sample code.
Waiting for some help from U. -
How to download the data which is in the table?
how to download the data which is in the table?
every field data in the table i want to download and once the download is finished then i have to set the flag as 'download is finished ' as one field in table?
can any one help me in this.
Phani.
Edited by: phani kumarDurusoju on Jan 9, 2008 6:36 AMOne way is to Download the data Directly from the database table using the path SE11->Give table name ->Execute -> system ->List ->Save ->Local File
There u can downlaad the data .
The ither way is to use the code
The Following Code will be helpfull to You
Data :ITAB TYPE TRUXS_T_TEXT_DATA,
FILE TYPE STRING.
C_ASC TYPE CHAR10 VALUE 'ASC',
DATA: L_STATUS TYPE C,
L_MESSAGE TYPE PMST_RAW_MESSAGE,
L_SUBJECT TYPE SO_OBJ_DES.
DATA: L_FILELENGTH TYPE I.
PERFORM download_to_pc
TABLES
itab
USING
filename
c_asc
c_x
CHANGING
l_status
l_message
l_filelength.
FORM DOWNLOAD_TO_PC TABLES DOWNLOADTAB
USING FILENAME
FILETYPE TYPE CHAR10
DELIMITED
CHANGING STATUS
MESSAGE TYPE PMST_RAW_MESSAGE
FILELENGTH TYPE I.
DATA: L_FILE TYPE STRING,
L_SEP.
L_FILE = FILENAME.
IF NOT DELIMITED IS INITIAL.
L_SEP = 'X'.
ENDIF.
STATUS = 'S'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = L_FILE
FILETYPE = FILETYPE
WRITE_FIELD_SEPARATOR = L_SEP
IMPORTING
FILELENGTH = FILELENGTH
TABLES
DATA_TAB = DOWNLOADTAB
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
IF SY-SUBRC <> 0.
STATUS = 'E'.
CASE SY-SUBRC.
WHEN 1.
MESSAGE = 'gui_download::file write error'.
WHEN 2.
MESSAGE = 'gui_download::no batch'.
WHEN 3.
MESSAGE = 'gui_download::gui refuse file transfer'.
WHEN 4.
MESSAGE = 'gui_download::invalid type'.
WHEN 5.
MESSAGE = 'gui_download::no authority'.
WHEN 6.
MESSAGE = 'gui_download::unknown error'.
WHEN 7.
MESSAGE = 'gui_download::header not allowed'.
WHEN 8.
MESSAGE = 'gui_download::separator not allowed'.
WHEN 9.
MESSAGE = 'gui_download::filesize not allowed'.
WHEN 10.
MESSAGE = 'gui_download::header too long'.
WHEN 11.
MESSAGE = 'gui_download::dp error create'.
WHEN 12.
MESSAGE = 'gui_download::dp error send'.
WHEN 13.
MESSAGE = 'gui_download::dp error send'.
WHEN 14.
MESSAGE = 'gui_download::ubknown dp error'.
WHEN 15.
MESSAGE = 'gui_download::access denied'.
WHEN 16.
MESSAGE = 'gui_download::dp out of memory'.
WHEN 17.
MESSAGE = 'gui_download::disk full'.
WHEN 18.
MESSAGE = 'gui_download::dp timeout'.
WHEN 19.
MESSAGE = 'gui_download::file not found'.
WHEN 20.
MESSAGE = 'gui_download::dataprovider exception'.
WHEN 21.
MESSAGE = 'gui_download::control flush error'.
WHEN 22.
MESSAGE = 'gui_download::Error'.
ENDCASE.
ENDIF.
ENDFORM. "download_to_pc
At The End Reward points.
Please it's Required.
Thanks ,
Rahul -
How to catch SAP application errors in BPM.
Hi,
I have a IDOC to Soap Sync Scenario where I send the message to a Webservice. I have used a BPM since we need to catch the resposne of this message and map it to a RFC. For ex if I get a success resposne I need to map success if not than I need to catch the error and map it to the RFC. Now here in some cases like if the target system (webservice) is down than XI raises a sap application error:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Inbound Message
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
<SAP:Category>XIAdapterFramework</SAP:Category>
<SAP:Code area="MESSAGE">GENERAL</SAP:Code>
<SAP:P1 />
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Connection refused (errno:239)</SAP:AdditionalText>
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack />
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
Normally XI stops the process in these cases and does not proceed to the next step but I need to catch this message and map the content in the AdditionalText to the target RFC. Can anyone let me know how to catch this SAP Application Error in BPM and map it to the RFC.
Thanks,
BhargavHi Gaurav,
As I have mentioned I need to catch the application error in the BPM. If you see the discussion that is mentioned after the blog you have mentioned it is stated that the fault messages or the application error cannot be caught in BPM.
In the blog that you stated we can catch the fault message and map it to a message structure but only to that extent after that it would stop the BPM process at that step but would not proceed further as shown in the screenshot given in the blog it would fail as "application error restart not possible".
I need to proceed further and capture this error to an RFC Structure and call a proxy.
Here after the error it does not proceed to the next step.
Thanks,
Bhargav -
How to update the data in sqlserver table using procedure in biztalkserver
Hi,
Please can any one answer this below question
how to update the data in sqlserver table using procedure in biztalkserver
while am using executescalar,typedprocedure getting some warning
Warning:The adapter failed to transmit message going to send port "SendtoSql1" with URL "mssql://nal126//MU_Stage2?". It will be retransmitted after the retry interval specified for this Send Port. Details
Please send me asap....
Thanks...Hi Messip,
A detailed error would have helped us to answer you more appropriately but
You can follow the post which has step by step instructions, to understand how to use Stored Procedure:
http://tech-findings.blogspot.in/2013/07/insert-records-in-sql-server-using-wcf.html
Maheshkumar
S Tiwari|User
Page|Blog|BizTalk
2013: Inserting RawXML (Whole Incoming XML Message) in SQL database -
How to get the Date in a particular format?
Hi,
How to get the Date in the below format? I will be passing the year in my method..
2/10/2003 9:46:52 PM
D/M/YYYY H:M:S A
public Date getDate (String year) {
Here i want to get the Date in this format
2/10/<Passed Year> 9:46:52 PM
ThanksThis is my code
public static Date getCalendar(Calendar calendar,int getYear) {
String formatted_date="";
int year = getYear;
int month = calendar.get(Calendar.MONTH+1);
int day = calendar.get(Calendar.DATE);
int hour = calendar.get(Calendar.HOUR);
int min = calendar.get(Calendar.MINUTE);
int sec = calendar.get(Calendar.SECOND);
int am_pm =calendar.get(Calendar.AM_PM);
formatted_date = month+"/"+day+"/"+year+" "+hour+":"+min+":"+sec+" PM";
System.out.println("formatted_date is "+formatted_date);
o/p : formatted_date is 1/4/2006 1:44:21 PM
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
// DateFormat dateFormat =DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
Date passdate = new Date();
try {
passdate = dateFormat.parse(formatted_date);
} catch (ParseException e) {
System.out.println("Invalid Date Parser Exception "+e.getLocalizedMessage()+"DateFormat is "+dateFormat);
System.out.println("The Date inside the function is "+passdate+"and the year passed is "+year);
o/p : The Date inside the function is Sat Apr 01 00:00:00 IST 2006and the year passed is 2006
return passdate;
Expected O/P is 3/1/2006 1:44:12 PM
} -
How to insert the data from XML to a table
Hi,
I'm using Oracle 10g Express Edition
I need help in How to insert the data from XML file into the table.
Below is the example i'm working on..
I have create ridb user with below mentioned privileges:
Account Status Locked Unlocked
Default Tablespace: USERS
Temporary Tablespace: TEMP
User Privileges :
Roles:
CONNECT
RESOURCE
Direct Grant System Privileges:
CREATE DATABASE LINK
CREATE MATERIALIZED VIEW
CREATE PROCEDURE
CREATE PUBLIC SYNONYM
CREATE ROLE
CREATE SEQUENCE
CREATE SYNONYM
CREATE TABLE
CREATE TRIGGER
CREATE TYPE
CREATE VIEW
& table is created TRIALZIPCODES below mentioned is the DDL:
CREATE TABLE TRIALZIPCODES
STATE_ABBR VARCHAR2(20) NOT NULL
, ZIP_CODE NUMBER(10, 0) NOT NULL
, ZIP_CODE_EXT VARCHAR2(20)
Below is the XML FILE: which is stored in C:\OracleProject Folder
File name: trial.xml
<?xml version="1.0" ?>
<metadata>
- <Zipcodes>
- <mappings Record="4">
<STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
<ZIPCODE>94301</ZIPCODE>
</mappings>
- <mappings Record="5">
<STATE_ABBREVIATION>CO</STATE_ABBREVIATION>
<ZIPCODE>80323</ZIPCODE>
<ZIP_CODE_EXTN>9277</ZIP_CODE_EXTN>
</mappings>
</Zipcodes>
</metadata>
PL/SQL Procedure:which i'm trying to execute from SQLDeveloper
create or replace
PROCEDURE TRIAL AS
BEGIN
DECLARE
-- declare attributes
charString varchar2(80);
finalStr varchar2(4000) := null;
rowsp integer;
v_FileHandle UTL_FILE.FILE_TYPE;
l_context_handle dbms_xmlgen.ctxHandle;
insCtx DBMS_XMLStore.ctxType;
begin
-- DBMS_XMLGEN.setRowTag ( ctx IN ctxHandle, rowTag IN VARCHAR2);
-- DBMS_XMLGEN.setRowSetTag ( ctx IN ctxHandle, rowSetTag IN VARCHAR2);
-- the name of the table as specified in our DTD
DBMS_XMLGEN.SETROWSETTAG(l_context_handle,'zipcodes');
-- the name of the data set as specified in our DTD
DBMS_xmlgen.setRowTag(l_context_handle,'mappings');
-- for getting the output on the screen
dbms_output.enable(1000000);
-- open the XML document in read only mode
v_FileHandle := utl_file.fopen('c:/OracleProject','trial.xml', 'r');
loop
BEGIN
utl_file.get_line(v_FileHandle, charString);
exception
when no_data_found then
utl_file.fclose(v_FileHandle);
exit;
END;
dbms_output.put_line(charString);
if finalStr is not null then
finalStr := finalStr || charString;
else
finalStr := charString;
end if;
end loop;
-- for inserting the XML data into the table
insCtx := DBMS_XMLSTORE.NEWCONTEXT('RIDB.TRIALZIPCODES');
insCtx := DBMS_XMLSTORE.INSERTXML(insCtx, finalStr);
dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
DBMS_XMLStore.closeContext(insCtx);
END;
END TRIAL;
For the first time when i complied i got the errors as :
Procedure RIDB.PROCEDURE1@RIDB
Error(16,14): PLS-00201: identifier 'UTL_FILE' must be declared
Error(16,14): PL/SQL: Item ignored
Error(29,1): PLS-00320: the declaration of the type of this expression is incomplete or malformed
Error(29,1): PL/SQL: Statement ignored
Error(33,1): PL/SQL: Statement ignored
Error(33,19): PLS-00320: the declaration of the type of this expression is incomplete or malformed
Error(36,1): PL/SQL: Statement ignored
Error(36,17): PLS-00320: the declaration of the type of this expression is incomplete or malformed
So i logged in as sys & grant the permission to execute on UTL_FILE to ridb (user):
SQL Statement:
grant execute on utl_file to ridb
So, it got compiled successfully but when i execute it gives me error as:
Source does not have a runnable target.
What does this mean?
So I browse through forum & i got to know that i need to initial the UTL_FILE_DIR ="C:/OracleProject" in init.ora
So can i edit the init.ora with notepad.When i tried to do that it says permission denied
In my system it shows the init.ora file in path C:\oraclexe\app\oracle\product\10.2.0\server\config\scripts
but there is also other file initXETemp in the same path do i need to do the changes in it.
I have tried even editing the SPFILE as mentioned below:
C:\oraclexe\app\oracle\product\10.2.0\server\dbs\SPFILEEXE - I had edit this file using notepad & set the value of UTL_FILE_DIR ="C:/OracleProject". So next time when i restarted i'm unable to log on to the database.
So i had reinstall the software again.
Could you please let me know how to proceed..hi,
I have created the directory from sys database
CREATE or replace DIRECTORY XML_DIR2 AS 'C:\OracleProject';
& grant read,write access to the user
grant read,write on directory XML_DIR2 to RIDB;
& i had change the tag name in the xml file as shown below:
<?xml version = '1.0'?>
<metadata>
<Zipcodes>
<mappings Record="4">
<STABBRE>CA</STABBRE>
<ZIPCODE>94301</ZIPCODE>
</mappings>
<mappings Record="5">
<STABBRE>CO</STABBRE>
<ZIPCODE>80323</ZIPCODE>
<ZIPCODEEXT>9277</ZIPCODEEXT>
</mappings>
</Zipcodes>
</metadata>
TRIALZIPCODE table as shown below:
CREATE TABLE "RIDB"."TRIALZIPCODE"
( "STABBRE" VARCHAR2(20 BYTE),
"ZIPCODE" NUMBER(*,6) NOT NULL ENABLE,
"ZIPCODEEXT" NUMBER
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS" ;
I have tried two methods as shown below:
Procedure 1:
create or replace
PROCEDURE TRIAL_V2 AS
BEGIN
DECLARE
-- declare attributes
charString varchar2(80);
finalStr varchar2(4000) := null;
rowsp integer;
v_FileHandle UTL_FILE.FILE_TYPE;
l_context_handle dbms_xmlgen.ctxHandle;
insCtx DBMS_XMLStore.ctxType;
cnt NUMBER;
xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
--XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
BEGIN
insCtx := DBMS_XMLStore.newContext('DEV.TRIALZIPCODES');
DBMS_XMLStore.setUpdateColumn(insCtx, 'STABBRE');
DBMS_XMLStore.setUpdateColumn(insCtx, 'ZIPCODE');
DBMS_XMLStore.setUpdatecolumn(insCtx, 'ZIPCODEEXT');
DBMS_XMLStore.setRowTag(insCtx, 'mappings');
cnt := DBMS_XMLStore.insertXML(insCtx, xmldoc);
DBMS_XMLStore.closeContext(insCtx);
END;
Procedure 1 was compiled with out errors but when i execute i got the error as :
Source does not have a runnable target.
Procedure 2_
CREATE OR REPLACE PROCEDURE TRIAL_V3 AS
BEGIN
DECLARE
-- declare attributes
charString varchar2(80);
finalStr varchar2(4000) := null;
rowsp integer;
v_FileHandle UTL_FILE.FILE_TYPE;
l_context_handle dbms_xmlgen.ctxHandle;
insCtx DBMS_XMLStore.ctxType;
cnt NUMBER;
xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
--XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
BEGIN
INSERT INTO trialzipcode (STABBRE, ZIPCODE, ZIPCODEEXT)
SELECT extractvalue(x.column_value, 'mappings/STABBRE'),
extractvalue(x.column_value, 'mappings/ZIPCODE'),
extractvalue(x.column_value, 'mappings/ZIPCODEEXT')
FROM TABLE(
XMLSequence(
EXTRACT(
xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') ),
'metadata/Zipcodes/mappings'
) x
END;
END TRIAL_V3;
Procedure 2 was complied without errors but when i execute i got the error as:
Connecting to the database RIDB.
ORA-22288: file or LOB operation FILEOPEN failed
The system cannot find the file specified.
ORA-06512: at "SYS.DBMS_LOB", line 523
ORA-06512: at "SYS.XMLTYPE", line 287
ORA-06512: at "RIDB.TRIAL_V3", line 12
ORA-06512: at line 2
Process exited.
Disconnecting from the database RIDB.
Could you please let me know how to proceed... -
hey guys
i installed the sqlite and sqlite-net as requested in other answers i found, changed to x86, and add the .db3 file in my project.
but the problem is how to retrive the data that already in the file( i am not creating any table or data in the app, just read)
all the answer i found is to create a table first and then read the table, i tried to skip the step of creating a table, and read from the table directly, but failed with " no such table", by the way, i set the property of the .db3 file as "content",
"copy if newer"
can anyone please help? i appreciate that !Hello,
From your description, you want to read data from available sqlite file. When you add the sqlite file into your project, you need to change the sqlite file build action to content. After deploying to device, the sqlite file is located in installation folder,
you need to copy that file into storage folder before reading data. Please try the following code snippets.
private async void Button_Click_9(object sender, RoutedEventArgs e)
//check if file exists in storage folder, and then copy to local storage
bool flag = await FileExistsAsync("Data.db3");
if (!flag)
var folder = await Package.Current.InstalledLocation.GetFileAsync("Data.db3");
await folder.CopyAsync(Windows.Storage.ApplicationData.Current.LocalFolder);
// open sqlite and read data
public async Task<bool> FileExistsAsync(string fileName)
try
await Windows.Storage.ApplicationData.Current.LocalFolder.GetFileAsync(fileName);
return true;
catch (FileNotFoundException)
return false;
Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
the survey. -
How to store the data of a file into an ArrayList?
Hi! everyone.
I want to know
if I have a File, and the data in the file are type int, type String...
And I have a ArrayList which is of type Question
How do I store the data of that file into the ArrayList
I tried to use the while loop(use the hasNextLine() to read the data line by line)
But I cannot add data which are not of type Question to the ArrayList.
Can you tell me what I should do, please?
I also wonder that
The data of the file are of many types, but when I try to read it with the nextLine(), the data all turn out to be of type String. Why?
Thank you.
Edited by: Terry001 on Apr 30, 2008 1:13 PMNo, a line in the file is just part of a question
The format of the file is like this:
*<question type code> : String*
*<question point value> : int*
*<question category> : String*
*<question difficulty level> : int*
*<question text> : String*
*<question correct answer> : String*
*<optional question-specific data> : String*
*<question terminator> : String*
And here is an example
TF //TrueFalseQuestion
5 //points value
None //category
3 //difficulty level
The capital of the United States is Washington, D.C. //question text
True // answer
*** //quetion terminator
I created an ArrayList in the Test class:
private ArrayList<Question> questions; // Create inside constructor
public Test (String name, String instr)
testName = name;
scoreEarned = 0;
scorePossible = 0;
instructions = instr;
questions = new ArrayList<Question>(); //[MAX_NUMBER_OF_QUESTIONS];
}And I tried to use the following method to store the data of the file to the ArrayList
// This method loads a set of questions from a plain text file
public void loadQuestionsFromFile(String fileName) throws FileNotFoundException
try
File fileReader = new File("input.txt");
Scanner sc = new Scanner(fileReader);
while (sc.hasNextLine())
// I don't know how to pass the data I got from the nextLine() method to the ArrayList because they are of different type
catch (FileNotFoundException a)
System.out.println(a);
} As all you said, I should create an Question object in the while loop
Question temp = new Question ();But I have no idea how to pass the int and String to the Question object.
Thank you -
How to retrieve the data from SAP-BAPI by using VB Code
Hi ,
I am new to BAPI.
V have created an application in Visual Basic with the following fields
EmpNo , EmpName, Addr1, Addr2, City and Phone (Only for Test)
We have written the code for SAVING the data into SAP. Already we have
constructed a table with the respective fields in SAP.
For that we ourself created our own BAPI Structure / Function Group /
Function Module/ Business Object - RELEASED related elements.
1)Established the connection successfully.
2)Stored the data into SAP Successfully and v r in need of
3)HOW TO RETRIEVE THE DATA FROM SAP (USING GETLIST.....GETDETAIL....)
Following is the code :
'BAPI Structure : ZBAPIEMP
'Function Group : ZBAPIEMP
'Function Module : ZBAPI_EMP_CREATEFROMDATA
'Business Object : ZBAPIEMP
'Function Module : ZBAPI_EMP_GETLIST
Dim bapictrl As Object
Dim oconnection As Object
Dim boEmp As Object
Dim oZEmp_Header As Object
Dim oImpStruct As Object
Dim oExpStruct As Object
Dim oreturn As Object
Dim x As String
Private Sub Form_Load()
Set bapictrl = CreateObject("SAP.BAPI.1")
Set oconnection = bapictrl.Connection
oconnection.logon
Set boEmp = bapictrl.GetSAPObject("ZBAPIEMP")
Set oZEmp_Header = bapictrl.DimAs(boEmp, "CreateFromData", "EmployeeHeader")
Set oImpStruct = bapictrl.DimAs(boEmp, "GetList", "EmployeeDispStruct")
End Sub
Private Sub cmdSave_Click()
oZEmp_Header.Value("EMPNO") = txtEmpNo.Text
oZEmp_Header.Value("EMPNAME") = txtEmpName.Text
oZEmp_Header.Value("ADDR1") = txtAddr1.Text
oZEmp_Header.Value("ADDR2") = txtAddr2.Text
oZEmp_Header.Value("CITY") = txtCity.Text
oZEmp_Header.Value("PHONE") = txtPhone.Text
boEmp.CreateFromData EmployeeHeader:=oZEmp_Header, Return:=oreturn
x = oreturn.Value("Message")
If x = "" Then
MsgBox "Transaction Completed!..."
Else
MsgBox x
End If
End Sub
Private Sub cmdView_Click()
End Sub
COULD ANYBODY GUIDE ME, HOW TO RETRIEVE THE DATA FROM BAPI, FOR THE WRITTEN CODE.I didn't seen any other answers but here's how it's been done previously in our organization for a custom BAPI. In this example, we give material and language to return the part description. It's not specific to your project but may give you ideas..
-Tim
Option Compare Database
Dim SAPLOGIN As Boolean
Dim FunctionCtrl As Object
Dim SapConnection As Object
Sub SAPLOGOUT()
On Error GoTo LogoutFehler
SapConnection.logoff
SAPLOGIN = False
Exit Sub
LogoutFehler:
If Err.Number = 91 Then
Exit Sub
Else
MsgBox Err.Description, vbCritical, "Fehler-Nr." & CStr(Err.Number) & " bei SAP-Logout"
End If
End Sub
Function SAPLOG() As Boolean
'Verbindungsobjekt setzen (Property von FunctionCtrl)
Set FunctionCtrl = CreateObject("SAP.Functions")
Set SapConnection = FunctionCtrl.Connection
'Logon mit Initialwerten
SapConnection.Client = "010"
SapConnection.Language = "EN"
SapConnection.System = "PR1"
SapConnection.SystemNumber = "00"
'SapConnection.Password = ""
SapConnection.GroupName = "PR1"
SapConnection.HostName = "168.9.25.120"
SapConnection.MessageServer = "168.9.25.120"
If SapConnection.Logon(0, False) <> True Then 'Logon mit Dialog
Set SapConnection = Nothing
DoCmd.Hourglass False
MsgBox "No connection to SAP R/3 !"
SAPLOGIN = False
SAPLOG = False
Exit Function
End If
SAPLOG = True
End Function
Function MatDescr(MatNr As String)
Dim func1 As Object
Dim row As Object, X As Integer, ErsteNr As String
Dim DatensatzZähler As Long
Dim RowField(1 To 50, 0 To 1) As String, RowLine As Long
If Not SAPLOGIN Then
If Not SAPLOG() Then
MsgBox "No connection to SAP !", 16
SAPLOGOUT
Exit Function
End If
End If
' Instanziieren des Function-Objektes
Set func1 = FunctionCtrl.Add("Z_BAPI_READ_MAKT")
' Export-Paramter definieren
func1.exports("MATNR") = MatNr
func1.exports("SPRAS") = "EN"
DoEvents
If Not func1.call Then
If func1.exception <> "" Then
MsgBox "Communication Error with RFC " & func1.exception
End If
DoCmd.Hourglass False
SAPLOGOUT
Exit Function
Else
MatDescr = func1.imports("MAKTX")
End If
If MatDescr = "" Then
MatDescr = "PART NO. NOT FOUND"
End If
End Function
Maybe you are looking for
-
Is iPod Jan Software Update tied to one iPod or one Account - No audio
I think I've been a good scout thus far. I've followed the forums, all the complaints and all the issues and STILL purchased the Jan Software update for my iPod 16 GB. From the advice, I knew to back up my music, make the purchase and do an automatic
-
Remote Software Updates and Sending Task Status to User
I am updating user's machines using ARD 3 with the unix command 'softwareupdate -i -a'. With some updates, a restart is required and ARD posts this within the task status column. I was wondering if there was a way to grab that task status of "restart
-
How to opened the Query in WEB
Hello: Now the <b>IGS</b> has ready, I can click the query in favority when login on bw by GUID. But I can not find the fuction to open the query in WEB. Is there other thing I didn't do? Hope someone can give me some advice. Regards&Thanks! zagor
-
We are working with J2EE technology. We have J2EE 1.3.1 an Forte4j in Windows 95 and Windows 98 system operatings When we compile and them, we want to run a JSP page the internet explorer opens and dont do anything more. Must we configure something f
-
I need to pick in bulk and select all the lines of the orders each order alone
I have 100 sales order I need to pick in bulk in one LPN or without LPN for the 100 sale order at staging I need to separate them by orders I need to pack each order alone the prder may have different item when I finish the first order I will continu