Hi there,
maybe you can help me. is there way to
skip lines in the mail sticker? we
are using 20 mail stickers/page paper and
usually the user uses only 4-5 stickers
we want to maximize the use of the unprinted
stickers is there way to skip the already
printed sticker by passing parameter "no. of skips"?
we are connected to an oracle database and uses
pl-sql with cursor ref.
thanks.Maybe you could just put something in the report header to skip the relevant amount of space. Here's two things I can think of:
1) A formula that writes 'n' * 'parameter' empty lines, assuming you can exactly match 'n' lines to a sticker.
2) An 'empty' sticker in a subreport, and force 'parameter' detail records to skip the space by using the command statement
select * from (select level from dual connect by level <= {?parameter})
(Beware, DO NOT run that statement without the <= clause!)|||thanks for your reply.
actually thats what i did below is current program running,
just asking maybe other solution by not doing this like for loop etc.
SELECT
FROM DUAL
where 1 <= p_noskip
union all
SELECT
FROM DUAL
where 2 <= p_noskip
union all
SELECT
FROM DUAL
where <till 19> <= p_noskip|||So replace those 19 unioned select from dual statements with one single statement:
select * from (select level from dual connect by level <= {?parameter})
Remember to create the parameter in the add command screen, not the field explorer/|||ThanksJagan, it works! I just added connect by level.
select '' from dual connect by level <= <parameter>|||Yeah, that'll work too - you don't need the extra select around the outside if you just want 'n' records as you do.
However, the nice thing about the full statement is that you get an ordered, contiguous set of values from 1..n
As level's a reserved word, I suppose it's more correct to actually write
select x from (select level as x from dual connect by level <= {?parameter})
so that you don't have to select * (literally, the * character)
If you write
select level from (select level from dual connect by level <= {?parameter})
then you find that you get 'parameter' records all with value 0
But hey, this is a Crystal forum not an Oracle one...but someone might find this useful...
Showing posts with label lines. Show all posts
Showing posts with label lines. Show all posts
Wednesday, March 7, 2012
Monday, February 20, 2012
Ltrim + Rtrim
How do i remove carriage returns in SQL Server ? each of the lines have a carriage return as well as in front and back of the text.
Keith Waltin
Transport Ticketing Authority
03 9651 9066
I've tried the
update test.dbo.test
set bodytext1 = ltrim(rtrim(bodytext1))
but the whitespace/carriage returns still exists in the back and front of the text ? Anyone got any ideas ?The Ltrim() and RTrim() functions work on space characters (ASCII 32, Hex 0x20) only. They don't have any effect on other whitespace.
I'd write a UDF (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_create_7r1l.asp) to remove whatever characters you find offensive, according to your processing rules.
-PatP|||declare @.cr char(1), @.lf char(1), @.crlf char(2), @.space char(1)
select @.cr = char(13), @.lf = char(10), @.space = char(32)
update test.dbo.test
set bodytext1 = replace(replace(replace(bodytext1, @.cr, ''), @.lf, ''), @.space, '')
where (
charindex(@.cr, bodytext1) > 0 or
charindex(@.lf, bodytext1) > 0 or
charindex(@.space, bodytext1) > 0
)
Keith Waltin
Transport Ticketing Authority
03 9651 9066
I've tried the
update test.dbo.test
set bodytext1 = ltrim(rtrim(bodytext1))
but the whitespace/carriage returns still exists in the back and front of the text ? Anyone got any ideas ?The Ltrim() and RTrim() functions work on space characters (ASCII 32, Hex 0x20) only. They don't have any effect on other whitespace.
I'd write a UDF (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_create_7r1l.asp) to remove whatever characters you find offensive, according to your processing rules.
-PatP|||declare @.cr char(1), @.lf char(1), @.crlf char(2), @.space char(1)
select @.cr = char(13), @.lf = char(10), @.space = char(32)
update test.dbo.test
set bodytext1 = replace(replace(replace(bodytext1, @.cr, ''), @.lf, ''), @.space, '')
where (
charindex(@.cr, bodytext1) > 0 or
charindex(@.lf, bodytext1) > 0 or
charindex(@.space, bodytext1) > 0
)
Subscribe to:
Posts (Atom)