Whenever I execute this query:
SELECT ST_Length3D(ST_GeomFromEWKT('LINESTRING(0 0 0,5 0 3,5 10 5)')); in postgresql it is throwing an error like ERROR: function st_length3d(geometry) does not exist SQL state: 42883
but this query running fine and showing result SELECT ST_Length(ST_GeomFromEWKT('LINESTRING(0 0 0,5 0 3,5 10 5)'));
It seems that ST_Length3D is not added in my system defined function any idea how to recover this ?
Try ST_3DLength.
The function was renamed from ST_Length3D to ST_3DLength in PostGIS 2.0.
Related
I am upgrading ci 2 to ci 3.11
I have done all the changes in upgrading,
Still i get this error
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE id = 'gr6rnf66t7d20oqlkocr5ate3nlg3equ'' at line 2
SELECT 1 WHERE id = 'gr6rnf66t7d20oqlkocr5ate3nlg3equ'
Filename: D:/xampp/htdocs/XXXX/system/database/DB_driver.php
Line Number: 691
I want to know from while file this database querying.
Just now i found that if i change
$config['sess_cookie_name'] = 'ci_session';
this value id in the query is changing
For now i changed to sess_driver to files in config to work
I didn't give $config['sess_save_path'] = 'ci_sessions'; (Its the table name of session)
I'm executing the following stored procedure:
rows, err := w.repo.GetConn().Queryx("EXEC [Users].[User_Get] #ids", sql.Named("ids", tvp))
And getting the following error:
SQL: expected 0 arguments, got 1.
What's wrong and how to fix this?
The problem was in driverName I put mssql there instead of sqlserver)
Maybe it is a case of me looking at this for too long. But I have this Oracle update query I am trying to run, I have verified the query works with hardcoded values on SQL Developer, howver when I run it from my flow Mule it fails.can anybody tell me what I am doing wrong?
Here is the query:
<db:update config-ref="DBConf" doc:name="abcd">
<db:dynamic-query><![CDATA[UPDATE myTable
SET TYPE= 'Entry',
ENTERED_DATE=SYSDATE,
ENTRY_BY= 2345,
ENTRY_DATE=TO_DATE('#[flowVars.entryDate]','YYYY-MM-DD')
WHERE ID = 'abcd1234']]>
</db:dynamic-query>
</db:update>
the flowVars.entryDate value is '2017-05-10'
This throws the following Error:
Message : ORA-01841: (full) year must be between -4713 and +9999, and not be 0
(java.sql.SQLDataException). Message payload is of type: Integer
Now the same query works like I said in SQL Developer but not in Mule, Can anybody provide any input
You can find the same problem answer in the following link:
Oracle: year must be between -4713 and +9999, and not be 0
Try this once. TO_DATE('2012-05-12','yyyy-mm-dd').
Delete the quotes for the #[flowvar.entrydate]
I'm doing "Multidimensional Project" with MS SQL Server 2012 (Server Data Tools - Visual Studio 2010 Shell). I can't run (debug) it.
If the data source's impersonation information is set to "use the service account", this error occures:
Error 2 Internal error: The operation terminated unsuccessfully. 0 0
Error 3 OLE DB error: OLE DB or ODBC error: Login failed for user 'NT Service\MSSQLServerOLAPService'.; 28000. 0 0
Error 4 Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'Data Warehouse', Name of 'Data Warehouse'. 0 0
Error 5 Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'Items', Name of 'Items' was being processed. 0 0
Error 6 Errors in the OLAP storage engine: An error occurred while the 'Id' attribute of the 'Items' dimension from the 'Warehouse_MultidimensionalProject_Cube' database was being processed. 0 0
Error 7 Server: The current operation was cancelled because another operation in the transaction failed. 0 0
I guessed that this account has no premissions but (1) I coudn't even add this account (it seems that it doesn't exist) and (2) how is that even possible for it to not have built-it poremissions?
When I'm setting impersonation to "use the credentials of current user" (which is the owner of the data source, btw.), another error occures:
Error 2 Internal error: The operation terminated unsuccessfully. 0 0
Error 3 The datasource, 'Data Warehouse', contains an ImpersonationMode that is not supported for processing operations. 0 0
Error 4 Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'Data Warehouse', Name of 'Data Warehouse'. 0 0
Error 5 Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'Items', Name of 'Items' was being processed. 0 0
Error 6 Errors in the OLAP storage engine: An error occurred while the 'Id' attribute of the 'Items' dimension from the 'Warehouse_MultidimensionalProject_Cube' database was being processed. 0 0
Error 7 Server: The current operation was cancelled because another operation in the transaction failed. 0 0
Any help?
The password musn't be set to blank for SQL Server to work properly... curious detail. :-)
In postgres you can do a comparison against multiple items like so:
SELECT 'test' IN ('not','in','here');
Which is the same as doing:
SELECT ('test' = 'not' OR 'test' = 'in' OR 'test' = 'here');
Is there a functional equivalent for SQL Server ?
It is supported, but you will need to put the expression somewhere that accepts a boolean expression. For example, in a case statement:
select case when 'test' in ('not','in','here') then 1 else 0 end
-----------
0
(1 row(s) affected)
Or a where clause:
select * from T where C in (1,3,5,7,9)
this should give similar results in all recent versions of MSSQL. You could also write a scalar function to shorten things up a bit.
select case
when 'test' IN ('not', 'in', 'here') then 1
else 0
end;
This will give 1 if 'test' is in the comparison set 1 or more times, or 0 if it isn't.
SELECT CAST(COUNT(*) AS BIT) as IsItHere WHERE 'test' IN('not','in','here')
Note that the cast isn't strictly necessary, but may be useful if this is called from another language... It should then resolve to a boolean.
EDIT: According to MSSQL Query planner, this is executed ~4 times faster then the CASE method. YMMV.