BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

Want to sponsor BOB? 
Want to sponsor BOB? (Opens a new window)  

General Notice: BOB is going to retire...please see details here.
General Notice: No events within the next 45 days.

How to write multiline query thru script object using sql


 
Search this topic... | Search DI: Designer and Job Design... | Search Box
Register or Login to Post    Forum Index -> Data Integrator -> DI: Designer and Job Design  Previous TopicPrint TopicNext Topic
Author Message
reddymade
Senior Member
Senior Member



Joined: 12 Feb 2012

Posts: 62



PostPosted: Mon Jan 05, 2015 7:02 am 
Post subject: How to write multiline query thru script object using sql

I have an update query, which is big and want to put in multi line,

How should i handle putting the whole query in multi line, in Visual basic i use & _ on every line end so that they concatenate well at the time of execution, here in DS, what characters should i put is it two pipe symbols enclosed within a single quote's?. Thanks a lot for thelpful info.


SQL('DS_EDW','UPDATE DMCH_JOB_DELTA SET STATUS=\'Completed\',STARTDATETIME = to_date({$G_Startdate},\'YYYY.MM.DD HH24:MI:SS\'), ENDDATETIME=to_date

({$G_Enddate},\'YYYY.MM.DD HH24:MI:SS\')');

print('Update success:');
Back to top
eganjp
Forum Addict
Forum Addict



Joined: 12 Sep 2007
ASUG Icon
Posts: 4287
Location: Denver Area


flag
PostPosted: Mon Jan 05, 2015 12:25 pm 
Post subject: Re: How to write multiline query thru script object using sq

Create the SQL parameter as a variable:

$LV_SQL = 'UPDATE DMCH_JOB_DELTA ';
$LV_SQL = $LV_SQL || 'SET STATUS=\'Completed\', ';
$LV_SQL = $LV_SQL || 'STARTDATETIME = to_date({$G_Startdate},\'YYYY.MM.DD HH24:MI:SS\'), ';
$LV_SQL = $LV_SQL || 'ENDDATETIME=to_date({$G_Enddate},\'YYYY.MM.DD HH24:MI:SS\')';

SQL('DS_EDW', $LV_SQL);

_________________
Jim Egan
ProKarma-an SAP Consulting Partner
Speaker at RMOUG Training Days 2013
Speaker at Sapphire Now 2013
Speaker at Business Objects User Conference 2013
-My ETL is faster than your database! - Advanced ETL performance tuning for Data Services
-Kill ETL bugs before they kill you!
My ETL blog

Latest Blog Posts
• 2014-04-17 Can Your ETL Make Your Reporting Faster?
• 2014-04-04 ProKarma Acquires Mantis Technology Group
• 2014-04-02 How to Create Charts in Webi (Part 2 of 2)
Back to top
NifflerX
Senior Member
Senior Member



Joined: 09 Aug 2009

Posts: 62



PostPosted: Tue Apr 07, 2020 9:45 am 
Post subject: Re: How to write multiline query thru script object using sq

Thanks so much. This worked great for me.

-NifflerX
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Data Integrator -> DI: Designer and Job Design  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0268 seconds using 17 queries. (SQL 0.0019 Parse 0.0009 Other 0.0240)
CCBot/2.0 (https://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo