JSTL, MySQL, Tomcat sql:query error
Hi to everyone...
This is my first post, but since im employed now as a java developer ill be here regulary.
Right now im trying to use the JSTL to make some simple sql selects in my JSPs....
Here�s the JSP code:
<%@ page language="java" import="java.lang.*,java.util.*" %>
<%@ taglib uri="/jstl-core" prefix="c" %>
<%@ taglib uri="/jstl-sql" prefix="sql" %>
<html>
<head>
<title> A first JSP database </title>
</head>
<body>
<sql:setDataSource scope="session" var="dataSource"
url="jdbc:mysql://127.0.0.1/zolltek" driver="com.mysql.jdbc.Driver"
user="root" password="root"/>
<!-- The following UPDATE works fine.. -->
<sql:update var="users" dataSource="${dataSource}" scope="session">
INSERT INTO test VALUES (7,'Paul Oakenfold')
</sql:update>
<!-- But the select screws up.... -->
<sql:query var="users" dataSource="${dataSource}" scope="session">
SELECT * FROM test WHERE 1
</sql:query>
</body>
</html>
...and the error message:
exception :
org.apache.jasper.JasperException:
SELECT * FROM test WHERE 1
: null
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
root cause
javax.servlet.ServletException:
SELECT * FROM test WHERE 1
: null
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:531)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:84)
...and just for completion the importent part of my web.xml:
<taglib>
<taglib-uri>/jstl-core</taglib-uri>
<taglib-location>/WEB-INF/c-1_0.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/jstl-sql</taglib-uri>
<taglib-location>/WEB-INF/sql-1_0.tld</taglib-location>
</taglib>
i am using the jboss 3.2.3 tomcat bundle (tomcat 4.1.29)
and mysql 4.0.18 on W32 System....
the JSTL is installed and working - i can make <sql:update>Inserts without any problems, but any <sql:query>selects result in that error... so i guess the setDataSource is okay...
Any idea would be appreciated....
Thx
J�rg
Those URIs you've got in your JSPs aren't correct. They should be:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
These are the URIs defined in the standard.jar.
You'd be better off setting up a Tomcat JNDI data source for your application. That will externalize the connection parameters and make it unnecessary to refer to a data source in your JSPs.
You'd be even better off not putting SQL code in your JSPs. They're for presentation. Better to write a Java object that will communicate with the database on the JSP's behalf.
If you just want to select all the rows in the table, the query should be "SELECT * FROM test". You don't need a WHERE clause in that case.
If you change the URIs in your JSPs you should remove the <taglib> from your web.xml. It's not necessary. Tomcat will find the TLD by looking in the JARs in the CLASSPATH and matching the URIs.
Similar Messages
-
HOW TO FIND AND CORRECT THE SQL QUERY ERRORS ????
Sometimes I get the errors while executing the sql queries.
I just wanted to know about the various ways by which I can find the sql query errors .
Any suggestions will be deeply appreciated.If you get the an error from SSMS and you can't comprehend it, you can google the error message and google would always lead you to the correction. Or you can post the error in this forum, people
here are always kind and ready to help :).
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
JSTL : problems with sql:query /forEach tag
I am not able to iterate thru the resultset provided by <sql:query> tag in JSTL. rowcount and columnName works, which means that query does produce a resultset. However, the <c:forEach> tag doesnt display the retrieved data. Code is approx like:
c:catch var="e">
<sql:query var="queryResults" >
select * from emp
</sql:query>
</c:catch>
<c:if test="${e!=null}">The caught exception is: ${e}
${queryResults.rowCount} <br>
<c:forEach var="row" items="${queryResults.rows}">
<tr>
<td> <c:out value="${row.EMPNO}" /></td>
</tr>
</c:forEach>
</table>
Error thrown is :
javax.servlet.ServletException: Unable to find a value for "EMPNO" in object of class "java.lang.String" using operator "."
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.jsp.sql.query_jsp._jspService(query_jsp.java:92)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
Pls. help!Thanks a lot all. My problem was solved by simply replacing the taglib directive
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
to
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
Cheers! -
SQL Query (PL/SQL function body returning SQL query) Error
I'm an ApEx newbie, not a PL/SQL developer (more of a Web application developer) and I'm getting an error that prevents me from saving some PL/SQL code. I've looked over it all afternoon, but can't tell what's wrong. I may even be trying to do something inappropriately, or really stupid.
The code is below. The error I get is - "Function returning SQL query: Query cannot be parsed within the Builder". Any help is appreciated, and thanks in advance. If you need more details of what I'm trying to do let me know.
= = = = = = =
DECLARE
v_ID NUMBER;
v_SITE_ID NUMBER;
v_SITE_CODE VARCHAR2(15);
v_ADDR1 VARCHAR2(240);
v_CITY VARCHAR2(25);
v_STATE VARCHAR2(150);
v_ZIP VARCHAR2(20);
v_ORG_ID VARCHAR2(10);
BEGIN
IF :G_ORG_ID = '' THEN
SELECT "VENDOR_ID", "VENDOR_SITE_ID", "VENDOR_SITE_CODE", "ADDRESS_LINE1", "CITY", "STATE", "ZIP", "ORG_ID"
INTO v_ID, v_SITE_ID, v_SITE_CODE, v_ADDR1, v_CITY, v_STATE, v_ZIP, v_ORG_ID
FROM "PO_VENDOR_SITES_ALL_V"
WHERE ("VENDOR_ID" = :P4_VENDOR_ID);
ELSE
SELECT "VENDOR_ID", "VENDOR_SITE_ID", "VENDOR_SITE_CODE", "ADDRESS_LINE1", "CITY", "STATE", "ZIP", "ORG_ID"
INTO v_ID, v_SITE_ID, v_SITE_CODE, v_ADDR1, v_CITY, v_STATE, v_ZIP, v_ORG_ID
FROM "PO_VENDOR_SITES_ALL_V"
WHERE (("VENDOR_ID" = :P4_VENDOR_ID) AND ("ORG_ID" = :G_ORG_ID));
END IF;
END;Denes,
Good question.
Before I answer that question I'll give some detail on the application. That may help too. The application is a supplier search which searches the Oracle vendor tables (po.vendors, po_vendor_sites_all, po_vendor_contacts). The vendor/vendor site relationship is one to many. The site is based on the Org_ID. The supplier search is built to work solo, or to be called by another application. If it is called by another application one of the values passed is the Org_ID, so that only the sites that pertain to the user's org_id are shown. If the appl is called solo the Org_ID is not known, so the SQL should return all sites.
I figured the easiest way to check if the program was running solo or was called was to check the G_ORG_ID value in my PL/SQL that builds the site report. You helped me with that code. (I am hiding buttons by checking if the G_ORG_ID field is null and they display/hide properly.)
So, how is G_ORG_ID populated? It is on Page Zero, and is populated via the URL when the appl is called. (That aspect works great.) If it is called by another application G_ORG_ID is populated and my PL/SQL works. But, if the appl is called solo the field is not populated. When the PL/SQL runs I cannot get it to run the code for when G_ORG_ID is not populated.
I am at the point that I don't know if I need to populate G_ORG_ID in some way when the appl is running solo (kinda tricky, because I need to use that field to determine if it is running solo), or if I need to check it differently in the PL/SQL IF.
I have experimented with both the default value, and have checked for different values in the PL/SQL IF, but nothing works.
Thanks for your help, and let me know if you have any other questions on this matter.
Thanks, Tony -
I have a complicated SQL query which looks like the following:
UPDATE SeqPick
SET SeqPick.AceTopAge = SEQS.TopAge, SeqPick.AceBaseAge = SEQS.BaseAge
FROM T_Well_SeqPick SeqPick INNER JOIN (SELECT TOPS.Sequence_Name, TOPS.Sequence_ID, TOPS.TopAge, BASES.BaseAge FROM (SELECT dd.Sequence_Name, dd.Sequence_ID, Age_Top+(Age_Base-Age_Top)*Top_Ratio As TopAge FROM T_Sequences dd, T_Stages WHERE(dd.SeqScheme_ID
= 3) And T_Stages.Stage_Name_ID=Top_Stage_ID And T_Stages.Timescale_ID=1) TOPS INNER JOIN (SELECT BaseSeq.Sequence_Name, BaseSeq.Sequence_ID, Age_Top+(T_Stages.Age_Base-T_Stages.Age_Top)*Base_Ratio As BaseAge FROM T_Sequences BaseSeq, T_Stages Where SeqScheme_ID=3
AND Stage_Name_ID=Base_Stage_ID AND Timescale_ID=1) BASES ON TOPS.Sequence_ID=BASES.Sequence_ID ORDER BY TopAge, BaseAge) SEQS ON SeqPick.Seq_ID = SEQS.Sequence_ID
When I run it on a SQL Server 2008, I get the following error message:
SQL Server Exception Error:
System.Data.SqlClient.SqlException: The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified.
Are there any other ways of re-writing the above query to resolve the issue?As Erland said, query should be readable. You can easily format it by using
http://poorsql.com/
It formats your query like below:
UPDATE SeqPick
SET SeqPick.AceTopAge = SEQS.TopAge
, SeqPick.AceBaseAge = SEQS.BaseAge
FROM T_Well_SeqPick SeqPick
INNER JOIN (
SELECT TOPS.Sequence_Name
, TOPS.Sequence_ID
, TOPS.TopAge
, BASES.BaseAge
FROM (
SELECT dd.Sequence_Name
, dd.Sequence_ID
, Age_Top + (Age_Base - Age_Top) * Top_Ratio AS TopAge
FROM T_Sequences dd
, T_Stages
WHERE (dd.SeqScheme_ID = 3)
AND T_Stages.Stage_Name_ID = Top_Stage_ID
AND T_Stages.Timescale_ID = 1
) TOPS
INNER JOIN (
SELECT BaseSeq.Sequence_Name
, BaseSeq.Sequence_ID
, Age_Top + (T_Stages.Age_Base - T_Stages.Age_Top) * Base_Ratio AS BaseAge
FROM T_Sequences BaseSeq
, T_Stages
WHERE SeqScheme_ID = 3
AND Stage_Name_ID = Base_Stage_ID
AND Timescale_ID = 1
) BASES ON TOPS.Sequence_ID = BASES.Sequence_ID
--ORDER BY TopAge
-- , BaseAge
) SEQS ON SeqPick.Seq_ID = SEQS.Sequence_ID
-Vaibhav Chaudhari -
ReportViewer using SQL Query error states: Incorrect syntax near ','.
Hello Community
Using Visual Studio 2008 and SQL Server 2008 I created a Windows Application
that uses SQL Server Reporting Services. The application uses ReportViewer and
calls a method written using SQL query.
1-First I created the form.
2-Next I dragged the ReportViewer (Toolbox) and Table (from DataSource) onto the form.
The problem is that when it reaches the last line of the SQL query (ie, da.Fill(ds, "TableOne");)
the code fails stating the error message:
"Incorrect syntax near ','."
The following is the code behind the form containing the query:
private void ReportPgm1_Load(object sender, EventArgs e)
// TODO: This line of code loads data into the 'ReportDBDataSet.TableOne' table. You can move, or remove it, as needed.
this.TableOneTableAdapter.Fill(this.ReportDBDataSet.TableOne);
reportViewer1.ProcessingMode = ProcessingMode.Local;
LocalReport ReportOneLocalReport = reportViewer1.LocalReport;
DataSet ds = new DataSet("ReportDBDataSet.TableOne");
pgmReportOne(FromDate, ToDate, ds);
ReportDataSource ds = new ReportDataSource("ReportDBDataSet.TableOne");
ds.Value = dataset.Tables["TableOne"];
ReportOneLocalReport.DataSources.Clear();
ReportOneLocalReport.DataSources.Add(ds);
this.reportViewer1.RefreshReport();
private void pgmReportOne(DateTime FromDate, DateTime ToDate, DataSet ds)
SqlConnection connection = new SqlConnection("Data Source=ReportDBServer;Initial Catalog=ReportDB;Uid=sa;pwd=Password");
string sqlReportOne = "Select ([InDate], [FirstName], [LastName], [AGe]" +
"from TableOne";
SqlCommand command = new SqlCommand(sqlReportONe, connection);
command.Parameters.Add(new SqlParameter("paramFDate", FromDate));
command.Parameters.Add(new SqlParameter("paramTDate", ToDate));
SqlDataAdapter da = new SqlDataAdapter(command);
da.Fill(ds, "TableOne");
Why does the last line throw an error?
Thank you
Shabeaut--NOTE: The statement below cannot be run on SQL Server 2012
--If you have an earlier version and can set the compatibility
--level to 80, it can be run.
SELECT sso.SpecialOfferID, Description, DiscountPct, ProductID
FROM Sales.SpecialOffer sso,
Sales.SpecialOfferProduct ssop
WHERE sso.SpecialOfferID *= ssop.SpecialOfferID
AND sso.SpecialOfferID != 1
Hi Scott
The *= is old syntax and not compatible with SQL Server 2012 (as stated in the comments).
You could do something like this instead
SELECT sso.SpecialOfferID
,Description
,DiscountPct
,ProductID
FROM Sales.SpecialOffer sso
left outer join Sales.SpecialOfferProduct ssop on sso.SpecialOfferID = ssop.SpecialOfferID
WHERE sso.SpecialOfferID != 1 -
Validate and Edit SQL Query Errors
I am trying to "Validate or Edit SQL Query" in APEX 3.0. When I open up the SQL Query its highlighted in red and when I click on the Validate or Edit button it gives me an error.
I modified my marvel.conf file to include:
AddType text/xml xbl
AddType text/x-component htc
and this still didnt take care of it. Any ideas and thank you in advance.
PS: OPS - Windows Server 2003
Upgraded from 1.6 to 3.0I've gotten so used to command line editing, that I rarely us "ed". back in the days of DOS, the default editor was EDLIN - one of those goofy editors that only showed one line at a time, so it wasn't much of an improvement. you could switch to the old dos editor, but that wasn't much better (just checked, it's still there)
some nice things with command line editing
to change everthing between the first two single quotes
c/'...'/'new criteria'to remove everything after a specific string
c/from.../fromto change a string that contains (or will contain) slashes
c.1/2.1/4. -
Unable to run Direct SQL Query - Error Odbc driver returned an error (SQLEx
Hi,
I have created some answers/reports and dashboards which are working fine.
However when I try to run an SQL statement on "Create Direct Request" under "Direct Database Request" I get the following error:
error : State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27022] Unresolved Connection Pool object: "rnd1.Connection Pool". (HY000)
error : SQL Issued: {call NQSGetQueryColumnInfo('EXECUTE PHYSICAL CONNECTION POOL "rnd1.Connection Pool" select count(*) from dim_issue')}
I am working as an admin user who has the rights to create direct sql query.
Any help here will be highly appreciated.
Thanks, Rohithi,
27022 Unresolved Connection Pool object: "rnd1.Connection Pool". (HY000
have you declared correctly your Connention Pool?Or the query you write is it correct?
check again you connection pool -
Hi,
I tried to read data using the following SQL Query,
fp_work = 'ABCD'.
EXEC SQL PERFORMING WRITE_TO_ITAB .
SELECT fp_code, bank_acc_code, bank_acc_num,
INTO :gs_cds_data-FP_CODE,
:gs_cds_data-BANK_ACC_CODE,
:gs_cds_data-BANK_ACC_NUM,
FROM BANK_TABLE
WHERE fp_code = :fp_wrk
ENDEXEC.
*& Form WRITE_to_itab
FORM write_to_itab.
To move the data into the Internal Table.
APPEND gs_cds_data TO gt_cds_data.
CLEAR gs_cds_data.
ENDFORM. "WRITE_to_itab
and im getting the run time error..
What happened?
The error occurred in the current database connection "SAPABC".
How to correct the error
Database error text........: "ORA-00936: missing expression"
Triggering SQL statement...: "FETCH NEXT "
Internal call code.........: "[DBDS/NEW DSQL]"
Please check the entries in the system log (Transaction SM21).
You may able to find an interim solution to the problem
in the SAP note system. If you have access to the note system yourself,
use the following search criteria:
"DBIF_DSQL2_SQL_ERROR" C
If you cannot solve the problem yourself, please send the
following documents to SAP:
Can anyone give me a solution to correct this error?
In addition, Can i omit the WHERE clause, as i need to get all the data in the oracle database?BUT,
EXEC SQL.
connect to :LV_DB_NAME as :sy-uname
ENDEXEC.
EXEC SQL.
SET CONNECTION :sy-uname
ENDEXEC.
check sy-subrc..
connection is happening.. with sy-subrc value as ZERO -
Difficult sql:query error
Hello everybody,
I've been stuck on an error for quite some time now, so I figured I may as well share it with you. I am trying to run the following mysql statement within the jstl query tag:
SELECT subselect.*,count(transactionoffer.id)as count, IF((DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 30 MINUTE) <= user.active AND user.logged_in=1),'1','0') as active, user.first, user.last,cities.lon, cities.lat, categories.title as cat FROM ((SELECT
products.*,transaction.accepted,transaction.removed
FROM
products
LEFT Join transaction ON products.transactionId = transaction.id
WHERE
products.transactionId = '0' AND ownerId = 1
UNION
SELECT * FROM (SELECT products.*, transaction.accepted,transaction.removed FROM
products
Inner Join transactionoffer ON transactionoffer.productId = products.id
Inner Join transaction ON transactionoffer.transactionId =transaction.id
WHERE ownerId = 1
ORDER BY
transaction.accepted DESC
) as p
GROUP BY p.id
ORDER BY accepted DESC
) AS subselect
LEFT JOIN transactionoffer ON subselect.id = transactionoffer.productId
LEFT JOIN user ON user.id = subselect.ownerId
LEFT JOIN cities ON user.plz = cities.plz
LEFT JOIN categories ON categories.id = subselect.category
GROUP BY id
HAVING (accepted = '0' OR accepted is null) AND transactionId = '0'
There are no results, though when run on the mysql console directly, everything seems to work fine. Can anybody spot the error or does anybody here have a solution to the problem?Thx for the reply, Balus! :)
This didn't quite answer my question, but it's helpful none the less. It is not really an option for me to move everything into a seperate class right now (though i did that with parts of some other code already). So in this case I'd need a differend solution. Besides I got a feeling, that this bug is related to the ODBC driver itself (on which the tag library is based upon), so it may be that the error still remains even if i go through the entire hassle of recoding the darn thang...
Perhaps I should use a mysql function or procedure instead to get around this bug? -
SQL Query error in java swing Application
hi,
I'm getting the following error when i try to manipulate the date in query.I have set of tuples and would like to retrieve with respect to the date given.Please do help me to get rid of this error.This is the error.
MY QUERY:
ResultSet rsdate=st1.executeQuery("select * from phy_stock where date = "+d1+"");
Where d1 is given like this:
String startdate[2]="11/31/2008";
DateFormat df = new SimpleDateFormat ("MM/dd/yyyy"); //converting a string to DATE format.
Date d1 = df.parse(startdate[2]);
ERROR:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'date = Mon Sep 01 00:00:00 IST 2008'
thanks,
kumar.Dates do not have formats. When referencing a Date in String concatenation, which is what you are doing here,
ResultSet rsdate=st1.executeQuery("select * from phy_stock where date = " + d1 + "");you will get what Date's toString method produces, which will not work for that (or any) query. For one, it wouldn't be surrounded by single quotes ('), and for two, the String format of the Date would not be acceptable by the DB (unless you had changed the DBs defaults).
Use a PreparedStatement, as suggessted above, and this problem goes away.
Edit: And make sure to use the setDate method, of course. -
SQL Query Error Help !!
Here is the Query:
<cfquery name="get_facilities" dbtype="query">
SELECT
shopid, name, address, city, zip, phone, keyword
FROM get_shops
WHERE(
<cfloop index="i" list="#form.keywords#" delimiters="
">
UPPER(keywords_#request.language#) LIKE UPPER('%#i#%') AND
</cfloop>
UPPER(keywords_#request.language#) LIKE '%%')
ORDER BYzip
</cfquery>
Here is the error:
"The Pattern of the LIKE conditional is malformed"
Here is what was entered in the keyword field in the form,
the person was searching for "star auto[obile".
automobile was misspelled with a [.
How do I fix this? Can I fix it in the query?Joe Science wrote:
>
> How do I fix this? Can I fix it in the query?
>
Most likely this can be fixed with the recommended used of
the
<cfqueryparam...> tag for all user variables input into
a SQL statement.
It will protect you from SQL injection as well.
UPPER(keyword_#request.languate#_ LIKE
UPPPER(<cfqueryparam
value="%#i#%" cfsqltype="cf_sql_varchar">) AND -
How to get logging sql query error
Hi,
I want to create some constraints and indexes on tables on a particular schema and I have the script to build the indexes and constraints.
But I want to get the errors that should be logged on some file during indexes and constraints creation.
Pls help me...
Thanks in advance..If you are running the script via SQLPlus then just add a "spool filename" to the beginning of the script and a "spool off" at the end so that query results are written to the file. Also you probably want to "set echo on" at the beginning so that the SQL statements are written to the file also.
See the SQLPLus Users Guide for the set command and spool.
HTH -- Mark D Powell -- -
Hello!
I need some correction in the following query. I am trying to make a 2 page QPLD so I am joining 2 queries and then printing the report into 2 pages.
SELECT T0.[U_OANumber], T0.[custmrName], T0.[U_Inspection], T0.[U_Cust_PO_Num],
T0.[U_ModelType], T0.[U_Duty], T0.[U_NamePlate],
T0.[U_Indicator_Obs], T0.[U_Fastners], T0.[U_Mounting_Type], T0.[U_Casing_Orientation], T0.[U_Impeller_Dia],
T0.[U_Bearing_Style], T0.[U_Motor_HP_Size], T0.[U_InsulationWedges], T0.[U_Varnish], T0.[U_Paint_Shade],
T0.[U_PlugsSeal], T0.[U_Remarks], T0.[U_Despatch]
FROM OINS T0 WHERE T0.[U_OANumber] = '[%0]' or T0.[customer] = '[%1]' or T0.[manufSN] = '[%2]'
Union all
SELECT T0.[U_ModelType], T0.[U_Size], T0.[U_Discharge], T0.[U_Head], T0.[U_RPM], T0.[U_YOM], T0.[U_HP],
T0.[U_Amps], T0.[U_Insulation_Class], T0.[U_Winding_Connection]
FROM OINS T0 WHERE
T0.[U_OANumber] = '[%0]' or T0.[customer] = '[%1]' or T0.[manufSN] = '[%2]'
Do I have to use the where clause just once since it is identical to both statements?
I get the error stating that all queries using Union, Intersect or Except must have an equal number of expressions. what does this mean?
scorp
Edited by: scorpion 666 on Feb 12, 2009 1:30 PMUnion has to have exact same numbers of fields to combine two results. Your query shows no need of union because your where clauses are identical.
Right syntax would be like this:
SELECT T0.[U_OANumber], T0.[custmrName], T0.[U_Inspection], T0.[U_Cust_PO_Num],
T0.[U_ModelType], T0.[U_Duty], T0.[U_NamePlate],
T0.[U_Indicator_Obs], T0.[U_Fastners], T0.[U_Mounting_Type], T0.[U_Casing_Orientation], T0.[U_Impeller_Dia],
T0.[U_Bearing_Style], T0.[U_Motor_HP_Size], T0.[U_InsulationWedges], T0.[U_Varnish], T0.[U_Paint_Shade],
T0.[U_PlugsSeal], T0.[U_Remarks], T0.[U_Despatch], T0.[U_Size], T0.[U_Discharge], T0.[U_Head], T0.[U_RPM], T0.[U_YOM], T0.[U_HP],
T0.[U_Amps], T0.[U_Insulation_Class], T0.[U_Winding_Connection]
FROM DBO.OINS T0 WHERE T0.[U_OANumber] = '[%0]' or T0.[customer] = '[%1]' or T0.[manufSN] = '[%2]'
Thanks,
Gordon -
UTL_HTTP working in SQL Query, error when used in procedure
Hi,
We are trying to call web service from stored procedure .
When we run the utl_http.request independently in a query its working fine but when we put that in a stored procedure we are unable to connect. Getting HTTP request failed error.
select utl_http.request("SSL_URL",
null,
"Wallet Details",
'password')
from dual;
But the same query if we put into procedure getting the error as below,
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1722
ORA-28860: Fatal SSL error
All the parameters are set properly w.r.t ACL and Oracle Wallet for SSL .
grant execute on UTL_HTTP to &&SCHEMA_NAME;
--Step1 grant on UTL_HTTP package to schema
grant execute on UTL_HTTP to &&SCHEMA_NAME;
Created ACL using the below scripts.
begin
dbms_network_acl_admin.create_acl (
acl => 'utlpkg.xml',
description => 'Normal Access',
principal => 'CONNECT',
is_grant => TRUE,
privilege => 'connect',
start_date => null,
end_date => null
end;
begin
dbms_network_acl_admin.assign_acl (
acl => 'utlpkg.xml',
host => '*',
lower_port => 1,
upper_port => 35000);
end;
begin
dbms_network_acl_admin.add_privilege (
acl => 'utlpkg.xml',
principal => '&&SCHEMA_NAME',
is_grant => TRUE,
privilege => 'connect',
start_date => null,
end_date => null);
end;
Thanks in advance for the help!!!!!!!Any responses? Thanks.
Maybe you are looking for
-
I use Photoshop elements 9 to edit , since the last up-date when I'm in iPhoto and click edit in external editor when photoshop opens it sits there a minute and and then a error window comes up saying something about an unvalead jpeg marker can't op
-
Imac with 2 cinema displays, help.
I currently have a intel based imac 17" the one with the camera on top. Hooked up with that i have a 20" apple cinema display, aluminium one. I will shortly be upgrading to the aluminium 24" imac. I have just bought a second 20" apple cinema display
-
New iTunes update wont run in the background
When the last update for iTunes came out I was pretty excited to see the new layout. When I was done installing I was really impressed with the new setup. I do however have this one problem. I used to run iTunes in the background when I was playing g
-
Getting field names of an internal table
Hi all, Does anyone know if exists a statement, function module or method that gets the field names of an internal table ? Thanks in advance, David
-
Processing compressed message through MQ Adapter
Hi, In oracle MQ Adapter documentation I do not see any support for processing compressed messages through MQ adapter. Is there any other way by which I can process compressed messages through MQ Adapter. I have CCDT(client channel definition table )