Database toolkit - stored procedure doesn't work in labview
Hello,
I have written simple procedure that works good when I run it from workbench but doesn't work from labview. I want to insert some data and get primary key of inserted id:
CREATE DEFINER=`root`@`localhost` PROCEDURE `new_procedure`(
IN emp_id_val int,
IN project_id_val int,
IN work_mode_val int)
BEGIN
insert into work_managment.sessions (emp_id,project_id,work_mode)
values (11,1,1);
SELECT LAST_INSERT_ID();
END
and why that doesn't work when I call it from labview?
when i replace last inserted id with:
select max(session_id) as session from work_managment.sessions;
it works good in labview
What could be the problem??
It could be that there is something screwy with LV, but given that it uses standard interfaces for comm with the DBMS, I would not expect that. A much more realistic possibility is that the toolkit is mucking things up. (A fairly common occurrence.)
Try bypassing the toolbox -- which you don't really need anyway -- an talk directly to the ActiveX or .net interface.
Also, what DBMS? What drivers are you using?
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
Similar Messages
-
Master-Detail with 2 blocks based in stored procedure doesn't work.
Hi. I'm Oscar and I'm new for here.
I have a problem that i can't find the correct answer to solve it.
Well. I've created a form with 2 blocks. Both of them have the Query Data Source Type Property to "Procedure", and both procedures on database returns one ref cursor of a record type each one.
BLOCK BL_COMPETICIONES --> query data source: p_get_competiciones (p_Cursor is cursor of record (CODIGO NUMBER,
NOMBRE VARCHAR2(50),
SETCRICKETSN VARCHAR2(1),
SET01SN VARCHAR2(1),
FECHAINICIO DATE,
FECHAFIN DATE).
On triggers (on-lock, on-insert, on-delete and on-update) I have the call to the corresponding stored procedure to lock, insert, delete or update.
Well, when i've only this block in form, the form works correctly.
But when I added a second block (which is suppossed to be a detailed data from the first one), and after I've assigned the query procedure and created the relation between both blocks, then run the form and try to execute query on first block, returning records correctly, but then, when execution goes to the program unit "query_master_details", the sentence "execute query" doesn't do anything (and the cursor is in the detailed block), so detailed block continues to be without records.
I don't know how to solve this. Someone can help me, please?. Thanks.
Edited by: user5067020 on 09-abr-2009 16:38It could be that there is something screwy with LV, but given that it uses standard interfaces for comm with the DBMS, I would not expect that. A much more realistic possibility is that the toolkit is mucking things up. (A fairly common occurrence.)
Try bypassing the toolbox -- which you don't really need anyway -- an talk directly to the ActiveX or .net interface.
Also, what DBMS? What drivers are you using?
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
Database toolkit stored procedure return String
Hi all,
How I can return the entire string from my stored procedure using the attached code ?
With this code I only retrive the first caractere of the string return by the stored procedure.
Thanks for your help.
MHPIt could be that there is something screwy with LV, but given that it uses standard interfaces for comm with the DBMS, I would not expect that. A much more realistic possibility is that the toolkit is mucking things up. (A fairly common occurrence.)
Try bypassing the toolbox -- which you don't really need anyway -- an talk directly to the ActiveX or .net interface.
Also, what DBMS? What drivers are you using?
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
Could I export and import my oracle database via Stored Procedure???
Hi all,
I need to export my database using stored procedure, the stored procedure will be called by java application and it works well
Now I still get the "BIG QUESTION", could I export and import database using stored procedure???
Really thanks for the response.
Regards,
KahlilHi,
I think you can use DBMS_DATAPUMP (10.1+), see [DBMS_DATAPUMP|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_datpmp.htm#i1007277], for examples see [http://www.psoug.org/reference/dbms_datapump.html]
Regards, -
Sending Long Raw Data to Oracle database through Stored Procedure
Hi,
I am trying to push data to Oracle 9i database through Stored Procedure via thin driver. It is going smoothly upto 29411 bytes. But it is not accepting for 53843 bytes and giving following error :
java.sql.SQLException: Data size bigger than max size for this type: 53843
Is it thin driver limitation? Can I solve it by using OCI driver? Or is there any other approach?
I tried creating connection pool in weblogic 7.0 through OCI driver. But I am not able to configure it. Is there any special way of configuration.
Quick response will be greatly appreciated.
Thanks
SanjivIt happens to me. But I am using CMP of Weblogic 7. If you write your own jdbc code, the following link may be helpful.
http://otn.oracle.com/sample_code/tech/java/codesnippet/xmldb/HowToLoadLargeXML.html -
Open other database in stored procedure
Hi All,
Im going to open other database in stored procedure.
Can anyone help me? ThanksYou cannot open or connect in plsql procedure, but can use database link.
Documents:
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14231/ds_admin.htm#ADMIN029
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_5005.htm#i2061505
Message was edited by:
ushitaki -
Hi,
I have a problem to transfer a XML file content to a MS SQL database by a given/fixed stored procedure. I'm able to transfer the content of the file by using following method ...
hstmt = DBPrepareSQL (hdbc, EXEC usp_InsertReport '<Report> ..... </Report>');
resCode = DBExecutePreparedSQL (hstmt);
resCode = DBClosePreparedSQL (hstmt);
... but in this case I'm not able to fetch the return value of the stored procedure!
I have tried to follow the example of the stored procedure in the help documentation (DBPrepareSQL) but I miss a datatype for xml?!?
Any idea how to solve my problem?
KR Cake
Solved!
Go to Solution.After some additional trials I found a solution by calling the stored procedure in this way
DBSetAttributeDefault (hdbc, ATTR_DB_COMMAND_TYPE, DB_COMMAND_STORED_PROC);
DBPrepareSQL (hdbc, "usp_InsertReport");
DBCreateParamInt (hstmt, "", DB_PARAM_RETURN_VALUE, -1);
DBCreateParamChar (hstmt, "XMLCONTENT", DB_PARAM_INPUT, sz_Buffer, (int) strlen(sz_Buffer) + 1 );
DBExecutePreparedSQL (hstmt);
DBClosePreparedSQL (hstmt);
DBGetParamInt (hstmt, 1, &s32_TestId);
where sz_Buffer is my xml file content and s32_TestID the return value of the stored procdure (usp_InsertReport(@XMLCONTENT XML))
Now I face the problem, that DBCreateParamChar limits the buffer size to 8000 Bytes.
Any idea to by-pass this shortage?? -
Is BC4J a viabl option for database with stored procedure (ref cursor) API?
I'm about to begin a Web application development project. As foundation, we have a (Oracle) database of certain complexity that have a data access API developed with PL/SQL packages.
This API is designed to get data through stored procedures/functions that return REF CURSOR.
Personally I have been investigating about Oracle ADF/JSF, and a number of others J2EE technologies, and at this moment I am doubting if ADF BC are a viable option to my development team.
I think this because I have noticed that one of the great drawback in ADF BC is the lack of simplicity to get data through stored procedures/functions that returns REF CURSORS.
I have been looking for documentation and the only thing that I have found are two examples:
1.- One that really do not work (fails in get data from ref cursor): ADF BC StoredProcedure Sample application.
2.- And other published by Steve Muench in
http://radio.weblogs.com/0118231/stories/2003/03/03/gettingAViewObjectsResultRowsFromARefCursor.html. This sample works fine.
But, the problem with the approach of this last article is the amount (and complexity) of the code necessary to make so basic and recurrent operation as is "obtain data through a stored procedure (ref cursor)".
Below it is the code that I have constructed to call a function that returns a ref cursor (based on steve's article).
If this is the only way to make this (historically so basic and simple) task, then it is obvious that BC is not a viable technology to my (or I am in a mistake?), since we have about 50 stored procedures/functions to access the underlying data; that stored procedures/functions are key to development of the new application (and, still more, currently are used to anothers apps ).
By all this, I would like consult to Oracle's people:
1.- I really must reject BC as technology to implement this project ?
2.- It is possible to access stored procedures in a simpler way using BC?
3.- If the answer to 2 is NOT: in near future, the BC team has plans to give more support to the simple access to stored procedures?
4.- If the answer to 3 is NOT: what another technology you recommend to construct my data access/business tier and still be able to using the others characteristics of ADF?
Thank you very much for your guidelines.
Regards, RL.
** And the code!!!
** ### I am forced to do this for each call to a procedure???? ###
package myrefcursor.model;
import java.math.BigDecimal;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Types;
import oracle.jbo.JboException;
import oracle.jbo.domain.NullValue;
import oracle.jbo.domain.Number;
import oracle.jbo.server.DBTransaction;
import oracle.jbo.server.ViewObjectImpl;
import oracle.jbo.server.ViewRowImpl;
import oracle.jbo.server.ViewRowSetImpl;
import oracle.jdbc.driver.OracleCallableStatement;
import oracle.jdbc.driver.OracleTypes;
public class TraePolizasViewImpl extends ViewObjectImpl {
private static final String SQL = "begin ? := PKG_PRUEBA.trae_polizas(?);end;";
private static final String COUNTSQL = "begin ? := PKG_PRUEBA.count_trae_polizas(?);end;";
public TraePolizasViewImpl() {
protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
BigDecimal rut_contratante = null;
Object[] theUserParam = null;
System.out.println(params);
System.out.println(params[0]);
if (params != null)
theUserParam = (Object[]) params[0];
//if (theUserParam != null && theUserParam.length > 0 )
if (! (theUserParam[1] instanceof NullValue) )
rut_contratante = (BigDecimal)theUserParam[1];
storeNewResultSet(qc ,retrieveRefCursor(qc, rut_contratante));
super.executeQueryForCollection(qc, params, numUserParams);
protected void create() {
getViewDef().setQuery(null);
getViewDef().setSelectClause(null);
setQuery(null);
protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
rs = getResultSet(qc);
ViewRowImpl r = createNewRowForCollection(qc);
try {
populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
populateAttributeForRow(r,1, rs.getString(2));
catch (SQLException s) {
throw new JboException(s);
return r;
protected boolean hasNextForCollection(Object qc) {
ResultSet rs = getResultSet(qc);
boolean nextOne = false;
try {
nextOne = rs.next();
if (!nextOne) {
setFetchCompleteForCollection(qc, true);
rs.close();
catch (SQLException s) {
throw new JboException(s);
return nextOne;
protected void releaseUserDataForCollection(Object qc, Object rs) {
ResultSet userDataRS = getResultSet(qc);
if (userDataRS != null) {
try { userDataRS.close(); }
catch (SQLException s) { ; }
super.releaseUserDataForCollection(qc, rs);
public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
return viewRowSet.getRowCount();
private ResultSet retrieveRefCursor(Object qc, BigDecimal rut_contratante) {
CallableStatement st = null;
try {
st = getDBTransaction().createCallableStatement(SQL, DBTransaction.DEFAULT);
st.registerOutParameter(1,OracleTypes.CURSOR);
if (rut_contratante == null)
st.setNull(2, Types.NUMERIC);
else
st.setBigDecimal(2, rut_contratante);
st.execute();
ResultSet rs = ((OracleCallableStatement)st).getCursor(1);
rs.setFetchSize(getFetchSize());
return rs ;
catch (SQLException s) {
throw new JboException(s);
finally {try {st.close();} catch (SQLException s) {;}}
private void storeNewResultSet(Object qc, ResultSet rs) {
ResultSet existingRs = getResultSet(qc);
if (existingRs != null) {
try {existingRs.close();} catch (SQLException s) {;}
setUserDataForCollection(qc,rs);
hasNextForCollection(qc); // Prime the pump with the first row.
private ResultSet getResultSet(Object qc) {
return (ResultSet)getUserDataForCollection(qc);
private static Number nullOrNewNumber(BigDecimal b) {
try {
return b != null ? new Number(b) : null;
catch (SQLException s) { ; }
return null;
public BigDecimal getprutcontratante() {
return (BigDecimal)getNamedWhereClauseParam("prutcontratante");
public void setprutcontratante(BigDecimal value) {
setNamedWhereClauseParam("prutcontratante", value);
}no?
-
Modified Stored Procedure Doesn't Refresh In Report
Hello --
I modified a stored procedure to add a new table and field. The new field doesn't show up in the field explorer after selecting "Verify Database". If I create a new report with the stored procedure, the new field appears as expected. Any ideas?
Thanks,
BobHi Bob,
Odd, Try adding a field or removing a field and then verify again.
You could try logging onto the database first and then open the report and set location to the DB and then verify.
Thank you
Don -
I create a procedure in the schema, and I create a form manually with html whose action calls this procedure, such like this:
<form action="!MYORACLE_DATA.IPORTAL_POLL.update_poll" method="post">
When I click submit, such error comes out like this:
ORA-06550: line 7, column 2:
PLS-00201: identifier 'MYORACLE_DATA.IPORTAL_POLL' must be declared
ORA-06550: line 7, column 2:
PL/SQL: Statement ignored
Actually, it was working before I tune the database. But I don't think it is the reason cause it doesn't work. Does anybody know solution, thanks in advance.
nullHi,
I tried creating 2 procedures :
TEST1 as follows:
create or replace procedure test1
as
begin
htp.formOpen('portal30.test2');
htp.formtext('ename');
htp.formsubmit;
htp.formclose;
end;
and another TEST2
create or replace procedure TEST2(ename varchar)
as
begin
htp.p('Hello '| |ename);
end;
I grant execute on both this to public and execute this it works fine.
But if I include an '!' before portal30 as U have done "!MYORACLE_DATA.IPORTAL_POLL.update_poll" then it doesn't work.
Please try removing the same .
Hope this helps.
Anu
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Xiaopeng Zhang ([email protected]):
I create a procedure in the schema, and I create a form manually with html whose action calls this procedure, such like this:
<form action=
"!MYORACLE_DATA.IPORTAL_POLL.update_poll" method="post">
When I click submit, such error comes out like this:
ORA-06550: line 7, column 2:
PLS-00201: identifier 'MYORACLE_DATA.IPORTAL_POLL' must be declared
ORA-06550: line 7, column 2:
PL/SQL: Statement ignored
Actually, it was working before I tune the database. But I don't think it is the reason cause it doesn't work. Does anybody know solution, thanks in advance.<HR></BLOCKQUOTE>
null -
Read XML file into databased using stored procedure
I need to read an xml file into my database using a stored procedure. I looked at a couple of tutorials, but I am kind of lost and am looking for some guidance. I will eventually need to only pull a handfull of the data in based on the USER ID. Any help will be greatly appreciated. I have been given a schema file and an example file of how the data will me sent to me. The schema file is below:
<h1>Schema File</h1>
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by Turbo XML 2.4.1.100. Conforms to w3c http://www.w3.org/2001/XMLSchema-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:element name="root">
<xsd:complexType />
</xsd:element>
<xsd:element name="Report">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="Biller" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Biller">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="BillerName" />
<xsd:element ref="BillerIdNumber" />
<xsd:element ref="PartnerInfo" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="BillerName">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="BillerIdNumber">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="PartnerInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="PartnerName" />
<xsd:element ref="PartnerVenderNumber" />
<xsd:element ref="PartnerStreet01" />
<xsd:element ref="PartnerStreet02" />
<xsd:element ref="PartnerCity" />
<xsd:element ref="PartnerState" />
<xsd:element ref="PartnerZip" />
<xsd:element ref="PartnerCountry" />
<xsd:element ref="PartnerActive" />
<xsd:element ref="PartnerContactName" />
<xsd:element ref="PartnerEmailAddress" />
<xsd:element ref="PartnerContactPhone" />
<xsd:element ref="PartnerFaxNumber" />
<xsd:element ref="PartnerUpdateUser" />
<xsd:element ref="PartnerUpdateDate" />
<xsd:element ref="PartnerDocColor" />
<xsd:element ref="PartnerDocDistribution" />
<xsd:element ref="PartnerDocPrinting" />
<xsd:element ref="PartnerDocTiming" />
<xsd:element ref="Delivery" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="PartnerName">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="PartnerVenderNumber">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="PartnerStreet01">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerStreet02">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerCity">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerState">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerZip">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerCountry">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerActive">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerContactName">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerEmailAddress">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerContactPhone">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerFaxNumber">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerUpdateUser">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerUpdateDate">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerDocColor">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerDocDistribution">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerDocPrinting">
<xsd:complexType />
</xsd:element>
<xsd:element name="PartnerDocTiming">
<xsd:complexType />
</xsd:element>
<xsd:element name="Delivery">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="DeliveryType" />
<xsd:element ref="DeliveryContactName" />
<xsd:choice>
<xsd:element ref="ReceivingStreet01" />
<xsd:element ref="ReceivingStreet02" />
<xsd:element ref="ReceivingCity" />
<xsd:element ref="ReceivingState" />
<xsd:element ref="ReceivingZip" />
<xsd:element ref="ReceivingCountry" />
<xsd:element ref="DeliveryEmailAddress" />
<xsd:element ref="DeliveryCompanyId" />
<xsd:element ref="DeliveryUserId" />
<xsd:element ref="DeliveryFormatType" />
<xsd:element ref="SecureType" />
<xsd:element ref="SecureQuestion" />
<xsd:element ref="SecureAnswer" />
<xsd:element ref="DeliveryFaxNumber" />
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DeliveryType">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="DeliveryContactName">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="DeliveryEmailAddress">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="SecureType">
<xsd:complexType />
</xsd:element>
<xsd:element name="SecureQuestion">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="SecureAnswer">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="DeliveryFormatType">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="DeliveryCompanyId">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="DeliveryUserId">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="DeliveryFaxNumber">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="ReceivingStreet01">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="ReceivingStreet02">
<xsd:complexType />
</xsd:element>
<xsd:element name="ReceivingCity">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="ReceivingState">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="ReceivingZip">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
<xsd:element name="ReceivingCountry">
<xsd:complexType mixed="true">
<xsd:choice />
</xsd:complexType>
</xsd:element>
</xsd:schema>
<h1>Example File</h1>
<?xml version="1.0" encoding="utf-8"?>
<Report>
<Biller>
<BillerName>DONATO TEST BILLER</BillerName>
<BillerIdNumber>999999999</BillerIdNumber>
<PartnerInfo>
<PartnerName>TEST TRADING PARTNER</PartnerName>
<PartnerVenderNumber>999999999</PartnerVenderNumber>
<PartnerStreet01 />
<PartnerStreet02 />
<PartnerCity />
<PartnerState />
<PartnerZip />
<PartnerCountry />
<PartnerActive />
<PartnerContactName />
<PartnerEmailAddress />
<PartnerContactPhone />
<PartnerFaxNumber />
<PartnerUpdateUser />
<PartnerUpdateDate />
<PartnerDocColor />
<PartnerDocDistribution />
<PartnerDocPrinting />
<PartnerDocTiming />
<Delivery>
<DeliveryType>EMAIL</DeliveryType>
<DeliveryContactName>Kiran</DeliveryContactName>
<DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
</Delivery>
<Delivery>
<DeliveryType>SECURE</DeliveryType>
<DeliveryContactName />
<DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
<SecureType />
<SecureQuestion>Pet Name</SecureQuestion>
<SecureAnswer>040698de9bf14ef87d8cbaf46b8ecddc</SecureAnswer>
<DeliveryFormatType />
</Delivery>
<Delivery>
<DeliveryType>CEO</DeliveryType>
<DeliveryContactName />
<DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
<DeliveryCompanyId>WFADM618</DeliveryCompanyId>
<DeliveryUserId>PAULSEN</DeliveryUserId>
<DeliveryFormatType />
</Delivery>
<Delivery>
<DeliveryType>FAX</DeliveryType>
<DeliveryContactName>Kiran</DeliveryContactName>
<DeliveryFaxNumber>4807244340</DeliveryFaxNumber>
<DeliveryFormatType>PDF</DeliveryFormatType>
</Delivery>
<Delivery>
<DeliveryType>DOC</DeliveryType>
<DeliveryContactName />
<ReceivingStreet01>2600 South Price Road</ReceivingStreet01>
<ReceivingStreet02 />
<ReceivingCity>Chandler</ReceivingCity>
<ReceivingState>AZ</ReceivingState>
<ReceivingZip>85248</ReceivingZip>
<ReceivingCountry>United States</ReceivingCountry>
</Delivery>
<Delivery>
<DeliveryType>DR</DeliveryType>
<DeliveryContactName />
<DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
<DeliveryCompanyId>WFADM618</DeliveryCompanyId>
<DeliveryUserId>PAULSEN</DeliveryUserId>
<DeliveryFormatType />
</Delivery>
</PartnerInfo>
</Biller>
</Report>Try with a XMLTABLE function
For example to Extract BillerName and BillerID
with t as(select xmltype( '<?xml version="1.0" encoding="utf-8"?>
<Report>
<Biller>
<BillerName>DONATO TEST BILLER</BillerName>
<BillerIdNumber>999999999</BillerIdNumber>
<PartnerInfo>
<PartnerName>TEST TRADING PARTNER</PartnerName>
<PartnerVenderNumber>999999999</PartnerVenderNumber>
<PartnerStreet01 />
<PartnerStreet02 />
<PartnerCity />
<PartnerState />
<PartnerZip />
<PartnerCountry />
<PartnerActive />
<PartnerContactName />
<PartnerEmailAddress />
<PartnerContactPhone />
<PartnerFaxNumber />
<PartnerUpdateUser />
<PartnerUpdateDate />
<PartnerDocColor />
<PartnerDocDistribution />
<PartnerDocPrinting />
<PartnerDocTiming />
<Delivery>
<DeliveryType>EMAIL</DeliveryType>
<DeliveryContactName>Kiran</DeliveryContactName>
<DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
</Delivery>
<Delivery>
<DeliveryType>SECURE</DeliveryType>
<DeliveryContactName />
<DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
<SecureType />
<SecureQuestion>Pet Name</SecureQuestion>
<SecureAnswer>040698de9bf14ef87d8cbaf46b8ecddc</SecureAnswer>
<DeliveryFormatType />
</Delivery>
<Delivery>
<DeliveryType>CEO</DeliveryType>
<DeliveryContactName />
<DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
<DeliveryCompanyId>WFADM618</DeliveryCompanyId>
<DeliveryUserId>PAULSEN</DeliveryUserId>
<DeliveryFormatType />
</Delivery>
<Delivery>
<DeliveryType>FAX</DeliveryType>
<DeliveryContactName>Kiran</DeliveryContactName>
<DeliveryFaxNumber>4807244340</DeliveryFaxNumber>
<DeliveryFormatType>PDF</DeliveryFormatType>
</Delivery>
<Delivery>
<DeliveryType>DOC</DeliveryType>
<DeliveryContactName />
<ReceivingStreet01>2600 South Price Road</ReceivingStreet01>
<ReceivingStreet02 />
<ReceivingCity>Chandler</ReceivingCity>
<ReceivingState>AZ</ReceivingState>
<ReceivingZip>85248</ReceivingZip>
<ReceivingCountry>United States</ReceivingCountry>
</Delivery>
<Delivery>
<DeliveryType>DR</DeliveryType>
<DeliveryContactName />
<DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
<DeliveryCompanyId>WFADM618</DeliveryCompanyId>
<DeliveryUserId>PAULSEN</DeliveryUserId>
<DeliveryFormatType />
</Delivery>
</PartnerInfo>
</Biller>
</Report>')xml from dual)
select q.* from t,xmltable('/Report' passing t.xml columns
BillerName varchar2(20) PATH
'/Report//Biller/BillerName')q
BILLERNAME BILLERID
DONATO TEST BILLER 999999999 -
Stored procedure call not working
I have 2 ms-sql update statement through stored procedures
1) as a batch update
if (vendorBillDetailsDTO != null) {
stmnt =
con.prepareCall(
"Exec usp_CMP_UpdPRDetails ?, ?, ?, ?");
Iterator it = vendorBillDetailsDTO.iterator();
while (it.hasNext()) {
VendorBillDetailsDTO myVendorBillBillDetailsDTO =
(VendorBillDetailsDTO) it.next();
stmnt.setInt(
1,
myVendorBillBillDetailsDTO.getBillDetailRef().intValue());
stmnt.setInt(
2,
myVendorBillBillDetailsDTO.getBillId().intValue());
stmnt.setString(3, myVendorBillBillDetailsDTO.getCRN());
stmnt.setInt(
4,
myVendorBillBillDetailsDTO.getServiceCode().intValue());
stmnt.setString(5, myVendorBillBillDetailsDTO.getPRShortText());
stmnt.addBatch();
//it.next();
} //while
stmnt.executeBatch();
} //if
This block is working perfectly fine and statement is correctly getting executed
2) if (vendorBillHeaderDTO != null) {
stmnt = con.prepareCall(
"Exec usp_CMP_UpdPRHeader ?,?,?");
stmnt.setInt(1, vendorBillHeaderDTO.getBillId().intValue());
stmnt.setString(2, vendorBillHeaderDTO.getBillType());
stmnt.setString(3, vendorBillHeaderDTO.getEstimateReference());
stmnt.executeUpdate();
}//end if
This statement is not getting executed (I have many input parameters like int , timestamp , long , double etc). It is not throwing any error (Even when I enclosed it with try catch theere is no exception thrown .) However in back end record is not getting updated .
Any ideas ?
Please help
NPBWell, that could be a problem in the Data Base side, i suggest you:
1) See the log file of your DB,
2) Run in your DB the Store Procedure, maybe you forget put a commit, and see that of this way you can update the table you can.
Try it.
Regards if helps you
Josué Cruz -
I have SQL login group as "SC_NT\group_name" in server. There are multiple users using this login group to access database objects. User "A" can able to access db object(stored_procedure_1) from .net application. But when user "B"
tried to access same db object(stored_procedure_1), its showing like
Error: The EXECUTE permission was denied on the object 'stored_procedure_1', database 'test',schema 'dbo'.
Both the users are using windows authentication for access the objects. Could you suggest me the way to resolve this?
VenkatThanks for your response
Erland Sommarskog....
my stored procedure "stored_procedure_1"
does not has any granted permissions to execute. But still user A
able to execute the sp from UI, where user B not able to do it. If any permission provided for a particular object, then only it will display in the above query whatever u have given.
Any other possibilities??
Venkat G -
Web form not updating database with stored procedure
Hello
i have a problem with the web form updating the database i have a stored procedure which i need to connect to. If i execute the procedure in the SQL it will update the database but when i run the web form i get my catch error "could not update database".
I have read so much on the net and my code seem ok but i,m just so lost.
stored procedure
PROCEDURE [dbo].[UpdateCustomer]
@ID INT,
@Firstname VARCHAR(30),
@Surname VARCHAR(30),
@Age INT
AS
BEGIN
UPDATE Customer
SET Firstname = @Firstname,
Surname = @Surname,
Age = @Age
WHERE CustID = @ID
END
update code
try
SqlCommand command = new SqlCommand();
command.Connection = conn;
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "UpdateCustomer";
command.Connection.Open();
SqlParameter param = new SqlParameter();
param.ParameterName = "@ID";
param.SqlDbType = SqlDbType.Int;
param.Direction = ParameterDirection.Input;
param.Value = txtCustID.Text;
command.Parameters.Add(param);
command.Parameters.AddWithValue("@CustID", txtCustID.Text.ToString());
command.Parameters.AddWithValue("@Firstname", txtFirstname.Text);
command.Parameters.AddWithValue("@Surname", txtSurname.Text);
command.Parameters.AddWithValue("@Gender", Gender.Text.ToString());
command.Parameters.AddWithValue("@Age" ,txtAge.Text.ToString());
command.Parameters.AddWithValue("@Address1", txtAddress1.Text.ToString());
command.Parameters.AddWithValue("@Address2", txtAddress2.Text.ToString());
command.Parameters.AddWithValue("@City", txtCity.Text.ToString());
command.Parameters.AddWithValue("@Phone", txtPhone.Text.ToString());
command.Parameters.AddWithValue("@Mobile", txtMobile.Text.ToString());
command.Parameters.AddWithValue("@Email", txtEmail.Text.ToString());
command.ExecuteNonQuery();
lblMessage.Text = "Your Record(s) Have been Updated";
command.Connection.Close();
catch
lblMessage.Text = "Your Record was not updated please try again";
Thank you for your helpTo expand on Mike's advice.
Change your catch to:
catch(Exception ex)
{ // Break point here
lblMessage.Text = "Your Record was not updated please try again";
Put a break point in where the comment says.
Run it.
Hover over ex or add a quickwatch ( right click it ) and see what the error and inner exception is.
I see several problems though.
You have way too many parameters and Age should be int.
They are objects - they have a type.
It'll be a string with your code there.
Something more like
command.Parameters.Add("@Age", SqlDbType.Int);
command.Parameters["@Age"].Value = Convert.ToInt32(txtAge.Text);
Although that might not cut and paste, it's air code intended to give you the idea.
Hope that helps.
Technet articles: Uneventful MVVM;
All my Technet Articles -
I follow the procedure according to the web site directions and it doesn't work. Nothing is backed up. When I go to the icloud web site and sign in, nothing is there.
In addition, I got my son an iPad. Because he is under 18 Apple will not let him sign up for an account on the App store (even though I could give him permission and monitor the activity).
I had to use my account information on the App store. The result; account information is confused. I have had to reset the passwords so many times.
Where is tech support? You can't talk to a live person on the phone because Apple will not publish tech support phone numbers. This will be the LAST time I ever purchase and Apple product!Winston,
You are correct in that each should have his own account. But because my son is under 18, he cannot have his own account. I would still be in charge of it and monitor it. I was not going to lie and falsify his birthday. So, Apple would not let me create a separate account for the App Store or iTunes for him.
I am also having issues with iCloud and iTunes and synching my PC with the iPhone. What a PITA!
The words "user friendly" are not in Apple's vocabulary!
This will be the last time I ever buy and Apple product!
Maybe you are looking for
-
Transfer Requirement with Inbound delivery.
Hi Guys, I have the following problem: The Warehouse is HU managed. When I have a Purchase Order and I do a Goods Receipt the system is creating a Material Document and in addition a Transfer Requirement. But When I have a Purchase Order and I have a
-
Drag and Drop Bug (Flash, AS3)
Hello! Help, please! I'm making a game that involves dragging and dropping books. (Right now there is only one book.) While testing my game, I discovered by accident that no matter where I drag on the screen, the draggable book responds, moving aroun
-
Downpayment req and downpayment made account
hi, 1) downpayment request is alternative recon account? its payable or receivable? 2) i notice when there is an entry in downpayment request and downpayment made account, there will be a same entry in vendor account. for example, when DR downpaymen
-
Dynamic search help for one field of the SM30 generated maintenance view
Hi experts, I have one Z* table with three fields. For that table I have generated maintenance dialog in SE55 so I can now run the maintenance in SM30. My requirement is: as soon as a user enters a value for the first field, the search help for the s
-
Agent logged out suddenly, reason code:50003
Hi, We have icm 8.0(3) and cad 8. Sometimes, an agent (each time a different one) is logged out suddenly and he get the reason code: 50003 Please find attached a logout status report that is showing the agent using extension "7459" has been logged ou