Read from Text File - variable is different than file

Got a problem you cannot solve? Try here.
Post Reply
Marko
Posts: 25
Joined: Tue Feb 08, 2011 2:18 am

Read from Text File - variable is different than file

Post 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
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

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

Post by giaviv »

Marko,

What combinations of character exactly cause this?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Marko
Posts: 25
Joined: Tue Feb 08, 2011 2:18 am

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

Post 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
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

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

Post by giaviv »

Dear Marko,

Could you please attach your text file?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Marko
Posts: 25
Joined: Tue Feb 08, 2011 2:18 am

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

Post by Marko »

Aviv,

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


Regards
Marko
Marko
Posts: 25
Joined: Tue Feb 08, 2011 2:18 am

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

Post 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
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

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

Post by giaviv »

Okay that happens to everyone sometimes :)
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Marko
Posts: 25
Joined: Tue Feb 08, 2011 2:18 am

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

Post 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
Post Reply