Page 1 of 1

Read from Text File - variable is different than file

Posted: Tue May 03, 2011 6:50 am
by Marko
Hi

I have an oracle scripts to read and I noticed that variable has different content than script.
I used function Read from Text File:
#readall\c:\temp\script.pcb

Content of the script was:
select FROM V$VERSION
where upper(banner) like '%ORACLE%';

Content of the variable was:
select FROM V1.0newline$where upper(banner) like '%ORACLE%';

After some trying my conclusion was:
- text $VERSION in combination with some character and CRLF produces the same result as $VERSION$
- text $VERSION in combination without some character and with CRLF produces the correct result

Is this a bug?
Can be avoided considered that this example is the part of the lager script?

Regards
Marko

Re: Read from Text File - variable is different than file

Posted: Tue May 03, 2011 8:16 am
by giaviv
Marko,

What combinations of character exactly cause this?

Re: Read from Text File - variable is different than file

Posted: Tue May 03, 2011 12:52 pm
by Marko
Aviv,

any combination was cousing this behaviour.

And I noticed another thing.
I tried to read the script line by line in the loop and the same thing happened.
Reading one line is OK.
So I assume that reading the all file does the same and that the problem lies in concenating the lines into the variable.


Regards
Marko

Re: Read from Text File - variable is different than file

Posted: Tue May 03, 2011 4:59 pm
by giaviv
Dear Marko,

Could you please attach your text file?

Re: Read from Text File - variable is different than file

Posted: Tue May 03, 2011 11:32 pm
by Marko
Aviv,

there is the file attached.
Pay attention to line 6.


Regards
Marko

Re: Read from Text File - variable is different than file

Posted: Wed May 04, 2011 12:02 am
by Marko
Aviv,

I think I found out what happened.
I created two variables. First one (VAR1) had a value $VERSION and the other one (VAR2) had a value $NEWLINE$some_text.
Then I set a third variable to $VAR1$$VAR2$.
Result was 1.0VAR1$ where 1.0 represents the version of program.


Hope this helps
Marko

Re: Read from Text File - variable is different than file

Posted: Wed May 04, 2011 7:44 am
by giaviv
Okay that happens to everyone sometimes :)

Re: Read from Text File - variable is different than file

Posted: Thu May 05, 2011 2:07 am
by Marko
Aviv,

:D yes, it happens all the time, even to the best of us.

I think this example shows how the concatenaton of strings works and I think it is a bug.


I modified the script adding a space at the end of $VERSION and it is OK now.


Regards
Marko