Connect Oracle database with SQLcl - oracle-sqldeveloper

I am using sqldeveloper to query database and export results to csv file. I need this file on daily basis so thought of creating bat file which can be scheduled on windows task scheduler. I was researching it and found I can use SQLcl to run my script to export the query data. But somehow I can't connect it and it gives me and error 'ORA-01017: invalid username/password;logon denied. Here is my connection properties from sql developer
Here is my command line:
sql testuser1/mypass#tstwd2.myhost.internal:1521/tst.internal
I have java development kit installed
Do I need anything for java? Or do I need any special rights to run sql command line?

Found the problem, my userid is in double quotes so I have to use escape sequence **\**, its working like a charm.

Related

postgreSQL online shell

I have installed postgreSQL multiple times because I did not know better in the past, and now I am having trouble running SQL shell (psql) on my desktop.
It would not let me log in, would not tell me all the versions that I have installed, would not let me change supervisor user.
However, I really need to find a way to run my SQL commands and output script style result (like the analog format you would get on SQL shell) in order to complete my homework.
I have already checked the results of my commands on pgadmin 4 on my browser, so I just have to run it and get script style output.
Do any of you know an online SQL shell that I can use?
Thank you.

How to make Oracle SQL Developer export NLS-safe SQL dumps?

I used Tools -> Database Export in Oracle SQL Developer 18.2.0 to generate full schema and data dump.
Then I attempted to use that dump in a shell script calling sqlplus and got the following error:
Insert into CONN.ACCOUNT (ID,CUSTOMER_ID,LAST_MODIFIED) values ('1','1',
to_timestamp('2018.09.06 17:45:29,000000000','RRRR.MM.DD HH24:MI:SSXFF'))
*
ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string
Most probably, that was caused by NLS settings in Oracle SQL Developer 18.2.0. I did not touch them, SQL Developer seems to have picked them up from default Windows settings.
Is there any way to make Oracle SQL Developer generate safe export dumps that could be later imported through sqlpus without manually hunting for all required NLS settings and adding them at the beginning of the sql dump file?

Export Postgres table to csv

I am trying to export my Postgres table to a csv on my desktop and I get this error:
ERROR: could not open file "C:\Users\blah\Desktop\countyreport.csv" for writing: Permission denied
SQL state: 42501
This is my query which I believe is the correct syntax
COPY countyreport TO 'C:\\Users\\blah\\Desktop\\countyreport.csv' DELIMITER ',' CSV HEADER;
According to the user manual:
Files named in a COPY command are read or written directly by the
server, not by the client application.
https://www.postgresql.org/docs/current/static/sql-copy.html
The common mistake is to believe that the filesystem access will be that of the (client) user, but it's not. It's normal to run the postgresql server as its own user. Therefore action carried out by the server will be done as a different OS user to the client. The server is usually run as an OS user postgres.
Assuming that you are running the server on your local machine then the simplest way to fix it would be to give postgres access to your home directory or desktop. This can be done by changing the windows security settings on your home directory.
Before you do this.... Stop and think. Is this what you are looking for? If the server is in development then will it always run on the user's machine. If not then you may need to use COPY to write to the stdout. See the manual for information on this.

Postgres EDB Run a sequence of sql files

I'm attempting to run a sequence of SQL files using PEM. From the Oracle database I used:
#path_to_file1.sql
#path_to_file2.sql
#path_to_file3.sql
How do I do this using Postgres Enterprise Manager (PEM) ?
Please note that i'm NOT USING a command line and I don't want to run a SINGLE file, but I'm using PEM on a windows machine to run a SEQUENCE of sql files in one shot.
Regards.

Could not find stored procedure 'LOGPARSER'

I installed Microsoft LogParser v2.2, it's on my machine, but this is what i'm getting when i run it:
Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'LOGPARSER'.
What am i doing wrong?
LogParser does not run in SQL Server. It is a separate program. You run it from the command line. Here are some usage examples from Microsoft.
It does use a SQL syntax, but it has nothing to do with SQL Server.
You say you installed it, Is this a software that installs a database or did you just added it to your Database?
Is your connection string pointing to that server?