Method to determine 'Source ' of Insertion of Data
Hi SAP Gurus,
How can I know as to which program inserts data into a 'Z' table .The table has a table maintence generator.
Othe than that which standard program/zprogram inserts data z table.
Apart from 'where used list' is there any other way around.
Thanks in advance.....
Regards,
Gaurav
Hello Gaurav,
Most of the times during debugging huge program we will want to find out where the data is getting inserted into a table. But you are asking for where the table is getting populated in the whole of SAP. I do not know your requirement completely (i.e., i do not know the big picture of your problem).
I also would like to know why you do not want to use the where-used list functionality. It is really a very good option to use in this case. You should try using this functionality more optimally.
For example, if there is a Z Table, then <b>in general</b>, there is no way that a standard program will update it. Even if there is a user-exit in some program, it will also begin with a 'Z'. Now when you do the where-used list for this table, you can restrict the search area to consider only the Z objects.
Lastly, if you are expecting that this table will be updated through dynamic inserts, for example through statements like
INSERT INTO (dbtabname) VALUES wa.
INSERT (dbtabname) FROM wa.
INSERT (dbtabname) FROM TABLE itab.
then you can search the programs for the name of the table. i.e., if your table is ZTEST, then you can search for all the programs that contain the string 'ZTEST'. Refer to the conversation at Re: Search content of ABAP programs for more information.
Hope this has been helpful.
Regards,
Anand Mandalika.
Similar Messages
-
How CallableStatement in JSP use setDate() method to insert the date value into DB?
Dear all,
I met a strange error message when i insert a date value into DB via JSP call PL/SQL procedures.
The error seems caused by the setDate(index, date) method with CallableStatement.
The message is: Can not find the setDate(int, java.util.Date) method in the CallableStatement interfaces.
Any ideas?
Thanks advanced.Thank you!:)
I solved it using this:
String name="david";
stmt = con1.createStatement();
String prikaz1 = "INSERT INTO table (id,age,surname,name) IN 'C:\\Users\\David\\Desktop\\db.mdb' SELECT id,age,surname,' " + name + " ' FROM table2";
stmt.executeUpdate(prikaz1); -
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... -
Using DECODE() to insert to DATE field
I'm trying to use the DECODE function to test for NULL before inserting to a DATE field. However, it seems to only insert the DATE, with a "default" time of 12:00 - it isn't properly inserting the time.
Basically I need to test if Date1 is NULL. If it isn't I need to concatenate the DATE from Date1 with the TIME from Date2 to get a full date/time... then insert this new value.
Generic Example:
CREATE TABLE DATETEST (TestID NUMBER(1), TestDate DATE);
DECLARE
v_Date1 DATE;
v_Date2 DATE;
BEGIN
v_Date1 := TO_DATE('01-JAN-11 05:53:12', 'DD-MON-YY HH:MI:SS');
v_Date2 := TO_DATE('08-FEB-11 02:18:31', 'DD-MON-YY HH:MI:SS');
INSERT INTO DATETEST (TestID, TestDate) VALUES ('1', DECODE(v_Date1, NULL, NULL, TO_DATE(To_Char(v_Date1, 'DD-MON-YY') || ' ' || TO_CHAR(v_Date2, 'HH:MI:SS'),'DD-MON-YY HH:MI:SS')));
INSERT INTO DATETEST (TestID, TestDate) VALUES ('2', TO_DATE(To_Char(v_Date1, 'DD-MON-YY') || ' ' || TO_CHAR(v_Date2, 'HH:MI:SS'),'DD-MON-YY HH:MI:SS'));
END;
SELECT TestID, TO_CHAR(TestDate, 'DD-MON-YY HH:MI:SS') from DATETEST;
This example performs two inserts. One with the DECODE function, and one without. The one without inserts the time properly. Can anyone tell me why the one with the DECODE function doesn't? I realize I can use a simple if/then to check if the date is null above and put the date/time in a variable, but since my real scenario is in a large chunk of other stuff, I'm trying to keep it as streamlined as possible.
Edited by: BoredBillJ on Jul 14, 2011 6:39 AMThe problem you are having is due to the nature of how DECODE and CASE determine what datatype to return, and you nls_date_format settings. Both use the data type of the first returnable argument to determine all of them. So, in your decode statement, the first returnable value is NULL which, in the absence of a cast (either implicit or explicit), is a varchar2 column. So, if the date is not null, the implicit conversion to a varchar to match the retunr type, then back to date to insert into the table is losing the time. you need something more like:
INSERT INTO test_date (Test_ID, TestDate)
VALUES ('1', DECODE(v_Date1, NULL, TO_DATE(NULL),
TO_DATE(To_Char(v_Date1, 'DD-MON-YY') || ' ' ||
TO_CHAR(v_Date2, 'HH:MI:SS'),'DD-MON-YY HH:MI:SS')));Even if you use Solomon's method of generating the date, if you need the decode/case, then you will have to either use the TO_DATE(NULL) or use case instead of decode and reverse the test so the first returnable is a date like:
SQL> DECLARE
2 v_Date1 DATE;
3 v_Date2 DATE;
4 BEGIN
5 v_Date1 := TO_DATE('01-JAN-11 05:53:12', 'DD-MON-YY HH:MI:SS');
6 v_Date2 := TO_DATE('08-FEB-11 02:18:31', 'DD-MON-YY HH:MI:SS');
7 INSERT INTO test_date (Test_ID, TestDate)
8 VALUES ('1', CASE WHEN v_date1 IS NOT NULL
9 THEN TO_DATE(To_Char(v_Date1, 'DD-MON-YY') || ' ' ||
10 TO_CHAR(v_Date2, 'HH:MI:SS'),'DD-MON-YY HH:MI:SS')
11 ELSE NULL END);
12 INSERT INTO test_date (Test_ID, TestDate)
13 VALUES ('2', TO_DATE(To_Char(v_Date1, 'DD-MON-YY') || ' ' ||
14 TO_CHAR(v_Date2, 'HH:MI:SS'),'DD-MON-YY HH:MI:SS'));
15 END;
16 /
PL/SQL procedure successfully completed.
SQL> select test_id, to_char(testdate, 'dd-mon-yyyy hh24:mi:ss')
2 from test_date;
TEST_ID TO_CHAR(TESTDATE,'DD
1 01-jan-2011 02:18:31
2 01-jan-2011 02:18:31John -
Trains Stops and Insert new data using invokeAction!?
Hi! I am using Train element to insert data in some tables. When I open first Train Step I use invokeAction to call CreateInsert operation and could insert new data in table1. Then I go to Train Step 2 and using invokeAction insert data in table2 and so on.
I have two questions:
1. When I go back to previous Train Step using "Back" button then invokeAction again calls CreateInsert operation, but I don't need it. It is possible to call CreateInsert operation using invokeAction ONLY if user goes forward by pressing "Next" button in Train element? If it is possible then What I need to change in my code?
invokeAction source:
<invokeAction Binds="CreateInsert" id="insert_mode"
RefreshCondition="${!requestContext.postback and empty bindings.exceptionsList}"
Refresh="prepareModel"/>2. It is possible to DISABLE some Train Stopas. For example, I want to disable first Train Stop for user when he go to next steps, so that user can't anymore go back to first Train Stop.
Hope for Your answers, best regards, Debuger!Hi, Umesh! My use case is following: I am on first Train Stop and enter some data. Then I go to second Stop and enter some data and so on. When I go to first, second etc. Train stops I use invokeAcrion to call CreateInsert. I need to call only this operation when I press next button. When I press Back button I do not need to call Create Insert action. Hope You understand me.
So, as I understand, i need to create method which indicates variable value based which button is pressed. But I don't understand how I can say, variable x=nextbuttonpressed or x=backbuttonpressed based on which button I realy press. And do not understand also how to use this variable in invokeAction Refresh Condition?
Hope You can explain me that with steps to do in my case and can help with code?
Waiting for response, best regards, Debuger. -
Best method to determine the week number of a month - SQL Server 2012
Hi,
I'm searching the most valid and tested method to determine the week number respect to a month.
Fe, the 1st January falls in the 1st week of January, the 1st February fall in the 1st week of February, and so on.
I've found many solutions but I'd like to know possibly the best one.
ThanksHi Uri,
SELECT DATEPART(week, '20150104')
- DATEPART(week, CONVERT(CHAR(6), '20150104', 112)+'01')
+ 1
returns 2 and not 1. It's a Sunday.
Waiting to be spoonfed, eh?
The one-off in my query would be very simple to figure out - I forgot to add the +1. Is too much to expect from you that you could figure it out yourself?
And likewise, in my post I said that you should use "week" for weeks starting on Sunday, and "iso_week" if your week starts on Monday. Uri neglected to observe this, but you had the information to correct it. If you had been interested
in doing some work yourself, that is.
Nevertheless, there is an issue that I overlooked:
DECLARE @day date = '20160105'
SELECT datepart(iso_week, @day) -
datepart(iso_week, convert(char(6), @day, 112) + '01') + 1
This returns -51. This is because with ISO week numbering, Jan 1st falls into week 53 of the previous year, if it's on a Friday or later. Week 1 is always the week of Jan 4th. When you week this does not happen, as week 1 is always the week with Jan
1st. (Dec 31st is always in week 53 or 54.)
To correct for this, we need this query:
SELECT DATEPART(iso_week, @day) -
CASE WHEN DATEPART(iso_week, CONVERT(CHAR(6), @day, 112) + '01') < 50
THEN DATEPART(iso_week, CONVERT(CHAR(6), @day, 112) + '01')
ELSE 1
END + 1
Erland Sommarskog, SQL Server MVP, [email protected] -
Hi all,
I did File to RFC scenario. My problem is when i send message the message is showen as processed successfully in SXMB_MONI. But RFC is not inserting my data in a specified table. I couldn't found where i am wrong.
my sender strucure is:
<MANDT>
<WORKDATE>
<EMPLOYEENUMBER>
<CATSHOURS>
R3 table name is ZTESTCATSDB
My RFC source code is :
FUNCTION Z_POST_TEST.
""Local Interface:
*" TABLES
*" CATSRECORDS_IN STRUCTURE ZTESTCATSDB OPTIONAL
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
data wa_cats like ZTESTCATSDB.
data wa_catdb like ZTESTCATSDB.
data ztab like ZTESTCATSDB OCCURS 0 WITH HEADER LINE.
loop at catsrecords_in into wa_cats.
ztab-WORKDATE = wa_cats-workdate.
ztab-empnum = wa_cats-empnum.
ztab-catshours = wa_cats-catshours.
append ztab.
endloop.
insert ZTESTCATSDB from table ztab.
commit work.
ENDFUNCTION.
Plese tell me any one where i am wrong it is very urgent for me.
Thanks,
Satish.You should always check the system return code (sy-subrc) after any insert and update statement like this:
insert ...
if sy-subrc > 0.
message E...
else.
commit work.
endif.
Hope that helps,
Stefan -
Custom PL/SQL API that inserts the data into a custom interface table.
We are developing a custom Web ADI integrator for importing suppliers into Oracle.
The Web ADI interface is a custom PL/SQL API that inserts the data into a custom interface table. We have defined the content, uploader and an importer. The importer is again a custom PL/SQL API that will process the records inserted into the custom table and updates the STATUS column of the custom interface table. We want to show the status column back on the spreadsheet.
Defined the 'Document Row' import rule and added the rows that would identify the unique record.
Errored row import rule, we are using a SELECT * from custom_table where status<>'Success' and vendor_name=$param$.vendor_name
The source of this parameter is import.vendor_name
We have also defined an Error lookup.
After the above setup is completed, we invoke the create document and click on Oracle->Upload.
The records are getting imported, but the importer program is failing with An error has occurred while running an API import. The ERRORED_ROWS step 20003:ER_500141, parameter number 1 must contain the value BIND in attribute 1.'The same issue.
Need help.
Also checked bne.log, no additional information.
<bne:document xmlns:bne="http://www.oracle.com/bne">
<bne:message bne:type="DATA" bne:text="BNE_VALID_ROW_COUNT" bne:value="11" />
<bne:message bne:type="DATA" bne:text="BNE_INVALID_ROW_COUNT" bne:value="0" />
<bne:message bne:type="ERROR" bne:text="An error has occurred while running an API import"
bne:cause="The ERRORED_ROWS step 20003:ER_500165, parameter number 1 must contain the value BIND in attribute 1."
bne:action="" bne:source="BneAPIImporter" >
<bne:context bne:collection="collection_1" />
</bne:message><bne:message bne:type="STATUS"
bne:text="No rows uploaded" bne:value="" >
<bne:context bne:collection="collection_1" /></bne:message>
<bne:message bne:type="STATUS" bne:text="0 rows were invalid" bne:value="" >
<bne:context bne:collection="collection_1" /></bne:message></bne:document> -
Source List Validity Start Date
I have noticed that, if the source list validity start date and contract validity start date are same then, the contract price is not considered while creating PO and receive error message as "Source not included in list despite source list requirement"
If I change the validity start date of source list to one day before the validity start date of Contract then system is picking the contract price in PO and able to save PO successfully.
Is there any way to create PO even if the validity start date of source list and contract are same?from OSS Note 44368 - ME51 ME57 Contract as source of supply
A contract that is valid on the delivery date but not on the current date is not taken into account in the source determination process.
Cause and prerequisites
This is programmed this way.
Solution
For reasons of upward compatibility, check will continue to be carried out on basis of current date.
However, if you wish the check to be against delivery date, you can implement the modification described under the advance corrections.
If Note 116464 is implemented in a 4.0B Release, use the advance correction from Release 4.5A, however, in Release 4.0B the program name is LMEQRF01. -
How to insert sign date "now()" in database ?????
I am a newbie. Using DW CS5 I have been able to get a number of web pages on my web site to work well. My problem is with my “sign in form”. I want to add in the sign in form a hidden field for the date that the user signs up.
But the signup_date value in the database is not been entered. I do have a “work around”. If I replace the last “%s” in the $insertSQL statement with NOW(), the correct signup_date is entered in the database table “users”. However, I want to learn to do it “right”. My questions:
1. What is the “best” way to accomplish my desire results?
2. What do the “%s” stand for in the $insertSQL statement? I think it is an array, but I do not understand this line of code that DW generated. Can you explain is plain English?
Below is the important part of the code (I hope I sent enough to explain the problem) for the sign form: (disregard the /////// they are only there to indicate different sections of the code).
//This is the code from the input form for the hidden field "signup_date"
</tr>
<tr>
<td align="left" valign="top"><input name="signup_date" type="hidden" id="signup_date" value="NOW()" />
<td><input type="submit" name="Submit" value="Join Now!"></td>
</tr>
</table>
//This is the dreamweaver code to insert the date into the data base:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frJoin")) {
$insertSQL = sprintf("INSERT INTO users (first_name, last_name, email_address, username, info, user_level, signup_date) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['first_name'], "text"),
GetSQLValueString($_POST['last_name'], "text"),
GetSQLValueString($_POST['email_address'], "text"),
GetSQLValueString($_POST['username'], "text"),
GetSQLValueString($_POST['info'], "text"),
GetSQLValueString($_POST['user_level'], "text"),
GetSQLValueString($_POST['signup_date'], "date"));
Thanks !!I do have a “work around”. If I replace the last “%s” in the $insertSQL statement with NOW(), the correct signup_date is entered in the database table “users”. However, I want to learn to do it “right”.
Your "workaround" is actually the correct method. The way that you think is "right", by entering the date into a hidden field, is actually the wrong way. Hidden fields can be manipulated. Inserting data directly into the query is the desired method, like the method you are currently using. It's not a "workaround", it's the correct method. You hidden field is not working because you have not told the page that the NOW() in the hidden field should be processed through php. NOW() is MySQL function. Use php to echo current date in hidden field if you want to use the "wrong" method of processing the date into your query.
<td align="left" valign="top"><input name="signup_date" type="hidden" id="signup_date" value="<?php echo date("Y-m-d H:i:s"); ?>" /> -
Inserting blob data into database
Hello everybody,
I need insert blob data into database. that data i need to get from form
can i use request.getParameter(""); for getting that file.
Plz help how to get data from form to servlet and through callablestatement i need to insert into database.
regards,
AnilHi,
1) first create a form with file element
first.jsp
<form action="GetData" enctype="multipart/form-data" method="post">
<input type="file" name="datafile" size="40">
<input type="submit" value="Send">
<input type="reset" name="Reset" value="Cancel">
</form>
GetData.java
// servlet file
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
res.setContentType("text/html");
PrintWriter out = response.getWriter();
try {
System.setProperty( "jdbc.drivers", "com.microsoft.jdbc.sqlserver.SQLServerDriver" );
Class.forName( "com.microsoft.jdbc.sqlserver.SQLServerDriver" );
con = DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=JAVATEAM;SelectMethod=cursor;User=sa;Password=urpassword" );
PreparedStatement pst = con.prepareStatement("insert into uploads(binaryfile) values(?)");
FileInputStream fis=new FileInputStream(request.getParameter ( "datafile" ) );
byte[] b= new byte[fis.available()+1];
fis.read(b);
pst.setBytes(1,b);
pst.executeUpdate();
pst.close();
con.close();
catch(SQLException e)
out.println ( e);
catch (ClassNotFoundException e)
out.println( e );
}Here in doPost(), i create preparedstatement,
now you to create one procedure for insert
and by using callable statement you just call that procedure and pass this byte b as arguments,
now its in your hands
my idea is over. -
JDBC + SERVLET: inserting text data to access file from Html form
Hi everybody !
I'm trying to insert text data from my html form to access database using servlet and jdbc technologies.
The problem that I'm that the data is TEXT, but not the English language !!!
So my access db file gets - ???????? symbols instead the real text.
This is the form line that sending data to my servlet:
<form
method="POST"
ACTION=http://localhost:8080/servlet/myServlet enctype="text/html">
And this is servlet line that defines response content:
res.setContentType( "text/html" );
What can I do to get in access db file the right text format and not a ???????? symbols.
Maybe I must to ad some <meta ...> , but where ?You're dealing with Unicode, I'd guess, and not ASCII.
I guess I'd have two questions:
(1) Is the character encoding on your pages set properly for the language you're trying to use?
(2) Does Access handle Unicode characters?
Access isn't exacly a world-class database. (If it was, there'd be no reason for M$ to develop SQL Server.) I'd find out if it supports other character sets. If not, you'll have to switch to a more capable database that does. - MOD -
Insertion of data to MS SQL Server is not happening via SOA layer
Hi,
There is a requirement in our project to take the data from Orcale EBS and insert into a different legacy and it is a MS SQL Server. So it makes it Orcale DB to SQL Server. When i manually insert data to a table in SQL Server it's working fine. When i try to insert the data to the same table using BPEL(SOA 11g), It's giving out an exeception,
"{http://schemas.oracle.com/bpel/extension}bindingFault" has been thrown.
Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [InsertCustomerDataHighJump.TRheemImpCustomer]. Caused by com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'DUAL'.. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. Invalid object name 'DUAL'. 208".
Any help on this is highly appreciated.
Thanks,
SwamiHi Vivek,
I am able to do other operations such as select and update in the SQL server DB. Only insert is giving such a kind of exception. -
FM to update or insert master data?
Hi Brothers,
I am looking for a FM that updates or inserts master data by a given structure.
I mean something like that:
DATA: table_to_update TYPE some_table.
LOOP thru table INTO structure.
CALL METHOD fm_i_am_looking_for
EXPORTING
infoobject_name = 'my_io'
struc_to_update = structure.
ENDLOOP.
FM should then update the values in structure
Thanks, JohannesHi,
for updating attributes you can also use FM RSNDI_MD_ATTRIBUTES_UPDATE.
check: http://help.sap.com/saphelp_nw2004s/helpdata/en/44/bd9b2916fd08cfe10000000a155369/content.htm
excample call:
Re: Adding Master data Via ABAP -
When I insert the date into a document, Pages actually inserts the day and date, as in "Monday, November 24, 2008." I only want the date, as in "November 24, 2008." I have tried to change the formatting in the International section of System Preferences, but nothing changes. I have looked in various help areas, but have found nothing. Does anyone have a suggestion to change the default?
Thanks, PaulPaul,
Sorry, I didn't catch in your original post that you already knew the standard method for setting the Date Format. I am not aware of any global default preference for this feature.
Here's a workaround that may help in some circumstances. If you have so many instances of the date in each document that it is burdensome to set the format on each, you could set the preferred format on the first instance and then after that use 'ddd' or some other unique code for the rest of the instances. Upon completion of the document you would then do a Find (ddd) and Replace All (Formatted Date). Dates entered this way can't be set to auto-update.
Jerry
Maybe you are looking for
-
ITunes movie freezes and skips with VGA out to projector
Hi, I have rented several movies on iTunes and can watch them onscreen no problem. When I used the VGA dongle to source the screen to an external projector, however, the movie gradually began to skip and freeze, with up to half a second pause between
-
IME 7.0 not generating a report
Hi We have a 7.0 IME installed in a 32 bit Win2k3 server. I am managing 2 IPS 4240 appliance in my IME. It is used to be 6.2 and I upgrade it to 7.0 because I upgrade our IPS. There is no error showing or disconnection. In the event monitoring I can
-
Exporting Prem Proj from AE gives an error when importing
When I export a .prproj from After Effects and then open it in Premiere, I get this puzzling error. Everything seems fine enough. But I can't find any reference to "desktop mode" in the Adobe help. Using CS5 of both versions and not using dynamic lin
-
Downloaded update 10.5.6 restarted to install it and it got stuck
I downloaded the lastupdate then restarted my machine for the update to install then it just got stuck and nothing happens, i have to force shutdown for my computer to work, and everytime y try to restart it for the update to work it does the same th
-
Yesterday i've installed the 10.6.7 update of Mac Osx and my audio has gone. The only way that i can hear a thing it's with headphones...