How can I run a Postgres function from ZF1? - postgresql

I am trying to run a Postgres function from a ZF1 project, but I was unable ton find any useful tip on Google.
I tried running it via the $db->query() method, to no avail.
Thank you !

Thanks to #a_horse_with_no_name, here is the answer :
SELECT function_name()
We no FROM, or you'll have an error as I had !

Related

Is it possible to use Prisma with Vitess

I heard recently about how Planetscale which uses Vitess can be used with Prisma. At the moment I am using Postgres but would like to try out Vitess if possible. Some of my searches found that Prisma is tested against Vitess (https://github.com/prisma/prisma-engines/blob/c28057e8dafb64a3b980d1f816494b183d47cf52/docker-compose.yml) but I can't find any docs saying if its possible and how to get it working. Any help or direction would be greately appreciated.
Thanks
Paul

Tables/Functions Not getting created in Postgresql using DBeaver

I using DBeaver to connect to my postgresql and i am running commands to create table and to create functions and even tried to alter table. The SQL is running fine but no tables/functions are getting created.. It very weird.
Also using the same tool and i am able to create table and do other stuffs in other env but only in an particular env its giving me this issue. The issue is query is running fine but nothing is happening. Can you please help me in this?
Thanks.

mongo clone doesn't do anything

I am trying to clone a remote mongo db to a local one. I am attempting to follow these instructions:
http://docs.mongodb.org/manual/reference/command/clone/
In the mongo console I type:
clone: "username#example.com:password#mymongohost.com:10035"
and the console comes back with:
username#example.com:password#mymongohost.com:10035
What am I doing wrong?
Thanks,
Kevin
Have you tried db.cloneDatabase("username#example.com:password#mymongohost.com:10035") or alternatively passing the {clone: "..."} as argument to db.runCommand()?
I think you're just missing how you're supposed to use those commands as the documentation isn't making it very clear. If you followed the 'copydb' link you might've spotted the example using 'db.copyDatabase()' instead and started wondering maybe there's a wrapper function for clone as well.

How to set up cron job on CentOS

I don't know how to set up cron with ssh?
I opened ssh and typed "crontab -e". What do I do then?
I want to repeat the function every minute. I have this code as "cron command to run": php -f /var/www/vhosts/nf-test-host.tk/httpdocs/admin/cron/cron.php.
I am on CentOS. What should I do, exactly? Thanks in advance!
You can try out different timing values in the crontab sandbox. It will show you a list of run times. www.dataphyx.com/cronsandbox/.
Here is your answer:
http://drupal.org/node/23714
(If you are not running Drupal, that is fine, this still applies equally well to you.)
Let us know.
Use command:
sudo yum install vixie-cron crontabs
or look this
http://shanerutter.co.uk/2011/11/23/centos-installing-cron-cronjobs-or-cron-daemon-crond/

DB2 connect SQL1042C error

When I give DB2 CONNECT command I get the error saying "SQL1042C An unexpected system error occurred". The most weird thing is this issue is intermittant.
sqlcode: -1042;
sqlstate: 58004;
DB2 connect command: connect to dbname user db2admin using password;
My DB2 version is: DB2/NT64 9.5.0
There are a few directions in the Information Center on how you might be able to fix this error, one of which involves calling IBM for support.
Hope that helps!
Try to use
db2 "? sql-1042"
for more information.
On the other hand, if you just installed new db2 software code, try to use
db2iupdt instance_name
to update db2 instance.
You might find additional information in the file db2diag.log, which is located in a place like /home/db2inst1/sqllib/db2dump/db2diag.log . Or you can use the command db2diag with an option like db2diag -lastrecords 100
Actually SQL1042C can be happened with many reasons.
It's better to check db2diag.log first as it will give the idea about what this may be about.
And if that happens with DB activation by first connect,
db2stop
db2diag -A
db2start
db2 connect to dbname user db2admin using password
=> SQL1042C
Check what's recorded on new db2diag.log.
As William mentioned previously, 'db2iupdt' is the good attempt when you have no idea right away.
run db2iupdt,
looks like issues with binaries ,
let me know , when you got this error.
if possible upload following command output
db2diag -g 'level=Critical'