FreeTDS SQL Server Invalid data type - django

I am using Ubuntu. I want to access Microsoft sql database using pyodbc in django. I installed all requirements. To do that, I wrote this
cursor.execute('SELECT Id FROM %s' %table_name)
I am getting error which is
[HY004] [FreeTDS][SQL Server]Invalid data type (0) (SQLBindParameter)')
But, when I try this
cursor.execute('SELECT * FROM mytable')
It works fine. Why do I see that error, Is there a way to solve that issue ?

SQL Server doesn't support variables for table names. Try building the whole statement as a string and then executing it.

Related

Internal Error in Redmine Initialization phase

I'm trying to setup Redmine on the following products
redmine-4.0.7
Rails 5.2.4.2
Phusion Passenger 6.0.7
Apache/2.4.6
mysql Ver 14.14
I expected there will be initializing page however, I got `Internal Error' from http://mydomain/redmine/
I can see the following messages in log/prduction.log
Completed 500 Internal Server Error in 21ms (ActiveRecord: 1.5ms)
ActiveRecord::StatementInvalid (Mysql2::Error: Can't find file: './redmine/settings.frm' (errno: 13 - Permission denied): SHOW FULL FIELDS FROM `settings`):
It seems I need ./redmine/settings.frm but there isn't.
Does anyone know how to place ./redmine/settings.frm and what content should be in?
The error is thrown by your database server (i.e. MySQL). It seems that MySQL does not have the required permission to access the files where it stores the table data.
Usually, those files are handled (i.e. created, updated, and eventually deleted) entirely by MySQL which requires specific access patterns to ensure consistent data. Because of that, you should strongly avoid to manually change any files under control of MySQL. Instead, you should only use SQL commands to update table structures and table data.
o fix this issue now, you need to fix the permissions of your MySQL data files so that MySQL can properly access them. What exactly is required here is unfortunately not simply explained since there can be various causes. If you have jsut setup your MySQL server, it might be best start entirely new.

Connect to database with Amazon Redshift

Trying to do something really simple, not sure why it's not working.
I downloaded SQL workbench and connected to my Redshift driver. Connection is fine. I created a database using CREATE DATABASE dbexample
Now I'm trying to connect to the database. I've tried \c dbexample and \connect dbexample and am getting the following error:
An error occurred when executing the SQL command:
\connect dbname
[Amazon](500310) Invalid operation: syntax error at or near "\"
Position: 1;
\connect dbname
^
1 statement failed.
Anyone know why it's not connecting?
The \backslash commands are specific to the psql utility and are not generic SQL commands for use in a product such as SQL Workbench.
Instead, specify the database name when you connect SQL Workbench to the database.
Provide the name of the database in the URL itself:

MySQL insert query work on sql managers but not from within php code

Im using WampServer and when i run this query:
insert into users (pname,puname,email,psw,Addr,Gps,Mob,Ass,About,Pic,Prev,Want,Pt,Rate,Dat)
values ("aaa","admin","a#a.a","a","a","33.3216452,44.35840350000001","11111111111",
"","","img/icon.png",0,0,0,0,"2014-01-15 08:04:32");
from phpmyadmin it works good but when i run it from browser (php code) i got this error:
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 '"aaa","admin","a#a.a","a","a",' at line 1
and when i run it from ems manager it say "Query OK, 1 rows affected" but no row added

Sitecore & Oracle: 'Unhandled Execution Error' while connecting

I'm trying to run Sitecore 7 with Oracle and I'm stuck on an error. What I've done is
Let a DBA create all Oracle users / schemas / tables
Verified with Oracle SQL Developer that the databases are indeed created, accessible and containing tables
Make sure I'm using the correct web.config
Update my connection strings
Do all the other Sitecore setup that I would normally do (IIS site, VS solution, etc.)
Install Oracle Client tools (including all possible drivers for my 64-bit system)
I've tried two variations of connection strings:
user id=my_username;password=my_password;Data
Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=my_host_name)(PORT=5151))(CONNECT_DATA=(SERVICE_NAME=my_service_name)))
and this one:
Data Source=my_username/my_password#//my_host_name:5151/my_service_name
Using the exact same information, I'm perfectly able to connect using the Oracle SQL Developer.
When I launch my Sitecore site, I get the following exception:
Unhandled Execution Error
Exception Details: Oracle.DataAccess.Client.OracleException:
[OracleException (0x80004005)]
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32
isRecoverable) +1250
Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode,
OracleConnection conn, IntPtr opsErrCtx, Object src) +91
Oracle.DataAccess.Client.OracleConnection.Open() +4698
....snipped...
Been struggling with this for a day now and would really appreciate some help.
Anyone out there running Sitecore 7 on Oracle?
Make sure that you are using the Oracle client tools version 11g, other Oracle versions are not supported with Sitecore 7.
See this link for a reference

INFORMATICA LOADING ERROR

I am newbie to informatica.
I am using INFORMATICA 9.1.0 and oracle 11g as source and target database.
I tried to create one table in target database and tried to load data from source to target.
Table is getting created in target database. and I created mapping and workflow which is valid and i start work flow but it gave me following error.
Message Code RR_4036
Message
Error connecting to database [ Arun
ORA-00900: invalid SQL statement
Database driver error...
Function Name : executeDirect
SQL Stmt : Arun
Oracle Fatal Error
Database driver error...
Function Name : ExecuteDirect
Oracle Fatal Error
].
please help me with good solutions.
I got solution for this.
Previously while creating remote connection in Relational Connection Editor for a session, In code page option i chose "UTF-8 encoding of unicode". Now i changed to "ms windows latin 1 (ansi) superset of latin1" and I restarted the workflow which is succeeded.
The following video link shows how to create relational connection for a session.
http://www.youtube.com/watch?v=oM2d-IHfRUw