How to POST operation or Save data to a database in Siena
Hi,
Can anyone help us with guiding how to call a REST operation to POST data to the database when the user clicks the Save button.
There is very little information on REST services and we were only able to find how to get data but nothing on how to POST.
Thanks,
ESI Team
Hi,
POST functions can be called like any other functions inside Siena. For example, if your service has a SendData function, you can call it on the OnSelect of a button.
In the WADL file that describes the services, you will need to specify it is a POST function:
<resources
base="http://www.MyService.Com/Http.svc/
">
<resource
path="SendData">
<method
name="POST"
id="SendData">
</method>
</resource>
</resources>
For more information on WADL creation, please refer to
this article.
Similar Messages
-
How to save data to access database in dreamweaver
Hello,
I want to save data from webpage to MS access database. I am
using dreamweaver MX 2004 developing tool. For server side
scripting I am using asp page but I am not geting any result. And I
am calling this asp page using HTML codes (using "action").
Please anybody suggest me proper way for this.Thanks for the reply....I'will try your suggestion
........But still I will appriciate if you can check my codes......
I am using following codes for webpages,
<form name="form1" action="add_to_database.asp"
method="post">
<div align="center">
<table width="80%" border="0">
<td><b>FEEDBACK FORM</b></td>
<tr> <td>Name :</td>
<td><input type="text" name="uname"></td>
</tr>
<tr>
<td>Email :</td>
<td> <input type="text" name="email"></td>
</tr>
<tr>
<td>Comments :</td>
<td><textarea
name="comments"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Submit details"
name="submit" onClick="validate()" ></td>
</tr>
</table>
</div>
</form>
and using the action and post method I am calling following
asp page
<body>
<%
Dim uname, email, comments
Dim Conn
Dim Rs
Dim sql
uname = Request.Form("uname")
email = Request.Form("email")
comments =Request.Form("comments")
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=" & Server.MapPath("users.accdb")
sql= "INSERT into adduser(uName, Email, Comments) values(' "
& uname & "', '" & email & "', '" & comments
Conn.execute sql
Rs.Open sql, Conn
Rs.AddNew
Rs.Fields("Name") = Request.Form("name")
Rs.Fields("Email")=Request.Form("email")
Rs.Fields("Comments") = Request.Form("comments")
Rs.Update
Rs.Close
Set Rs = Nothing
Set Conn = Nothing
%>
</body>
Thanks, -
How to avoid user to save data on Desktop or My Documents
Hi Everyone.....
I want to apply a policy in which user cannot able to save his data on their desktop or in my documents. I tried Folder Redirection policy through GPO. In this policy save data of desktop Or of My Documents redirect to on specified path but the original
data didn't get deleted from its location. I just want that user should not able to save his data on their desktop or in My documents or if they save data then it should be moved to another specified location & gets deleted from their original location.
Kindly provide suggestion to my problem.Hi,
You erroneously posted your question in the Project Server forum which is dedicated to the Microsoft enterprise scheduling and planning application.
Please post it to the right forum in order to have appropriate help, starting from here:
https://social.technet.microsoft.com/Forums/en-US/home?forum=whatforum
In addition, here are a few links about GPO:
https://technet.microsoft.com/en-us/library/dn265973.aspx
https://technet.microsoft.com/en-us/library/cc753298.aspx
Hope this helps,
Guillaume Rouyre, MBA, MVP, P-Seller | -
How to move only subset of data from one database to another?
Both source & destination are Oracle11g databases.
The requirement details are as below,
1) The database contains static as well as transactional data for telecom domain.
2) We have to move region-wise data from one database to another.
3) There are around 10 regions.
4) The region wise data extraction from source db is based on around 40 to 50 tables. Rest of the tables contains
static data & it will not change.
5) The volume is around 1 million subscribers per region.
6) The migration is required because
a) The client is upgrading its base product which uses this database
b) There is a change in structure of static tables
c) Hardware upgrade
d) The client want to start with single region on new database & rest of the regions will be operated from old
database.
7) Keep execution time to very minimum.
I am thinking to have solution as below,
1) Create destination database with upgraded db structure (as mentioned in 6b)
2) Create database links to access source db in destination db.
3) Write SQL queries to fetch data from all the respective tables for a specific region
4) Write separate PL/SQL blocks for each table to fetch data from source db & insert into respective table in
destination db
a) Use FOR ALL & bulk collect to improve the performance
b) Divide table data into multiple chunks & execute parallel batches (around 10) to insert the data
5) Validate pre & post counts to verify the success of migration
Is there any other better way?
Regards,
SandeepHow to move only subset of data from a partiular table by using transportable tablespace?
E.g. SUB table using SMP_SUB tablespace contains subscriber data in source database.
The indexes defined on SUB table are under SMP_IDX_SUB tablespace
The subscribers data can be categorized by different regions, say region_id column. Then how to move data & indexes of SUB table from source db to destination db?
any specific example would be helpful. -
I have a table where various dates are shown in non-editable fields.For every row there is an edit button,clicking which the data from that particular row passes to the next page.The data is pre-populated in the textfields out there.
I have used request bean properties to pass data from one page to another.
There is no date property,so I have passes all my dates as string properties.By using the string properties,I can get prepopulated dates in my text fields on the other page,where the user can change them.But how to save the dates in oracle database.I tried using java.sql.date also,but with no success.
Any help will be appreciated.
Thaks in advanceYou could create a property and bind that toy your text field. In that property you can do the appropriate conversion
Here is an example code you could try
public String getDate(){
java.sql.Date date = getValue("#{currentRow.value['TRIP.DEPDATE']}");
// return the date converted to string
public void setDate(String date){
java.sql.Date date = // convert String to date here
return setValue("#{currentRow.value['TRIP.DEPDATE']}", date);
}- Winston
http://blogs.sun.com/roller/page/winston?catname=Creator -
How to capture user name and date in the database
How to capture the person name who edits the application and the date of edit in the database...
PallaviHi
There are substitution strings you can use for this purpose.
1.APP_USER ------is the current user running the application
2.SYSDATE --------represents the current date on the database server
APP_USER Syntax
Bind variable------ :APP_USER
PL/SQL------- V('APP_USER')
Substitution string---------- &APP_USER.
SYSDATE_YYYYMMDD Syntax
Bind variable------- :SYSDATE_YYYYMMDD
Direct PL/SQL------- APEX_APPLICATION.G_SYSDATE (DATE DATATYPE)
PL/SQL-------- V('SYSDATE_YYYYMMDD')
Your application will be based on a table with primary key column. You create a 'before update trigger' on that table and add columns 'UPDATED_ON' and 'UPDATED_BY' to that table. Add the following to that trigger:
:NEW.UPDATED_ON := SYSDATE;
SELECT V('APP_USER') INTO :NEW.UPDATED_BY FROM DUAL;
-Priyanka -
HOW TO TRANSFER USER DEFINED TABLE DATA IN NEW DATABASE
Dear all , I am trying to transfer user defined table data,in new database ,can you please tell how i can do it
Thanks for Quick responce
I have Following databases
1) Targate Database EOU TEST
2) Source database STI_BLANK
Table @MACHINE
I tried But it has some error
INSERT INTO EOU TEST.@MACHINE
SELECT STI_BLANK.@MACHINE* FROM STI_BLANK.@MACHINE
Edited by: Abhijit Bhise on Apr 1, 2010 3:27 PM
Edited by: Abhijit Bhise on Apr 1, 2010 3:28 PM -
How to save data in DB2 database
Hi All,
I have an SAP webdynpro application in which 10 fields are there for the user to enter. Out this 10 fields i need to save 5 fields in SAP database and another 5 in DB2 database.Please help me how to achieve this.
Regards
VEnk@Dear Venkat,
Am I right that your requirement is to save some fields into the SAP DB2 database and to save the other fields
to an external DB2 database.
For that you have to setup the connection with transaction DBCO (tabel DBCON),
For details about "how to..." please refer to sap note 323151.
Hope this will help you.
Regards,
Reinhard Meixner -
How to add an array of data in Citadel database
I have an array of data which I want to directly put it in the Citadel Database. Normally the write tag VI writes one value at a time. How can this be done ?
It depends on what you really want. Could you be a little more specific? Does each point have its own separate timestamp? If so, you could simply put the "Write Tag.VI" inside a FOR LOOP and insert values one after another. This would give a separate timestamp to each value. I have attached a simple VI that shows how to do this.
Or are you looking to record some type of vector, where you log a complete array of data at each interval? I don't think this is possible (I'm using DSC 6.02) unless the data-type is a bit-array, in which case you would simply use "Write Data (bit array).vi".
Another option, depending on what you are aiming for, would be to create your own "VI-based Device Server" and use the VIs on the palette submenu call
ed "DSC Server Development". With your own Device Driver you can write multiple datapoints to the input queue simultaneuosly. In this way, you can write more than one point at a time... but that doesn't mean that each time interval will contain an array of data. Assuming that the data is analog, the data will still be logged to Citadel "one after another" so that when you look at it with the HTV, you will see one curve of analog values.
Attachments:
Write_array_to_citadel.vi 17 KB -
Error when save date in SQL database
Hi all,
I try to save a date in to a sql database, but when I run my program I get following error:
Invalid object 11/21/05 9:32 AM of type java.sql.Date assigned to host variable 3.
In my database table I have a fields date (type Data)en time type(Time).
this is the source:
public void createTitle(int title_id, String description, String user)
throws SQLException {
// TODO Auto-generated method stub
Date date = new Date();
String dateFormat = "YYYY-MM-DD";
String timeFormat = "HH:mm:ss";
SimpleDateFormat ddf = new SimpleDateFormat(dateFormat);
SimpleDateFormat tdf = new SimpleDateFormat(timeFormat);
String det = ddf.format(date);
String creationTime = tdf.format(date);
PreparedStatement newTitle = conn.prepareStatement("INSERT INTO BE_TITLE (TITLE_ID, DESCRIPTION, DATE_CREATE, TIME_CREATE, USER_CREATE) VALUES (?,?,?,?,?)");
try{
newTitle.setInt(1,title_id);
newTitle.setString(2,description);
newTitle.setDate(3, new java.sql.Date(date.getTime()));
newTitle.setTime(4, new java.sql.Time(date.getTime()));
newTitle.setString(5, user);
newTitle.executeUpdate();
}finally{
newTitle.close();
Can someone give me a solution for this error
RichardHi Richard,
in your application, you atempt to insert a java.sql.Date value into a DATE column, which has non-zero time-components. Open SQL rejects such an atempt.
Please allow me to quote from the OSS message (452727 2004), which Detlev refers to in his quote:
<i>
about one year ago, we had a very lengthy discussion on this issue - not only internally at SAP but also with Jonathan Bruce, the specification lead for JBDC at Sun.
We have the following dillema:
The javadoc of the constructor java.sql.Date(long) states:
"If the given milliseconds value contains time information, the driver will set the time components to the time in the default time zone (the time zone of the Java virtual machine running the application) that corresponds to zero GMT."
With Jonathan Bruce, we tried to clarify when this normalization should take place.
1) Source code inspection shows that it is not the class java.sql.Date the performs the normalization.
2) The Javadoc states that the JDBC driver should perform the
normalization. If it is the driver, more open questions arrise:
a) When shall the normalization be performed?
- if a setDate method is invoked?
- only for INSERT and update statements or also for all other parameters?
- shall the getDate method perform the normalization?
- what about set/getObject?
- the java Docs of set/getDate don't tell anything about normalization.
- according to which time zone shall the value be normalized?
- UTC
- vm time zone?
- database time zone?
3) If an automatic normalization is performed, data will be modified upon insertion (or extraction) from the database. This means that we cannot quarantee if we insert and Date object retrieve it again that the two objects will be equal.
In the discussion with Jonathan, we couldn't clarify the issue. However, Jonathan promised that the JDK should be modified in such a way that the JDK is responsible for the normalization. (So far such a change has not been done).
In order to be on the safe side, SAP chose that Open SQL should reject any Date values that are not normalized. This is what we have
implemented and documented. I agree, that in this repect, Open SQL is stricter than the JDBC standard demands.
To help the application with the task to normalize a Date (and Time) object, we offer the helper class
com.sap.sql.DateTimeNormalizer which you find in opensql.jar.
To come to a conclusion, the bevavoir you observed is from our side not a bug of Open SQL but a feature. Please use DateTimeNormalizer to normalize Date objects appropriately.
</i>
I hope, you can follow our reasoning.
Best regards,
Adrian -
How to retrieve the doc format data from the database?
Hi Experts,
I need to retrieve the doc files ( Cv's) from data base to my presentation server. In order to do that what is the field I can use?You can use officecontrol UI element for displaying doc files.
below are some important links
[Office Control|http://help.sap.com/saphelp_nw04/helpdata/en/5d/a0b16a9d2e4e4d8b2322af6728263f/content.htm]
[example|http://help.sap.com/saphelp_srm40/helpdata/ru/ef/3483789514b748b6fe1f145e9685ab/content.htm]
thanks
sarbjeet singh -
How to get Operating System Space Info from Oracle database using SQL
Our oracle databases are installed on Unix operating system. Currently our DBA wrote a view to get space info of table spaces and He is requesting me to add Operating system level(file system) drive space info to the same report.
Can you please let me know the easiest way to get this information to sql table so that it can be used for reporting purposes?You should be able to create a shell script with the OS commands to generate the information for the mount points that you want to access in Oracle, then read it in as an external table using the preprocessor feature of external tables:
http://download.oracle.com/otndocs/products/database/enterprise_edition/utilities/pdf/xtables_preproc11g_1009.pdf -
How to load my tree with data from SQL database????
Hello friends
May i know how i can load my tree with my database??
i have 3 different tables and i need them to be the 3 main nodes of my tree
They are
1.fiche
2.amis and
3.famille
and in each of these nodes need to load the 3 databases
thank u in advanceHeres my program so i loaded my vector ,
Now how can i integrate the coding u gave me, and where ??
Is it where i put the quetion mark?
if so
can you tell me how?? because i didnt understood well the codings you gave me as im nt at all familiar with this
Thank you in advance
public class carnetf extends javax.swing.JFrame {
DefaultMutableTreeNode root =null;
public carnetf() {
root= new DefaultMutableTreeNode("Carnet");
DefaultMutableTreeNode tnFiche=new DefaultMutableTreeNode("Fiche");
root.add( tnFiche);
DefaultMutableTreeNode tnAmis=new DefaultMutableTreeNode("Amis");
root.add( tnAmis);
DefaultMutableTreeNode tnFamille=new DefaultMutableTreeNode("Famille");
root.add( tnFamille);
initComponents();
public Vector vecfiche() {
Vector v = new Vector();
Connection connection = null;
try
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());;
catch (Exception E)
System.out.println("Unable to load driver.");
System.out.println(E.getMessage());
E.printStackTrace();
return null;
try
connection = DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433;user=sa;password=sa;DatabaseName=carnet");
catch (Exception E)
System.out.println("Unable to connect.");
System.out.println(E.getMessage());
return null;
try
Statement Stmt = connection.createStatement();
if(jRadioButton1.isSelected()==true)
String Query = "SELECT * FROM fiche";
ResultSet RS= Stmt.executeQuery( Query );
while ( RS.next())
v.add( new vecfiche( RS.getString("Nom"), RS.getString("Prenom")));
if( RS!= null) RS.close();}
if(jRadioButton2.isSelected()==true)
String Query = "SELECT * FROM amis";
ResultSet RS= Stmt.executeQuery( Query );
while ( RS.next())
v.add( new vecfiche( RS.getString("Anom"), RS.getString("Aprenom")));
if( RS!= null) RS.close();}
if(jRadioButton3.isSelected()==true)
String Query = "SELECT * FROM famille";
ResultSet RS= Stmt.executeQuery( Query );
while ( RS.next())
v.add( new vecfiche( RS.getString("Fnom"), RS.getString("Fprenom")));
if( RS!= null) RS.close();}
if( Stmt!= null) Stmt.close();
catch (Exception E)
System.out.println("Unable to query.");
System.out.println(E.getMessage());
return null;
try
connection.close();
} catch (Exception E)
System.out.println("Unable to close.");
System.out.println(E.getMessage());
return null;
return v;
} -
How to save datas automaticly making use of SQL Toolkit ?
Hello !
I have amounts of datas to be saved automaticly,so I want to use database.I've registered ODBC data source in my computer.
As the test datas are saved automaticly,I only write a function to save the datas into database.
//write datas into database
void WriteYBdata(char* FileName)
char *time1;
char *date1;
char date[27];
int hstmt,id,status;
date1 = DateStr ();
time1 = TimeStr ();
Fmt(date,"%s<%d[w4p0]/%d[w2p0]/%d[w2p0]",date1,time1);
hstmt = DBActivateSQL (hdbc, "SELECT * FROM ybdata");
DBBindColInt (hstmt, 1, &id, &status);
DBBindColChar (hstmt, 2, 27, date, &status, "");
DBBindColFloat (hstmt, 3, &CH4, &status);
DBBindColFloat (hstmt, 4, &CO2, &status);
DBBindColFloat (hstmt, 5, &O2, &status);
DBBindColFloat (hstmt, 6, &CO, &status);
DBBindColFloat (hstmt, 7, &H2S, &status);
DBBindColInt (hstmt, 8, &TEM, &status);
DBBindColInt (hstmt, 9, &HUM, &status);
DBCreateRecord(hstmt);
DBPutRecord(hstmt);
DBDeactivateSQL(hstmt);
void WritePSMdata(char* FileName)
char *time2;
char *date2;
char date[27];
int hstmt,id,status;
date2 = DateStr ();
time2 = TimeStr ();
Fmt(date,"%s<%d[w4p0]/%d[w2p0]/%d[w2p0]",date2,time2);
hstmt = DBActivateSQL (hdbc, "SELECT * FROM psmdata");
DBBindColInt (hstmt, 1, &id, &status);
DBBindColChar (hstmt, 2, 27, date, &status, "");
DBBindColInt (hstmt, 3, &wy_voltage,&status);
DBBindColFloat (hstmt, 4, &zy_y1, &status);
DBBindColFloat (hstmt, 5, &zl_i1, &status);
DBBindColInt (hstmt, 6, &wx, &status);
DBBindColInt (hstmt, 7, &wg, &status);
DBBindColInt (hstmt, 8, &ws, &status);
DBCreateRecord(hstmt);
DBPutRecord(hstmt);
DBDeactivateSQL(hstmt);
I connect the database in the main function.
I've been debug the program and it communicates normally, but it does not save datas into the database.
The attachment is my program.It is my first time to use SQL Toolkit and I'm not familiar with it. I would appreciate it very much if you could give me some help..
Best regards.
xiepei
I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.
Attachments:
Sava All Data.zip 37 KBHi !
Thank you very much for your reply.
That line I want to set the time format and it could use the funtion
DBBindColChar (hstmt, 2, 27, date, &status, "");
I do not know it is right or wrong.I could not see any response in this line.
My original idea is recording the date and time when saving the datas.
Would you have any good idea according to it ?
I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance. -
How to Drop all data in a database?
Hi There,
I'm use to dropping all the objects in a database, however, how do I drop ONLY the DATA in the database? Is all data in the database stored in tables? Do I have to TRUNCATE all the tables in the database only? Thanks in advanced.
JYou can try to:
1. disable foreign key constraints instead of dropping them.
2. truncate all tables in any order
3. enable foreign key constraints.
Short example:
SQL> truncate table parent;
truncate table parent
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
SQL> select constraint_name, table_name from user_constraints where r_constraint_name is not null;
CONSTRAINT_NAME TABLE_NAME
SYS_C0011060 CHILD
JHIST_JOB_FK JOB_HISTORY
JHIST_EMP_FK JOB_HISTORY
JHIST_DEPT_FK JOB_HISTORY
EMP_DEPT_FK EMPLOYEES
EMP_JOB_FK EMPLOYEES
EMP_MANAGER_FK EMPLOYEES
DEPT_LOC_FK DEPARTMENTS
DEPT_MGR_FK DEPARTMENTS
LOC_C_ID_FK LOCATIONS
COUNTR_REG_FK COUNTRIES
11 rows selected.
SQL> alter table child disable constraint sys_c0011060;
Table altered.
SQL> truncate table parent;
Table truncated.
SQL> truncate table child;
Table truncated.
SQL> alter table child enable constraint sys_c0011060;
Table altered.
SQL>
Maybe you are looking for
-
Problem w/New MacbookPro, Cinema 30, Mini DisplayPort to Dual-Link DVI Adap
Hi, I have a new MacBook Pro with Miniport connected to a Cinema 30 using the Mini DisplayPort to Dual-Link DVI Adapter. I upgraded from the previous version of the Macbook Pro w/built-in DVI and never had a problem. From the moment I started using t
-
hI, Can any one tell me in MB5B( stock on posting date) . at the time of posting stock system increasing amount in local currency. I want to know that how & from where system this value is picking? regards Manoj..
-
XML URL Links - Issue diff to pervious post!
Please can someone help. I'm new to xml and flash and have worked through the following tutorial: http://www.kirupa.com/developer/actionscript/xmldataflash2.htm I now want to add a link so for example I want <name>Thomas Edison</name> the name to be
-
we are having large data nearly about 10k so it is very tedious to create relationships in data manager. can anyone please tell us the proper way of importing relationships through data manger and also specify the changes we are suppose to make in th
-
SAML, XML Dsig and XML signature
Hi Every one, Is it possible to encrypt <b>only the part of the XML document and apply the XML Digital signature to the encrypted part</b> by using the SAP Crypto Toolkit? How to implement SAML (assertions) in the SAP WAS640 systems? Thank you Bhaska