Garbled lines

------_=_NextPart_001_01CBE9F3.0E56AD34
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,

I am not sure whether this is really a Perl problem but maybe anybody
can point me into the right direction: I am generating insert statements
and writing them into a file for later execution. Most of the lines are
written correctly:

insert into serverauslastung (durchfuehrung, umgebungsname, servername,
server_id, rqdone, timestamp) values ( v_sequence_nr, 'mvse', 'bektvi',
410, 3, to_date('110323-114751','YYMMDD-HH24MISS'));

insert into serverauslastung (durchfuehrung, umgebungsname, servername,
server_id, rqdone, timestamp) values ( v_sequence_nr, 'mvse', 'bektvs',
420, 7, to_date('110323-114751','YYMMDD-HH24MISS'));

but from time to time some of the following garbled lines appear in the
same file among the other correct lines:

> insert into serverauslastung (durchfuehrung, umgebungsname,
servername, server_id, rqdone, timestamp) values ( v_sequence_nr,
'mvse', 'mwvinusve1r't, i2n8t0o, s6e,r vteor_adusaltaes(t'u1n1g0
3(0d3u-r1c3h0f9u2e4h'r,u'nYgY,M MuDmDg-eHbHu2n4gMsInSaSm'e),)
;servername, server_id, rqdone, timestamp) values ( v_sequence_nr,
'mvse', 'pk12pa', 210, 65, to_date('110303-130924','YYMMDD-HH24MISS'));

--> insert into serverauslastung (durchfuehrung, umgebungsname,
servername, server_id, rqdone, timestamp) values ( v_sequence_nr,
'mvse', 'mwvuv1', 280, 6, to_date('110303-130924','YYMMDD-HH24MISS'));

--> insert into server_auslastung (durchfuehrung, umgebungsname,
servername, server_id, rqdone, timestamp) values ( v_sequence_nr,
'mvse', 'pk12pa', 210, 65, to_date('110303-130924','YYMMDD-HH24MISS'));

Obviously, two insert statements get mixed and characters from both
statements are written alternately. But how does this happen? Is this a
Perl problem or could this be a buffer problem on the AIX server? Thanks
for any hints!

Kind regards,
Nora




------_=_NextPart_001_01CBE9F3.0E56AD34--
HACKER Nora [ Do, 24 März 2011 08:14 ] [ ID #2057092 ]

Re: Garbled lines

On Thu, Mar 24, 2011 at 03:14, HACKER Nora <nora.hacker [at] stgkk.at> wrote:
snip
> I am not sure whether this is really a Perl problem but maybe anybody
> can point me into the right direction: I am generating insert statements
> and writing them into a file for later execution. Most of the lines are
> written correctly:
smnip
> but from time to time some of the following garbled lines appear in the
> same file among the other correct lines:
snip
> Obviously, two insert statements get mixed and characters from both
> statements are written alternately. But how does this happen? Is this a
> Perl problem or could this be a buffer problem on the AIX server?
snip

Without seeing the code, or at least being told how you are writing to
the file (for instance, are you writing to a named pipe that is being
read by another program), it is nearly impossible to give you any
hints about what is going on.

--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
chas.owens [ Do, 24 März 2011 10:21 ] [ ID #2057093 ]

Re: Garbled lines

On 2011-03-24 08:14, HACKER Nora wrote:

> characters from both statements are written alternately.

Check out perlvar, look for OUTPUT_AUTOFLUSH.

--
Ruud

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
rvtol+usenet [ Do, 24 März 2011 09:49 ] [ ID #2057095 ]

Re: Garbled lines

From: "HACKER Nora" <nora.hacker [at] stgkk.at>
> I am not sure whether this is really a Perl problem but maybe anybody
> can point me into the right direction: I am generating insert statements
> and writing them into a file for later execution. Most of the lines are
> written correctly:
>
> <snipped>
>
> Obviously, two insert statements get mixed and characters from both
> statements are written alternately. But how does this happen? Is this a
> Perl problem or could this be a buffer problem on the AIX server? Thanks
> for any hints!

There are several instances of the script running at the same time
writing into the same file? It would be better to give each instance
its own file and then (if necessary) merge the files.
Otherwise you'd have to use some IPC tools (semaphores or something)
to control access to the file and flush the buffers correcrly to
prevent such problems.

Jenda
===== Jenda [at] Krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Jenda Krynicky [ Fr, 25 März 2011 22:55 ] [ ID #2057220 ]
Perl » gmane.comp.lang.perl.beginners » Garbled lines

Vorheriges Thema: PROBLEM
Nächstes Thema: foreach loop