ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
While using ISQL in linux for POSTGRES, I am able to make a connection to the database and execute select/update/insert/delete statements on tables.
But I am unable to execute create/drop/grant statements. I am getting error as below,
1.CREATE
SQL> create table shop (item1 integer);
[S1000]ERROR: syntax error at or near "create" at character 29;
Error while executing the query
[ISQL]ERROR: Could not SQLExecute
SQL> create table shop (item1 int);
[S1000]ERROR: syntax error at or near "create" at character 29;
Error while executing the query
[ISQL]ERROR: Could not SQLExecute
2.DROP
SQL> drop table persons2;
[S1000]ERROR: syntax error at or near "drop" at character 29;
Error while executing the query
[ISQL]ERROR: Could not SQLExecute
3.SELECT
SQL> select * from persons2;
| personid | pname
+------------+----------------------------------------------------------
------------+
| 1 | test1
| 2 | test2
| 3 | test3
| 4 | test4
SQLRowCount returns 4
4 rows fetched
Grant does not work as well. Is this a permission issue? Please find my permissions below
SQL> SELECT rolname, rolsuper, rolcreaterole FROM pg_roles WHERE rolname
= 'me';
+-----------+---------+--------------+
| rolname | rolsuper| rolcreaterole|
+-----------+---------+--------------+
| me | 1 | 0 |
+-----------+---------+--------------+
Also I am unable to find any documents for ISQL to check how to find the roles, permissions of a user etc.
I am able to execute all the above statements using PSQL in linux though.
I am using RM/COBOL InstantSql to access postgreSql. InstantSQL is an interface that allows access to ODBC drivers using a COBOL-like set of statements
The issue occured when I connect to isql using my userid and password.
$isql dbname userid (with password it does not let me connect at all thought it is the correct password)
SQL> create table test4 (id int);
[ISQL]ERROR: Could not SQLExecute
SQL> quit
But when I connect to just with the dbname I could create table,
$ isql dbname
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> create table test4 (id int);
SQLRowCount returns 0
It sounds to me as if you haven't setup the ini file correctly/at all.
It may also be that your 'username' hasn't been given enough rights to create etc.
Ask your DBA.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.