Questions tagged [perl]

The tag has no usage guidance.

1
vote
2answers
61 views

Reading data from oracle 8 in 2019

I'm an intern stuck dealing with a database system that is as old as I am. The Issue: I have a perl script pulling data from a server running Oracle 8 (8.1.7) and placing the data into a .csv. The ...
2
votes
2answers
58 views

Convert Ruby regex to Postgres regex, for selecting invalid email addresses

I've done some internet trawling, and some reading of the Postgres regex docs, but I'm at the stage where I think asking a question here is the best thing to do. I have the following Ruby regex: /\A[...
0
votes
1answer
206 views

Msg 102, Level 15, State 1, Server DESKTOP-U368A1B, Line 1 Incorrect syntax near '1'

I get the above error message when i run the following perl script from the cmd, that is supposed to do some transaction in my database. #!/usr/bin/perl. use warnings; use strict; my ( $pid1, $...
5
votes
1answer
113 views

Kill infinite loop plperl

How can I kill session with infinite looped plperl function? Both pg_terminate_backend and pg_cancel_backend had no effect. kill -1 pid did nothing as well and kill -9 pid crashed server.
-2
votes
2answers
34 views

Plperlu func with column as param [closed]

I have postgres 9.5, and want to use plperlu as lang to get result from curl put My func is: create or replace function langDetect(str text) returns text as $$ use warnings; use strict; my $str = $_[...
0
votes
0answers
119 views

How to install pgperl for postgresql 9.6 windows [duplicate]

Trying various versions of ActiveState and Strawberry Perl, I'm still not having any luck overcoming: pg96/lib/postgresql/plperl.dll: The specified module could not be found Suggestions that may ...
4
votes
1answer
2k views

How to create an alphanumeric sequence like AAAA0000 and so on

I want to create an alphanumeric sequence like this: AAAA0000 AAAA0001 AAAA0002 AAAA0003 . . . AAAA9999 AAAB0000 AAAB0001 . . . ZZZZ9999 I have created this store procedure to do that but its too ...
2
votes
2answers
1k views

Installing a language with Amazon RDS?

I am using an instance of Postgres on RDS and I am trying to run: => create language plperlu; but I get: ERROR: must be superuser to create procedural language "plperlu" If I run: => grant ...
1
vote
1answer
44 views

Why would Mysql's Round(N.DD,1) sometimes show no digits after the decimal place when using the Perl DBI?

We have a set of calculations that do something like SELECT ROUND(SUM(ROUND(3*IP))/3,1) as IP_sum from .... Say for example that IP_sum is exactly 180. When we call from the mysql client we get 180....
2
votes
1answer
2k views

Character Encoding in Postgres

I have UTF8 data stored in Postgres. I can query it with a Perl script and display it properly. When I use the Postgres client, it displays like the encoding is off. I'll see characters displayed ...
0
votes
0answers
670 views

Import Oracle dump from Amazon RDS

I have successfully transferred my dump files to my RDS database instance based on http://d0.awsstatic.com/whitepapers/strategies-for-migrating-oracle-database-to-aws.pdf Now, I want to reverse ...
1
vote
1answer
68 views

Postgresql perl : “NOTICE: elseif should be elsif at line …”

It's not the first time I get this strange NOTICE when adding perl functions in Postgresql : NOTICE: elseif should be elsif at line 11. This happens at CREATE FUNCTION as well as when using the ...
1
vote
2answers
572 views

Storing blobs outside the database

I had a PostgreSQL database with loads of scanned documents, as a document bytea column in the table scans, with hundreds of thousands of documents that was large and inconvenient to backup. Also, ...
2
votes
1answer
134 views

pt-table-sync fails “Turning off AutoCommit”

While trying to use pt-table-sync with the following options for a list of slaves: pt-table-sync --print --replicate schema.checksum_table --sync-to-master slave-001 I receive the following error ...
-1
votes
1answer
138 views

How we can make database resumable in perl script

I have a Perl code which connects with database and scan data from different different table. I face a problem if I lose my connection: it roll back all the transaction. How could I make the Perl ...
2
votes
1answer
2k views

DBD::mysql complains “Character set 'latin1' is not a compiled character set”

I think this boils down to "Am I doomed to upgrading mysql hoping the problem goes away?". I've seen a few of the same issues around the internet but with no guidance on a fix other than "Did you turn ...
1
vote
2answers
2k views

Perl - MySQL/MariaDB - slow with no identifiable bottleneck

I am running a Perl script (using DBI) which reads from raw files from a hard disk, and updates MySQL database (which is on a separate SSD). My performance is rather slow (1000 files processed in 30-...
3
votes
2answers
669 views

How can I load 'utf8' into plperl by default?

I am attempting to solve a problem explained in another question here. On Debian 7.4 with Postgres 9.1.12, I am able to use the Perl qr operator just fine. On Solaris 5.11 with Postgres 9.2.4, ...
0
votes
1answer
1k views

How to generate current Oracle timestamp in perl?

I use DBI. And I want to make some like INSERT INTO ... VALUES (the_generated_timestamp, ...); What is the command? How could it be created, the perl ``ocaltimescalar value has a very complex, for ...
3
votes
2answers
2k views

Perl DBI takes 60 seconds to connect to an Oracle database, every single time

I feel like I must be doing something wrong with my SQL connections. I've generally ignored it, but I'm finally going to try and get to the bottom of this. my $dsn = "DBI:Oracle:host=$host;sid=$sid";...
1
vote
1answer
6k views

Create Language plperl - Error: could not load library plperl.dll

When I create language plperl , I get error: ERROR: could not load library "C:/Program Files/PostgreSQL/9.1/lib/plperl.dll": The specified module could not be found. But in my computer, "plperl.dll"...
0
votes
1answer
736 views

Cannot create perlplu function

Running PostgreSQL 9.1.8 on Xubuntu 12.04, installed from the repos. From the shell, I have executed: createlang plperl db_name; createlang plperlu db_name; As the superuser running psql, I have ...
0
votes
3answers
5k views

How to avoid deadlock while updating 2 rows in MySQL

This is a interview problem: There is a perl program that updates the database, and it could run in different processes. One process may execute a transaction like: update row A -> update ...
1
vote
1answer
954 views

Sybase Database Migration from 11.5 to 15

I have to migrate the Sybase Database from 11.5 version to 15. I would like to know few things mentioned below - i) What are the neccessary steps I need to follow in this migration. ii) What are the ...
1
vote
4answers
1k views

Backup and restore of RDBMS(Oracle, DB2, SQL Server) from Perl

What could be the best approach ? Till now could figure out the following (Oracle) Calling exp.exe and imp.exe utilities in Oracle client using Java and inturn call it from Perl. Calling exp.exe and ...
2
votes
2answers
7k views

Limit WHERE to MAX() & COUNT()

This is my current mySQL query: SELECT e.*, MAX(m.datetime) AS unread_last, COUNT(m.id) AS unread FROM TAB_EVENT e LEFT JOIN TAB_MESSAGE m ON e.id=m.event_id WHERE ( m.`read` IS NULL OR m.`read`...
1
vote
1answer
176 views

Sybase internal tables for ORM generation

I am working on a Perl application that uses DBIx::Class::Schema::Loader in order to generate the ORM layer of the application, against a Sybase ASE 15.5 database. We recently migrated from Sybase 12....
5
votes
1answer
1k views

PostgreSQL pl/perl trigger, differentiate null vs empty

I've been trying to speed up a generic auditing trigger that I had written in pl/pgsql some time back. On update, it generates a list of columns in the table being updated and inserts rows in the ...
6
votes
1answer
674 views

How can I create and initialize a schema for a embedded MySQL DB?

I want to create an embedded MySQL database for running tests, but I'm not sure how to do it. How do I initialize the database? How do I run my create table statements? I'm using Perl, so it needs ...