Error executing a query using a DB-Link
Hi all,
I'm trying to execute a query on a DB using a connection. I created a DB-LINK on the DB. executing the select:
select sysdate from dual@lnk_db_prod;
I get the following error:
Error starting at line 1 in command:
select sysdate from dual@lnk_db_prod
Error at Command Line:1 Column:19
Error report:
SQL Error: ORA-01882: timezone region not found
ORA-02063: preceding line from lnk_db_prod
The error will be return executing any query on a db-link.
It appens if I create a db-link using syntax referencing the SID and using the sintax with the complete connection string. Below the two example of db-link DDL commands:
1.
CREATE DATABASE LINK lnk_db_prod
CONNECT TO prod IDENTIFIED BY prod
USING 'DBPROD';
2.
create database link lnk_db_prod2
connect to prod
identified by prod
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = 10.41.54.156)
(Port = 1521)
(CONNECT_DATA = (SID = DBPROD)
Can you help me, please?
bye,
Ivan
Hi,
You would be better off posting / searching on other Oracle forums that deal more specifically with Application Servers. I googled "WebLogic set time_zone" and the first three hits were from our forums:
Default TimeZone
How to fix msg=ORA-01882: timezone region not found
http://kr.forums.oracle.com/forums/thread.jspa?messageID=9400587
I hope one of the these is what you are looking for.
Regards,
Gary Graham
SQL Developer Team
Similar Messages
-
Error executing a query using VPD and BC4J
Hi all,
Our team is developing an application using an Oracle DB 9.2.0.4 and BC4J 10g (9.0.5.16.0) as persistence layer.
We also are using the VPD (virtual private database) to have security in the database at row level.
The problem we are facing is that every some time (days) we get a jdbc error when a query (see below) that uses VPD policies is executed. Once the error occurs I execute it from sqlplus without getting any error .. it only occurs from our java application.
To temporary solve this problem, we delete and recreate the VPD policies, then the application continue working fine for some time ...
I'll appreciate any comment / suggestions
Thank in advance.
Eduardo.
ERROR LOG:
oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT CalLocation.ID,
CalLocation.CODE, eo
CalLocation.NAME,
CalLocation.ZIP,
CalLocation.PHONE,
CalLocation.FAX,
CalLocation.ADDRESS1,
CalLocation.ADDRESS2,
CalLocation.URL,
CalLocation.OWNER,
CalLocation.CTY_ID,
CalLocation.DESCRIPTION,
ORefCity.CODE CTY_CODE,
ORefCountry.ID CTR_ID,
ORefCountry.CODE CTR_CODE,
ORefRegion.ID REG_ID,
ORefRegion.CODE REG_CODE
FROM CAL_LOCATIONS CalLocation,
OREF_CITIES ORefCity,
OREF_COUNTRIES ORefCountry,
OREF_REGIONS ORefRegion
WHERE ORefCity.ID = CalLocation.CTY_ID
and ORefCountry.ID = ORefCity.CTR_ID
and ORefRegion.ID = ORefCountry.REG_ID) QRSLT WHERE ( ( (CTY_ID = 867) ) )
## Detail 0 ##
java.sql.SQLException: Io exception: Broken pipe
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:231)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:345)
at oracle.jdbc.driver.OracleStatement.open(OracleStatement.java:717)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2605)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:457)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:387)The symptoms we have been getting are quite similar to the bug 3662364 .
I'm going to implement the patch for that bug and see what happend then.
Thank you very much for your help.
Regards,
Eduardo. -
Error executing database query, invalid use of:
I have a problem ColdfusionMX tutorial when I get to add tags
on top of the code view. And I write the same thing as the
tutorial.
I get an error message that says:
Error executing database query.
error occurred while processing request.
Invalid use of ", ", () in query expression
I need help desperatly,
Geordeslys,The web site you are accessing has experienced an unexpected
error.
Please contact the website administrator.
The following information is meant for the website developer
for debugging purposes.
Error Occurred While Processing Request
Error Executing Database Query.
Invalid use of '.', '!', or '()'. in query expression
'ARTISTS.ARTISTID = ART.ARTISTID AND ART.MEDIAID = MEDIA. MEDIAID'.
The error occurred in
C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\tutorial\TMPhy0vtntf3u.cfm:
line 1
1 : <cfquery name="artwork" datasource="cftutorial">
2 : SELECT FIRSTNAME, LASTNAME, ARTNAME, DESCRIPTION, PRICE,
LARGEIMAGE, ISSOLD, MEDIATYPE
3 : FROM ARTISTS, ART, MEDIA
Dear CF_dev2,
Is that what you mean by complete CF code?
Georgeslys,
SQL SELECT FIRSTNAME, LASTNAME, ARTNAME, DESCRIPTION, PRICE,
LARGEIMAGE, ISSOLD, MEDIATYPE FROM ARTISTS, ART, MEDIA WHERE
ARTISTS.ARTISTID = ART.ARTISTID AND ART.MEDIAID = MEDIA. MEDIAID
DATASOURCE cftutorial
VENDORERRORCODE 3092
SQLSTATE
Resources:
Check the ColdFusion documentation to verify that you are
using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;
.NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; IEMB3;
IEMB3)
Remote Address 127.0.0.1
Referrer
Date/Time 03-Sep-07 07:11 PM
Stack Trace (click to expand)
at
cfTMPhy0vtntf3u2ecfm1461475070.runPage(C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\tutoria l\TMPhy0vtntf3u.cfm:1)
at
cfTMPhy0vtntf3u2ecfm1461475070.runPage(C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\tutoria l\TMPhy0vtntf3u.cfm:1)
com.inzoom.adojni.ComException: Invalid use of
'.', '!', or
'()'. in query expression
'ARTISTS.ARTISTID = ART.ARTISTID
AND ART.MEDIAID = MEDIA. MEDIAID'. in Microsoft JET
Database Engine code=3092 Type=1
at com.inzoom.ado.Command.jniExecute(Native Method)
at com.inzoom.ado.Command.execute(Command.java:40)
at com.inzoom.jdbcado.Statement.exec(Statement.java:34)
at com.inzoom.jdbcado.Statement.execute(Statement.java:107)
at
coldfusion.server.j2ee.sql.JRunStatement.execute(JRunStatement.java:212)
at coldfusion.sql.Executive.executeQuery(Executive.java:753)
at coldfusion.sql.Executive.executeQuery(Executive.java:675)
at coldfusion.sql.Executive.executeQuery(Executive.java:636)
at coldfusion.sql.SqlImpl.execute(SqlImpl.java:236)
at
coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:500)
at
cfTMPhy0vtntf3u2ecfm1461475070.runPage(C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\tutoria l\TMPhy0vtntf3u.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
at
coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:225)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at
coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
at
coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at
coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
at coldfusion.CfmServlet.service(CfmServlet.java:107)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at
jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) -
Another Error Executing Database Query.
I am getting this error.
12:40:54.054 - Database Exception - in
C:\CFusionMX7\wwwroot\Author\dropdown2\EmployeeAddAction.cfm : line
26
Error Executing Database Query.
i have added extra fields in the mdb and added extra code to
the form page and the action page.
i am getting this error still.
this is how i broke it down.
If I run my 2 files EmployeeAddForm.cfm and
EmployeeAddAction.cfm
I get this error:
NOTE: if i take out the comments from the code and ignore the
new fields added to the db it works fine!!!!!
The web site you are accessing has experienced an unexpected
error.
Please contact the website administrator.
The following information is meant for the website developer
for debugging purposes.
Error Occurred While Processing Request
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in
INSERT INTO statement.
Resources:
Enable Robust Exception Information to provide greater detail
about the source of errors. In the Administrator, click Debugging
& Logging > Debugging Settings, and select the Robust
Exception Information option.
Check the ColdFusion documentation to verify that you are
using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Remote Address 127.0.0.1
Referrer
http://127.0.0.1:8500/Author/dropdown2/EmployeeAddForm.cfm
Date/Time 06-Jun-07 12:40 PM
NOTE: if i take out the comments from the code and ignore the
new fields added to the db it works fine!!!!!Try using '###CreateODBCDate(Form.DateOfBirth)###'. Access is
strange on
handling dates. It has a been a while since I have used
Access so it could
be as simple as wrapping it single quotes as well. I am
assuming the
"<!-----------" wasn't intended, but I could be wrong.
Bryan Ashcraft (remove brain to reply)
Web Application Developer
Wright Medical Technology, Inc.
Macromedia Certified Dreamweaver Developer
Adobe Community Expert (DW) ::
http://www.adobe.com/communities/experts/
"Coldfusionstudent" <[email protected]>
wrote in message
news:[email protected]...
>I am getting this error.
> 12:40:54.054 - Database Exception - in
>
C:\CFusionMX7\wwwroot\Author\dropdown2\EmployeeAddAction.cfm : line
26
> Error Executing Database Query.
>
> i have added extra fields in the mdb and added extra
code to the form page
> and
> the action page.
> i am getting this error still.
> this is how i broke it down.
>
> If I run my 2 files EmployeeAddForm.cfm and
EmployeeAddAction.cfm
> I get this error:
>
> The web site you are accessing has experienced an
unexpected error.
> Please contact the website administrator.
>
> The following information is meant for the website
developer for debugging
> purposes.
>
> Error Occurred While Processing Request
> Error Executing Database Query.
> [Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft
> Access Driver] Syntax error in INSERT INTO statement.
>
>
> Resources:
> Enable Robust Exception Information to provide greater
detail about the
> source
> of errors. In the Administrator, click Debugging &
Logging > Debugging
> Settings, and select the Robust Exception Information
option.
> Check the ColdFusion documentation to verify that you
are using the
> correct
> syntax.
> Search the Knowledge Base to find a solution to your
problem.
>
>
> Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; SV1; .NET CLR
> 1.1.4322; .NET CLR 2.0.50727)
> Remote Address 127.0.0.1
> Referrer
http://127.0.0.1:8500/Author/dropdown2/EmployeeAddForm.cfm
> Date/Time 06-Jun-07 12:40 PM
>
>
>
> EmployeeAddForm.cfm
>
> <cfquery name="GetCompanies"
> datasource="#Request.MainDSN#">
> SELECT
> CompanyID,
> CompanyName
> FROM
> Company
> ORDER BY
> CompanyName
> </cfquery>
>
> <html>
> <head>
> <title>ColdFusion MX Bible</title>
> <link rel="stylesheet" href="styles.css">
> </head>
>
> <body>
>
> <h1> </h1>
>
> <table>
> <cfform action="EmployeeAddAction.cfm"
method="POST">
>
> <tr>
> <td>Company</td>
> <td>
> <cfselect name="CompanyID"
> size="1"
> query="GetCompanies"
> value="CompanyID"
> display="CompanyName"
> required="Yes"
> message="Please select a Company."></cfselect>
> </td>
> </tr>
>
> <tr>
> <td>SSN</td>
> <td>
> <cfinput type="Text"
> name="SSN"
> message="Please enter the employee's Social Security
Number."
> validate="social_security_number"
> required="Yes"
> size="12"
> maxlength="11">
> </td>
> </tr>
>
> <tr>
> <td>First Name</td>
> <td>
> <cfinput type="Text"
> name="Firstname"
> message="Please enter the employee's first name."
> required="Yes"
> size="22"
> maxlength="20">
> </td>
> </tr>
>
> <tr>
> <td>Last Name</td>
> <td>
> <cfinput type="Text"
> name="Lastname"
> message="Please enter the employee's last name."
> required="Yes"
> size="22"
> maxlength="20">
> </td>
> </tr>
>
> <tr>
> <td>Salary</td>
> <td>
> <cfinput type="Text"
> name="Salary"
> message="Please enter a valid salary."
> validate="float"
> required="Yes"
> size="22"
> maxlength="20">
> </td>
> </tr>
>
> <tr>
> <td>DOB</td>
> <td>
> <cfinput type="Text"
> name="DateOfBirth"
> message="Please enter a valid date of birth in the
format mm/dd/yyyy"
> validate="date"
> required="Yes"
> size="11"
> maxlength="10">
> </td>
> </tr><!-------------
> <tr>
> <td>device_typ</td>
> <td>
> <cfinput type="Text"
> name="device_typ"
> message="Please enter the employee's device_typ."
> required="Yes"
> size="22"
> maxlength="20">
> </td>
> </tr><tr>
> <td>device_Email</td>
> <td>
> <cfinput type="Text"
> name="device_Email"
> message="Please enter the employee's device_Email."
> required="Yes"
> size="22"
> maxlength="20">
> </td>
> </tr><tr>
> <td>Work_email</td>
> <td>
> <cfinput type="Text"
> name="Work_email"
> message="Please enter the employee's Work_email."
> required="Yes"
> size="22"
> maxlength="20">
> </td>
> </tr><tr>
> <td>Pin_Number</td>
> <td>
> <cfinput type="Text"
> name="Pin_Number"
> message="Please enter the employee's Pin_Number."
> required="Yes"
> size="22"
> maxlength="20">
> </td>
> </tr>------------------>
> <tr>
> <td> </td>
> <td>
> <input type="submit" value="Add to Database">
> </td>
> </tr>
>
> </cfform>
> </table>
>
> </body>
> </html>
> ---------------------------
> EmployeeAddAction.cfm
>
> <cfquery name="InsertEmployee"
> datasource="#Request.MainDSN#">
> INSERT INTO Employee(
> SSN,
> CompanyID,
> Firstname,
> Lastname,
> Salary,
> DateOfBirth<!----------,
> device_typ,
> device_Email,
> Work_email,
> Pin_Number-------------->
>
> )
> VALUES (
> '#Trim(Form.SSN)#',
> #Val(Form.CompanyID)#,
> '#Trim(Form.Firstname)#',
> '#Trim(Form.Lastname)#',
> #Val(Form.Salary)#,
> #CreateODBCDate(Form.DateOfBirth)#<!-----------,
> '#Trim(Form.device_typ)#',
> '#Trim(Form.device_Email)#',
> '#Trim(Form.Work_email)#',
> '#Trim(Form.Pin_Number)#'------------------>
> )
> </cfquery>
>
> <cfmail
to="#Form.Firstname#.#Form.Lastname#@somewhere.com"
> from="[email protected]"
> subject="Welcome to your new company!">
> Welcome to your new company, #Form.Firstname#
#Form.Lastname#!
> </cfmail>
> <!----
> <cflocation url="EmployeeList.cfm">----->
> -
Error Executing Database Query. (Please help)
I can't get this query to work properly. I have gone over it so many times.. I can't count, I don't get why it's throwing an error. Here is my code, and followed by the error:
My update query:
<cfquery name="UpdateDetails" datasource="#APPLICATION.dataSource#">
UPDATE books234
SET
books234.title=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.title#">,
books234.info=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.info#">,
books234.statement=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.statement#">,
<cfif fileuploaded is true>
books234.MYFile=<cfqueryparam cfsqltype="cf_sql_varchar" value="#uploadedfile#">,
</cfif>
books234.links=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.links#">,
books234.ordNum=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.ordNum#">
WHERE books234.ID = <cfqueryparam value="#form.ID#" cfsqlType="CF_SQL_INTEGER">
</cfquery>
<cflocation url="bookView.cfm?ID=#Form.ID#" addtoken="no">
Here is my error:
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver]Invalid precision value
The error occurred in C:\websites\209689jh6\slideAction.cfm: line 455
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm: line 442
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm: line 390
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm: line 1
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm: line 455
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm: line 442
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm: line 390
Called from C:\websites\209689jh6\admin\cms\slideAction.cfm: line 1
453 : books234.links=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.links#">,
454 : books234.ordNum=<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.ordNum#">
455 : WHERE books234.ID = <cfqueryparam value="#form.ID#" cfsqlType="CF_SQL_INTEGER">
456 : </cfquery>
457 : <cflocation url="bookView.cfm?ID=#Form.ID#" addtoken="no">
Can anyone see what I did wrong here? It's not like it's a sophisticated query. I write these all the time.
Thank you.Does it work without using cfqueryparam in the WHERE statement? Are you sure the type CF_SQL_INTEGER is correct? Is the value of form.ID really an integer?
Cheers -
I have an package with source , data flow and destination to execute on begin and commit.
in the below i have just used for questioning purpose with diagram removing my Data Flow task explaining my problem
on execution, i get error as
[Execute SQL Task] Error: Executing the query "COMMIT TRAN DimCompanyCode" failed with the following error: "The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.". Possible failure reasons: Problems with the query, "ResultSet"
property not set correctly, parameters not set correctly, or connection not established correctly.
as mentioned , i have checked the ResultSet, parameters , connection establish.. all are fine.
Kindly advice on what has to be done.
ShanmugaRajTo avoid this error, the RetainSameConnection property should set to 'True' for the Connection Manager - Application_DB.
Narsimha -
Error Executing Database Query (Encountered [nullstring])
The attached code gives the following error message. I did
have nullstrings being submitted as the "notes" and "internal
notes," but I removed them in an (unsuccessful) attempt to solve
this problem. Can this be fixed? Thanks!
quote:
Error Executing Database Query.
Syntax error: Encountered "" at line 9, column 43.
The error occurred in
C:\ColdFusion8\wwwroot\Example\init.cfm: line 6
4 : </head>
5 : <body>
6 : <CFQUERY NAME="init" DATASOURCE="Example">
7 : CREATE TABLE programs(
8 : ID int,
SQLSTATE 42X01
SQL CREATE TABLE programs( ID int, program_ID int, name
varchar(20), long_name varchar(50), creator_email varchar(50),
notes varchar(50), internal_notes varchar(50), is_public bool );
INSERT INTO programs( ID, program_ID, name, long_name,
creator_email, is_public ) VALUES( 0, 1, "Basic", "Basic
(pre-selected)", "[email protected]", true ); SELECT * FROM
programs;
VENDORERRORCODE 30000
DATASOURCE Example
Resources:
* Check the ColdFusion documentation to verify that you are
using the correct syntax.
* Search the Knowledge Base to find a solution to your
problem.
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Remote Address 127.0.0.1
Referrer
Date/Time 20-Feb-08 11:53 PM
Stack Trace
at
cfinit2ecfm949254281.runPage(C:\ColdFusion8\wwwroot\Example\init.cfm:6)
at
cfinit2ecfm949254281.runPage(C:\ColdFusion8\wwwroot\Example\init.cfm:6)
[ginormous Java stacktrace omitted]I whittled my SQL down to the first query and added the
transaction block, but the error remains. Thanks for your time!
quote:
Error Executing Database Query.
Syntax error: Encountered "" at line 9, column 51.
The error occurred in
C:\ColdFusion8\wwwroot\Example\init.cfm: line 7
5 : <body>
6 : <CFTRANSACTION>
7 : <CFQUERY NAME="init" DATASOURCE="Example">
8 : CREATE TABLE programs(
9 : ID int,
SQLSTATE 42X01
SQL CREATE TABLE programs( ID int, program_ID int, name
varchar(20), long_name varchar(50), creator_email varchar(50),
notes varchar(50), internal_notes varchar(50), is_public bool );
VENDORERRORCODE 20000
DATASOURCE Example
Resources:
* Check the ColdFusion documentation to verify that you are
using the correct syntax.
* Search the Knowledge Base to find a solution to your
problem.
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Remote Address 127.0.0.1
Referrer
Date/Time 22-Feb-08 10:02 AM
Stack Trace
at
cfinit2ecfm949254281.runPage(C:\ColdFusion8\wwwroot\Example\init.cfm:7)
at
cfinit2ecfm949254281.runPage(C:\ColdFusion8\wwwroot\Example\init.cfm:7) -
Error Executing Database Query - Help!
I have a cfquery code that looks like this:
<CFQUERY DATASOURCE="mydatabase" USERNAME="myuser" PASSWORD="mypassword" NAME="codelist" CACHEDWITHIN="#CreateTimeSpan(0,1,0,0)#">
SELECT *
FROM systemcode
WHERE (LEN(TRIM(systemcode)) = 2 OR LEN(TRIM(systemcode)) = 4)
<CFSWITCH EXPRESSION="#CAT#">
<CFCASE VALUE="1">AND (MID(systemcode,1,2) BETWEEN '01' AND '05')</CFCASE>
<CFCASE VALUE="2">AND (MID(systemcode,1,2) BETWEEN '06' AND '15')</CFCASE>
<CFCASE VALUE="3">AND (MID(systemcode,1,2) BETWEEN '16' AND '24')</CFCASE>
<CFCASE VALUE="4">AND (MID(systemcode,1,2) BETWEEN '25' AND '27')</CFCASE>
<CFCASE VALUE="5">AND (MID(systemcode,1,2) BETWEEN '28' AND '38')</CFCASE>
<CFCASE VALUE="6">AND (MID(systemcode,1,2) BETWEEN '39' AND '40')</CFCASE>
<CFCASE VALUE="7">AND (MID(systemcode,1,2) BETWEEN '41' AND '43')</CFCASE>
<CFCASE VALUE="8">AND (MID(systemcode,1,2) BETWEEN '44' AND '49')</CFCASE>
<CFCASE VALUE="9">AND (MID(systemcode,1,2) BETWEEN '50' AND '63')</CFCASE>
<CFCASE VALUE="10">AND (MID(systemcode,1,2) BETWEEN '64' AND '67')</CFCASE>
<CFCASE VALUE="11">AND (MID(systemcode,1,2) BETWEEN '68' AND '71')</CFCASE>
<CFCASE VALUE="12">AND (MID(systemcode,1,2) BETWEEN '72' AND '83')</CFCASE>
<CFCASE VALUE="13">AND (MID(systemcode,1,2) BETWEEN '84' AND '85')</CFCASE>
<CFCASE VALUE="14">AND (MID(systemcode,1,2) BETWEEN '86' AND '89')</CFCASE>
<CFCASE VALUE="15">AND (MID(systemcode,1,2) BETWEEN '90' AND '97')</CFCASE>
<CFCASE VALUE="16">AND (MID(systemcode,1,2) BETWEEN '98' AND '99')</CFCASE>
<CFDEFAULTCASE><CFLOCATION URL="somewhere.htm"></CFDEFAULTCASE>
</CFSWITCH>
ORDER BY systemcode
</CFQUERY>
This works perfectly in CF 5. However, when running in CF 8 I am getting the error message:
Error Executing Database Query.FUNCTION mydatabase.LEN does not exist The specific sequence of files included or processed is: /home/httpd/vhosts/somedomain.com/httpdocs/reference/systemcode.cfm, line: 24
(that refers to the above cfquery)
"mydatabase" is the name of the database and LEN is a function. It's checking for the length of systemcode to be 2 or 4, if they are then check if the value of #CAT# is 1 and that the first 2 characters is between 01 and 05 then select the row. I don't know why it works with CF5 but not CF8? It's driving me nuts. Any help is appreciated.I just don't see why
all of a sudden it doesn't work with CF8 and MySQL,
If you changed databases, that is the source of the problem, not upgrading CF. MySQL will not understand MS Access specific functions and vice versa. Do not expect queries written for one database type to automatically work with another. While there are sql standards, every database is different. It is quite common for database vendors to have totally different function names, data types and even syntax. You will need to throrougly review your database queries and convert any Access specific syntax, data types, etcetera to the MySQL equivalents.
Are there MySQL equivalent for these two functions (TRIM and
LEN)?
Yes. See the string functions section in the online mySQL docs.
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
I don't konw there was a TRIM and LEN in MS Access
database. I guess I was mixing them.
Yes. It is a little confusing because both CF and MS Access have those functions. In this specific case you were using the Access functions, not CF.
http://www.techonthenet.com/access/functions/index_alpha.php
>> Yes, I did put a
CFLOCATION inside the cfquery. Never encounter that
scenario so I didn't know if it works.
Well if you are using the code, it should be something you have tested. So you know how it behaves. But CFLOCATION really does not belong inside a database query.
` -
Error Executing Database Query
I have a web application written in CF8 with Oracle 11g as the back end. This application has been used very often for more than 6 years. Currently I am moving to CF10 and did only a little modification to the CF codes. When I ran the new application in my test server, everything seems to be working just fine except when it calls an Oracle Package. This action produces an error: Error Executing Database Query The strange thing is everything work before and after calling the procedure, I tested using cfabort This Oracle Package is still working in production server (CF8) but not when it is called by CF10. My question is: Is there any changes for CF10 when calling a procedures? or is there any hotfix that I'm not aware of? The code is as follow: SELECT case trim(to_char(SYSDATE, 'DAY')) WHEN 'MONDAY' then '1' else '2' end AS TodaysDate from dual
SELECT Count(other_id) AS NoRecFound FROM gl_dup_ids_ssns WHERE Trim(create_date) =
SELECT Count(other_id) AS NoRecFound FROM gl_dup_ids_ssns WHERE Trim(create_date) = CF codes to Stop the process and email admin
Error Executing Database Query shows up when it hit to run cfstoredproc. The codes are exactly the same as in CF8, this template was not modified. Exceptions 14:03:53.053 - Database Exception - in /home/space/users/www/GL/glproc.cfm : line 93 Error Executing Database Query.mega_L wrote:
SELECT case trim(to_char(SYSDATE, 'DAY')) WHEN 'MONDAY' then '1' else '2' end AS TodaysDate from dual
SELECT Count(other_id) AS NoRecFound FROM gl_dup_ids_ssns WHERE Trim(create_date) =
SELECT Count(other_id) AS NoRecFound FROM gl_dup_ids_ssns WHERE Trim(create_date) = CF codes to Stop the process and email admin
Surely, that cannot be the actual SQL, as it is obviously invalid. -
My coldfusion service crashes intermitantly and when I check
the application logs the error that I see for the time frame is the
one below. Does anyone know where I might begain to solve this?
Thanks!
Error Executing Database
Query.coldfusion.sql.DatabaseConnectionException: Timed out trying
to establish connection The specific sequence of files included or
processed is: E:\wwwroot\lifeworks\default.cfmI'm no expert, but thought I would try to be helpful.
I was getting this same error on a regular basis.
The short term fix was to restart the ODBC server service.
The long term fix was twofold:
1. I recreated the ODBC connection in ColdFusion
Administrator to use the system connection (I was using the SA and
PW for login).
2. I created a second user ODBC connection as well as the
system one under ODBC in Windows Server 2003.
I haven't had the problem since.
I also read a pretty good set of "stuff" to try from the help
area:
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_17277
Hope this helps. -
Hi
DECLARE @XMLA nvarchar(3000)
, @DateSerial nvarchar(35);
-- Change date to format YYYYMMDDHHMMSS
SET @DateSerial = CAST(GETDATE() AS DATE);
--SELECT @DateSerial
Set @XMLA =
N' <Batch xmlns="http://schemas.microsoft.com/analysis services/2003/engine">
<ErrorConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"
xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200"
xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200">
<KeyErrorLimit>-1</KeyErrorLimit>
<KeyNotFound>IgnoreError</KeyNotFound>
<NullKeyNotAllowed>IgnoreError</NullKeyNotAllowed>
</ErrorConfiguration>
<Parallel>
<Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"
xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200"
xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300">
<Object>
<DatabaseID>MultidimensionalProject5</DatabaseID>
<CubeID>giri</CubeID>
<MeasureGroupID>Fact Internet Sales</MeasureGroupID>
</Object>
<Type>ProcessFull</Type>
<WriteBackTableCreation>UseExisting</WriteBackTableCreation>
</Process>
</Parallel>
</Batch>';
EXEC (@XMLA) At SHALL-PCAdventureWorksDw ;
iam executive the query when iam getting below error.
[Execute SQL Task] Error: Executing the query "DECLARE
@XMLA nvarchar(3000)
, @DateSerial nvarch..." failed with the following error: "Incorrect syntax near '-'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set
correctly, or connection not established correctly.
how to solve this error;
please help meWhat are you trying to do? What sort of data source is SHALL-PCAdventureWorksDw?
When you use EXEC() AT, I would execpt to see an SQL string to be passed to EXEC(), but you are passing an XML string????
If you explain why you think this would work in the first place, maybe we can help you.
Erland Sommarskog, SQL Server MVP, [email protected] -
Error executing dB Query help??
I'm creating a simple content management system with DW &
CF using an Access DB. I set up the DB in the CF Administrator as
Access with unicode.
My DB has several tables...users, usertypes, events,
eventtypes, reviews.
I built the usertype admin pages with no problems. Everything
is working well and my pages are interacting well with the
usertypes table in the db. I'm currently building the user admin
pages and now I'm having problems when I try to add records into
the users table. On my add page I've created a recordset with all
of my usertypes in it. Also, I'm using the record insertion form
wizard in DW.
I'm getting the following error:
Error Executing Database Query.
Syntax error in INSERT INTO statement.
The error occurred in
C:\CFusionMX7\wwwroot\pentanglecf\admin\users\add.cfm: line 64
62 : <cfelse>
63 : NULL
64 : </cfif>
65 : )
66 : </cfquery>
BTW, I'm using Dan Short's very good DW 8 Dynamic Development
tutorials on Lynda.Com. Has anyone used this before? Any help is
greatly appreciated.
Luis
Casegama.ComThanks Ken but I think I had posted the incorrect code for a
few minutes before I made the correction. Below is both the CF code
and the SQL command (also up above). I'm still having issues and
any help is greatly appreciated.
thanks,
Luis
Casegama.com
<cflock scope="Session" type="ReadOnly" timeout="30"
throwontimeout="no">
<cfset
MM_Username=Iif(IsDefined("Session.MM_Username"),"Session.MM_Username",DE(""))>
<cfset
MM_UserAuthorization=Iif(IsDefined("Session.MM_UserAuthorization"),"Session.MM_UserAuthor ization",DE(""))>
</cflock>
<cfif MM_Username EQ "" OR MM_UserAuthorization EQ "" OR
ListFind("1,2",MM_UserAuthorization) EQ 0>
<cfset MM_referer=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_referer=MM_referer & "?" &
CGI.QUERY_STRING>
</cfif>
<cfset MM_failureURL="login.cfm?accessdenied=" &
URLEncodedFormat(MM_referer)>
<cflocation url="#MM_failureURL#" addtoken="no">
</cfif>
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfif IsDefined("FORM.MM_InsertRecord") AND
FORM.MM_InsertRecord EQ "form1">
<cfquery datasource="#Request.DSN#">
INSERT INTO Users (Username, Password, FirstName, LastName,
EmailAddress, Admin, Allowed, UserTypeID)
VALUES (
<cfif IsDefined("FORM.Username") AND #FORM.Username# NEQ
"">
'#FORM.Username#'
<cfelse>
NULL
</cfif>
<cfif IsDefined("FORM.Password") AND #FORM.Password# NEQ
"">
'#FORM.Password#'
<cfelse>
NULL
</cfif>
<cfif IsDefined("FORM.FirstName") AND #FORM.FirstName# NEQ
"">
'#FORM.FirstName#'
<cfelse>
NULL
</cfif>
<cfif IsDefined("FORM.LastName") AND #FORM.LastName# NEQ
"">
'#FORM.LastName#'
<cfelse>
NULL
</cfif>
<cfif IsDefined("FORM.EmailAddress") AND
#FORM.EmailAddress# NEQ "">
'#FORM.EmailAddress#'
<cfelse>
NULL
</cfif>
<cfif IsDefined("FORM.Admin")>
Yes
<cfelse>
No
</cfif>
<cfif IsDefined("FORM.Allowed")>
Yes
<cfelse>
No
</cfif>
<cfif IsDefined("FORM.UserTypeID") AND #FORM.UserTypeID#
NEQ "">
#FORM.UserTypeID#
<cfelse>
NULL
</cfif>
</cfquery>
<cflocation url="index.cfm">
</cfif>
<cfquery name="rsUserTypes" datasource="#Request.DSN#">
SELECT *
FROM UserTypes
ORDER BY UserType ASC
</cfquery> -
Frequent "Error Executing Database Query" errors?
I am getting frequent "Error Executing Database Query. Timed
out trying to establish connection" errors after upgrading our
server to version 7. These errors only occur with applications that
use Access databases and eventually cause the server to freeze up
and I am forced to restart the ColdFusion service.
Any ideas on what might be causing this issue? I have applied
all the hot fixes, updaters, etc, and updated the JDBC drivers and
yet this problem still continues. Thanks.delete and re-create all you dsn.
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/ -
Hello ,
1) I used the function module from this link :
/people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
When I run it , I see the metadata correct and this is all. No more data to display.
2) Then I used the code from here :
/people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
MOVE: <variable name> TO wa_var-vnam ,
'I' TO wa_var-sign,
'EQ' TO wa_var-opt,
<variable value> TO wa_var-low .
query_variables = var
FUNCTION z_test_query.
FIELD-SYMBOLS: <outtab> TYPE ANY TABLE,
<l_line> TYPE ANY,
<l_field> TYPE ANY.
TYPE-POOLS: rrx1 .
DATA: wa_var TYPE rrx_var ,
var TYPE STANDARD TABLE OF rrx_var ,
xml_out TYPE string ,
breturn TYPE STANDARD TABLE OF bapiret2 ,
rpt_tech_id(50) ,
wa_meta TYPE zbw_query_output_metadata ,
xslt_error TYPE REF TO cx_xslt_exception ,
is_fieldcat TYPE lvc_s_fcat,
it_fieldcat TYPE lvc_t_fcat,
new_table TYPE REF TO data ,
xslt_message TYPE string ,
meta TYPE STANDARD TABLE OF zbw_query_output_metadata . " this structure was created in the previous part
*fill all the variables like below.
MOVE: 'SEM_PSG01/PSG___00000_080_V1' TO rpt_tech_id .
APPEND wa_var TO var .
CLEAR :xml_out .
REFRESH breturn .
CALL FUNCTION 'Z_QUERY_EXECUTE'
EXPORTING
query_name = rpt_tech_id
IMPORTING
xml_out = xml_out
TABLES
return = breturn
meta = meta
EXCEPTIONS
bad_value_combination = 1
user_not_authorized = 2
unknown_error = 3
query_not_found = 4
OTHERS = 5.
CASE sy-subrc .
WHEN 0 .
CLEAR: is_fieldcat, wa_meta .
REFRESH: it_fieldcat .
LOOP AT meta INTO wa_meta.
is_fieldcat-fieldname = wa_meta-fieldname.
is_fieldcat-outputlen = wa_meta-outputlen .
is_fieldcat-datatype = wa_meta-datatype.
is_fieldcat-scrtext_l = wa_meta-scrtext_l.
APPEND is_fieldcat TO it_fieldcat.
CLEAR : is_fieldcat .
ENDLOOP .
IF NOT it_fieldcat[] IS INITIAL .
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcat
IMPORTING
ep_table = new_table.
ASSIGN new_table->* TO <outtab>.
ENDIF .
TRY .
CALL TRANSFORMATION ('Z_GPS_TR')
SOURCE XML xml_out
RESULT outtab = <outtab>.
CATCH cx_xslt_exception INTO xslt_error.
xslt_message = xslt_error->get_text( ).
ENDTRY.
WHEN 1 .
WHEN 2 .
WHEN OTHERS .
ENDCASE .
{ENDFUNCTION.
'Z_GPS_TR' is my transformation (exactly the code from the blog).
'Z_QUERY_EXECUTE' is the function from 1). I did not use variables for the query parameter.
I see with the debugger that <outtab> is filled corectly, with the values from my query. Still , the function, when is runed normally, does not display anything.
3) If I run only the transformation Z_GPS_TR alone, it says invalid source XM source file.
Please, some suggestion? I don't know hot to proceed.
Many thanks.
Edited by: Ariana D on May 19, 2009 11:40 AMHi All
I able to solve this problem
Regards
Satrajit. -
Execute a query using ABAP (XSLT transformation issue)
Hello,
I made the steps from this blog (part I, II and III).
/people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
When trying to run the XSLT transformation, I got the message that : XML invalid source file.
I am not sure what are the steps for running a transformation, or running it for this case ,maybe something it's not ok. I just run it, did not provide any information.
Any suggestions ? Did anyone use the function module described in this blog ?
Thank you very much in advance.try giving
CALL TRANSFORMATION (`ID`)
SOURCE meta = meta_data[]
output = <ltable>[]
RESULT XML xml_out
OPTIONS xml_header = 'NO'.
and check - sometimes the codepages configured in the BW system tend to cause an issue... I am not sure if the syntax is right though - but you are basically trying to bypass any encoding that is happening in the query transformation....
http://www.sapetabap.com/ovidentia/index.php?tg=fileman&sAction=getFile&inl=1&id=4&gr=Y&path=ABAP%2FABAPENANGLAIS&file=ABAP-XML+Mapping.pdf&idf=41
Edited by: Arun Varadarajan on May 18, 2009 11:28 PM
Maybe you are looking for
-
Issue with variables and white space in powershell script that calls a command line command
Guys, I have a question regarding this script. Each time I run it, it creates the share, but with a space after it. Also I need help figuring out how to put in the variable for the folder path. Below is the code $Users=Import-Csv C:\users2.csv foreac
-
Visual Studio 2008 on a Macbook Air with Parallels/VMWare
Hi, I am looking to purchase an apple laptop to replace my ageing Windows behemoth. I am a developer who writes software on both the Windows and OSX platforms. At the moment, I have to write the Mac apps on my iMac, and the Windows apps on the laptop
-
Did I miss something or is there a place to set portal searches to open in a new window? Config somewhere?
-
Data Cache full - what is the soultion
Hello,<BR>I am using essbase. In this 7 are sparse members and 2 are dense members. I am using parallel calculation, with 3 threads. After loading the data when calculation starts it says an error "DATA CACHE FULL INCREASE THE DATA CACHE". I increase
-
After Effects hangs on "initializing Media Core"
I might be off subject here, but my AE CS6 would not complete the start up and simply hang at "INITIALIZING MEDIA CORE". After finding some info about that, but for CS5, apparently a Quick Time codec problem, I got rid of PERIAN, and all is well now,