unixodbc

Return IDs of inserted values PDO to MSSQL using ODBC

落爺英雄遲暮 提交于 2019-12-02 11:41:50
I need to get an array of id's of the subscribers added to the database within this function: function insert_test($pdo, $fullname, $email) { if ($SQL = $pdo->prepare("INSERT INTO subscribers ([dateAdded],[dateUpdated],[fullname],[email],[isActive]) VALUES (GETDATE(), GETDATE(), :fullname, :email, 1)")) { $SQL->bindValue(':fullname', $fullname, PDO::PARAM_STR); $SQL->bindValue(':email', $email, PDO::PARAM_STR); $SQL->execute(); return array('status'=> true); } else { return array('status'=> false); } } However I am stuggling with figuring out how to get the values and return them within the

Microsoft® ODBC Driver 11 for SQL Server® on RedHat Linux with PHP - gives an error when bind parameter with PDO for stored procedures

可紊 提交于 2019-12-02 07:29:38
Without any parameters it will works fine, but when parameters are there, gives the following error - SQLSTATE[42000]: Syntax error or access violation: 8018 [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid parameter 4 (''): Data type 0x23 is a deprecated large object, or LOB, but is marked as output parameter. Deprecated types are not supported as output parameters. Use current large object t (SQLExecute[8018] at /builddir/build/BUILD/php-5.3.3/ext/pdo_odbc/odbc_stmt.c:254) This runs on Centos 6 , ODBC Driver 11 for SQL Server® - RedHat Linux , unixODBC-2.3.0 , MSSQL Server 2008

odbc_prepare gives Fatal error: Allowed memory size exhausted

三世轮回 提交于 2019-12-01 23:43:14
I have a Debian server (64 bits) and I want to connect it to a AS400's database through PHP. I have installed the IBM i Access for Linux and unixodbc. I have followed this tutorial: https://www.albertopicado.es/conexion-odbc-con-base-de-datos-db2-en-un-servidor-ibm-iseries/ although it's in spanish you can see the proccess I have followed. The thing is that I can make a simple connection like: $server= 'DRIVER={DRIVER_NAME};DATABASE=DATABASENAME;SYSTEM=IP;HOSTNAME=IP;PORT=NUMBER_OF_THE_PORT;PROTOCOL=TCPIP;'; $as400= odbc_connect($server, "username", "password"); $as400 ? echo "ok" : echo "ko";

Using typed bound parameters with PHP PDO-ODBC, unixODBC and FreeTDS

馋奶兔 提交于 2019-12-01 17:16:46
I'm using the following setup to access a MS-SQL database from a PHP application RedHat Enterprise Linux 5 PHP 5.2.14 with PDO and PDO_ODBC unixODBC 2.2.11 FreeTDS 0.82.1.dev.20100810 Unparametrized queries work fine. The only issue is being forced to close cursor on single result statements (with PDOStatment::closeCursor) to avoid "0 [FreeTDS][SQL Server] Invalid cursor state (SQLSTATE=24000)" errors. But I'm having a major issue with typed bound parameter. When using code like this: $stmt = $PDO->prepare('INSERT INTO table (column1, column2) VALUES (:foo, :bar'); $stmt->bindValue(':foo', 21,

unixODBC giving error while running isql [Vertica]

谁都会走 提交于 2019-12-01 15:32:45
Hi I have configured the DSN settings for vertica in Ubuntu 10.10 32 bit version machine. The settings are all fine and I have cross checked them. Here is my odbc.ini file: [VerticaDSN] Description = VerticaDSN ODBC driver Driver = /opt/vertica/lib/libverticaodbc_unixodbc.so Servername = myservername Database = mydbname Port = 5433 UserName = myuname Password = ******* Locale = en_US Similarly I have a odbcinst.ini file. when I run the command: isql -v VerticaDSN I get the following error: [S1000][unixODBC][DSI] The error message NoSQLGetPrivateProfileString could not be found in the en-US

Django2.1连接使用SQL Server(linux版)

☆樱花仙子☆ 提交于 2019-12-01 13:30:26
声明 本人示例环境: 系统版本:centos7.1 64位 数据库版本:SQL Server2012 python版本:Python 3.6.3 Django版本:Django2.1 连接数据库工具:pyodbc,Microsoft ODBC Driver 之前已经写过一篇《python3连接使用SQL Server数据库(linux版)》,但发现Django进行连接时还是比较繁琐和头疼的,所以现在写个专门针对 linux + Django + SQL Server 组合的文章,在这里并没有使用freetds驱动开源工具,而是使用了和Windows一样的Microsoft ODBC Driver 11 for linux版,微软专门为linux用户开发支持的SQL server 驱动 Microsoft ODBC Driver 11 for linux 下载地址[linux6和linux7通用,实测centos7可用] wget http://download.microsoft.com/download/6/A/B/6AB27E13-46AE-4CE9-AFFD-406367CADC1D/Linux6/sqlncli-11.0.1790.0.tar.gz 如果你需要更高版本的驱动程序请转到官网下载,附官网地址(建议旧版安装成功后再选择性升级) https://docs

php + unixODBC + DB2 + DESCRIBE = token not valid?

六月ゝ 毕业季﹏ 提交于 2019-12-01 12:21:10
Code I am trying to run: $query = "DESCRIBE TABLE TABLENAME"; $result = odbc_exec($h, $query); The result: PHP Warning: odbc_exec(): SQL error: [unixODBC][IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token TABLENAME was not valid. Valid tokens: INTO., SQL state 37000 in SQLExecDirect in ... There were no other problems with SELECT, INSERT, UPDATE or DELETE queries on the same connection. Is this a syntax error? The iSeries flavor of DB2 does not support the SQL DESCRIBE statement. Instead, you have to query the system table: select * from qsys2.columns where table_schema = 'my_schema'

php + unixODBC + DB2 + DESCRIBE = token not valid?

大憨熊 提交于 2019-12-01 09:41:55
问题 Code I am trying to run: $query = "DESCRIBE TABLE TABLENAME"; $result = odbc_exec($h, $query); The result: PHP Warning: odbc_exec(): SQL error: [unixODBC][IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token TABLENAME was not valid. Valid tokens: INTO., SQL state 37000 in SQLExecDirect in ... There were no other problems with SELECT, INSERT, UPDATE or DELETE queries on the same connection. Is this a syntax error? 回答1: The iSeries flavor of DB2 does not support the SQL DESCRIBE statement.

Install unixODBC >= 2.3.1 on Linux Redhat/CentOS for msodbcsql17

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 06:50:26
I try to install msodbcsql17 on AWS EC2 with CentOS/RedHat (Linux). These are the steps, I have followed, from Microsoft ( LINK ): sudo su #Download appropriate package for the OS version #Choose only ONE of the following, corresponding to your OS version #RedHat Enterprise Server 6 curl https://packages.microsoft.com/config/rhel/6/prod.repo > /etc/yum.repos.d/mssql-release.repo #RedHat Enterprise Server 7 curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo exit sudo yum remove unixODBC-utf16 unixODBC-utf16-devel #to avoid conflicts sudo ACCEPT

Install unixODBC >= 2.3.1 on Linux Redhat/CentOS for msodbcsql17

余生颓废 提交于 2019-12-01 04:24:39
问题 I try to install msodbcsql17 on AWS EC2 with CentOS/RedHat (Linux). These are the steps, I have followed, from Microsoft (LINK): sudo su #Download appropriate package for the OS version #Choose only ONE of the following, corresponding to your OS version #RedHat Enterprise Server 6 curl https://packages.microsoft.com/config/rhel/6/prod.repo > /etc/yum.repos.d/mssql-release.repo #RedHat Enterprise Server 7 curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql