Netezza Set Catalog expectiong 'To' or '=' although is should not - set

I am trying to change databaze in netezza sql - according to official documentation it should be SET CATALOG ;
However I am getting following error that 'TO' or '=' is expected:
error image
If I list all databases, it's definitely here:
list all databases
Any idea what's wrong?

Related

ODAC Field 'column_name' not found in query columns without alias or table name

Recently we've upgraded our ODAC(Oracle Data Access Components) to version 10.1.5. We started to notice a weird problem. When you execute a query, without specifying the table's name or alias it results in the following error: "Field column_name not found".
Example of working code:
select principalimagem.data_inicio from geral.principalimagem
Another example of working code:
select p.data_inicio from geral.principalimagem p
If you remove the table name or the "p" alias, it will result in an error, with the exactly message above.
For some of my clients, internally, It does not result in the error, but if I connect remotely(outside from their local network), it does. I already changed the TNSNames.ora alias to be exactly like theirs, but it did no good. Any clue from what I should look for?
Thanks.
Turns out the problem was firewall related. The error was very weird itself, and we had the same error sometimes while writing packages and procedures.
Thanks for the help

Laravel with PostgreSQL and Postgis point

I develop an application which allows to post(show) a list of restaurants according to the location(localization) of the user.
For that purpose, I have a base(basis) of datum containing bars with their latitudes-longitudes.
My database is under postgresql and I would like to use, all my back-service(back-office) is under Laravel. At present to add a POINT, I make: ST_GeogFromText('SRID=4326;(110 30)'), but on Laravel, the request SQL ( db:seed ) includes the ST_ guillement enter.
DB::table('establishments')->insert(['location' =>ST_GeogFromText(\'SRID=4326;POINT(-110 30)\'),]), but ST_GeogFromText is not a fonction --
The error message:
parse error - invalid geometry HINT: "ST"
How may I make to manage PostgreSQL-Postgis and Laravel?
ST_GeogFromText is a PostGIS function not a PHP/Laravel function, and you cannot wrap it in quotes (i.e. ""), as Laravel will then consider it a string.
Instead, pass a raw query expression like below:
DB::table('establishments')->insert([
'location' => DB::raw("ST_GeogFromText('SRID=4326;POINT(-110 30)')"),
// your other columns & values
]);

How can I use an OVER statement in spotfire when connected to an external database?

Usually, I have been using the following calculated column when importing the data from an excel file:
(Sum([Units]) - Sum([Units]) OVER (PreviousPeriod([Axis.Columns]))) / Sum([Units]) OVER (PreviousPeriod([Axis.Columns])) * 100 as [% Difference]
In this scenario, however, the data is coming directly from an Oracle database.
When I try to create the calculated column, I get the error message:
"Could not find function: 'PreviousPeriod' "
I have done some research and found that I should be using the THEN keyword, but I have the same problem when I try to insert it after the aggregated expression.
You need to import that date via an INFORMATION LINK or EMBED the data in your analysis in order to use the majority of the functions in SPOTFIRE. If you must keep your data EXTERNAL, that is not connected via in Information Link or Embedded, you will not be able to use all the functions within SPOTFIRE.

magmi - generic sql datasource 1.0.2 usage

Some questions arises when using MAGMI generic SQL datasource. Magmi 0.7.18 displays the following input information when using that plugin:
I tried several times with two approaches.
-the first one as described on the image was a direct query to the mysql database containing all rows to feed magento database using magmi. (no files on genericsql/requests)
-the second one using .sql file exported from my database and placing that file into (genericsql/requests).
in both cases I received the following statement: 1 warning(s) found Hide Details -> "No Records returned by datasource"
I read that some folks suggest to use input DB Initial Statement: SELECT COUNT(*) AS cnt FROM tablename but in my case it was the same.
question one: using mysql I can query mysql databse directy using the input db information (type, host, name, user, password) or I have to place the sql file in genericsql/requests too? is that my error?
question two: based on the fact that mysql cannot attach files - as MS sql can - which information do I have to place when magmi request user- pass for that sql file?
any help appreciated, I´m stuck with this issue and CSV is not suitable for my needs. brgds
by dweeves:
Your SELECT has to be put in a .sql file in the directory listed in red. (name it as you want as long as it ends with .sql extension)
The "Initial Statements" is a field that is meant to hold the "connection" time statements (like SET NAMES 'UTF8').
For the "quick count" , you might also add a .sql.count file in the same dir with the same name that the request you want to achieve.
By default magmi will find the count using a
SELECT COUNT(*) FROM (your request here)
see Generic SQL Datasource plugin documentation.

mysql: What is the right syntax for NOT LIKE?

Hi I am trying to show tables with names not like a pattern by mysql is throws an error:
SHOW TABLES NOT LIKE "tree%";
returns:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT LIKE "tree%"' at line 1
What is the right syntax?
Thanks Arman.
You could use the WHERE clause extension, as in:
SHOW TABLES WHERE `Tables_in_<DatabaseName>` NOT LIKE 'tree%';
This is supported on MySQL ≥5.0.
Reference:
12.4.5.39. SHOW TABLES Syntax.
20.28. Extensions to SHOW Statements.
LIKE and NOT LIKE are used with SELECT statements. I don't think this works with the SHOW TABLES command.
According to this feature request, this has been introduced in mySQL 5.0.3. However, people there disagree, and it doesn't work in my 5.1.41 installation, either.
I guess the answer is it's not possible.

Resources