SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Assign a variable a very long string.

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Assign a variable a very long string.
Author Message
Viji



Joined: 11 Sep 2006
Posts: 5

Post Assign a variable a very long string. Reply with quote

Hi,
How can I set a really long string to a variable without
using concatination. I am trying to assign a really long
select statement and want it to be idented properly
with new lines.
For example:
Set SelectStatement "Select col1

From Tab1

Where Col1 = Col2 "

Mon Sep 11, 2006 1:57 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7966

Post Re: Assign a variable a very long string. Reply with quote

You can use string continuation like below

Set(SelectStatement, " &
Select col1 ... &
From Tab1 &
Where Col1 = Col2 ")

If the statement is really long it is better to put it somewhere else. Perhaps a separate database job run dynamically like
JobRun "my db job..."

or alternatively
JobDescribe("my db job ...", "SQL", SelectStatement)

In a database job you can use SQL Editor to enter and maintain the SQL while in JAL and in VB you have to code it as a string.

: Hi,
: How can I set a really long string to a variable without
: using concatination. I am trying to assign a really long
: select statement and want it to be idented properly
: with new lines.
: For example: Set SelectStatement "Select col1

: From Tab1

: Where Col1 = Col2 "

Mon Sep 11, 2006 2:11 pm View user's profile Send private message
Viji



Joined: 11 Sep 2006
Posts: 5

Post Re: Assign a variable a very long string. Reply with quote

Is there an upper limit on string variable length...?
I got syntax error after adding certain length of text
using string continuation. There is nothing wrong with use of quotes or & sign.

: You can use string continuation like below

: Set(SelectStatement, " &
: Select col1 ... &
: From Tab1 &
: Where Col1 = Col2 ")

: If the statement is really long it is better to put it somewhere else.
: Perhaps a separate database job run dynamically like
: JobRun "my db job..."

: or alternatively
: JobDescribe("my db job ...", "SQL", SelectStatement)

: In a database job you can use SQL Editor to enter and maintain the SQL while
: in JAL and in VB you have to code it as a string.

Wed Sep 13, 2006 11:38 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.