Wednesday, March 28, 2012
Passing multiple rows of data to a code function
what I'm trying to do:
I have field in my detail section, "customer", that is shows each customer:
[Customer1]
[Customer2]
[Customer3]
[etc.]
I'd like to wrap these into a single field at the parent group so I get the
following in a single field:
[Customer1, Customer2, Customer3, etc.]
Does that make sense?
I was thinking I might be able to write a VB function to take in a group of
records, itereate through them, and return the reformated string.
Of course if there's another way to accomplish this, I'm completely open to
other ideas.hi,i think it's better 2 do it on the sql side,so u get it in the ds as one
field.
"Greg S" wrote:
> Is there a way to pass multiple rows to a function on the report? Here's
> what I'm trying to do:
> I have field in my detail section, "customer", that is shows each customer:
> [Customer1]
> [Customer2]
> [Customer3]
> [etc.]
> I'd like to wrap these into a single field at the parent group so I get the
> following in a single field:
> [Customer1, Customer2, Customer3, etc.]
> Does that make sense?
> I was thinking I might be able to write a VB function to take in a group of
> records, itereate through them, and return the reformated string.
> Of course if there's another way to accomplish this, I'm completely open to
> other ideas.
>
>|||Take a look at the matrix control and see if that will work for you.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Greg S" <gregslistacct@.hotmail.com> wrote in message
news:e2lvbHHIGHA.532@.TK2MSFTNGP15.phx.gbl...
> Is there a way to pass multiple rows to a function on the report? Here's
> what I'm trying to do:
> I have field in my detail section, "customer", that is shows each
> customer:
> [Customer1]
> [Customer2]
> [Customer3]
> [etc.]
> I'd like to wrap these into a single field at the parent group so I get
> the following in a single field:
> [Customer1, Customer2, Customer3, etc.]
> Does that make sense?
> I was thinking I might be able to write a VB function to take in a group
> of records, itereate through them, and return the reformated string.
> Of course if there's another way to accomplish this, I'm completely open
> to other ideas.
>|||Follow up solution to my own thread:
Well, I did find some way to do this
concatenation/aggregation/rows-to-a-column on the SQL side. Here's a good
example using CROSS APPLY and leveraging FOR XML in sql 2005
http://www.aspfaq.com/show.asp?id=2529
I found a number of other examples as well - some using UDF functions,
orthers using customer CRL assemblies. Most threads had someone commenting
to the effect of "... this is usually needed for some kind of reporting and
should be handled in the presentation layer... doing it via SQL is breaking
the idea of pure relational databases..." Just thought this was funny as
my presentation layer (reporting services) can't do it. :^)
"'" <@.discussions.microsoft.com> wrote in message
news:4D2617C3-804E-4A10-AE87-53C8CB077DD4@.microsoft.com...
> hi,i think it's better 2 do it on the sql side,so u get it in the ds as
> one
> field.
> "Greg S" wrote:
>> Is there a way to pass multiple rows to a function on the report? Here's
>> what I'm trying to do:
>> I have field in my detail section, "customer", that is shows each
>> customer:
>> [Customer1]
>> [Customer2]
>> [Customer3]
>> [etc.]
>> I'd like to wrap these into a single field at the parent group so I get
>> the
>> following in a single field:
>> [Customer1, Customer2, Customer3, etc.]
>> Does that make sense?
>> I was thinking I might be able to write a VB function to take in a group
>> of
>> records, itereate through them, and return the reformated string.
>> Of course if there's another way to accomplish this, I'm completely open
>> to
>> other ideas.
>>
Wednesday, March 21, 2012
Passing ANY value to the <InsertParameters> section of a SQLDataSource
Ok-
I'm new at this, but just found out that to get data off a form and insert into SQL I can scrape it off the form and insert it in the <insertParameter> section by using
<asp:ControlParameterName="text2"Type="String"ControlID="TextBox2"PropertyName="Text"> (Thanks CSharpSean)
Now I ALSO need to set the user name in the same insert statement. I put in a UserName control that is populated when a signed in user shows up on the page. But in my code I've tried:
<asp:ControlParameter Name="UserName" Type="String" ControlID="LoginName1" DefaultValue="Daniel" PropertyName="Text"/>
and I get teh error
DataBinding: 'System.Web.UI.WebControls.LoginName' does not contain a property with the name 'Text'.
So I take PropertyName="Text" out, and get the error:
PropertyName must be set to a valid property name of the control named 'LoginName1' in ControlParameter 'UserName'.
what is the proper property value?
SO....BIG question...
Is there a clean way to pass UserName to the insert parameters? Or ANY value for that matter? Id like to know how to write somehting like
String s_test = "test string";
then in the updateparameter part of the sqldatasource pass SOMEHITNG like (in bold) <asp:Parameter Name="UserName" Type="String"Value=s_test/>
Thanks in advance...again!
Dan
Create the parameter, with a name attribute and a type. Then in SqlDataSource_Inserting event, just set the value of the parameter to whatever you want it to be. I believe the syntax (VB.NET) is either
e.Command.Parameters("@.UserName").Value=s_test
or
e.InsertCommand.Parameters("@.UserName").Value=s_test
|||Sounds easy.
Im writing in c#
But Im not sure where you are suggesting dropping in the code?
Is it in the '<InsertParameters> of the sql data source?
What is the 'E' in the e.insert...
Sorry for being so dense, but can you give me a psudo-code example?
Thanks for the help!
Dan
Step by step:
"Create the parameter, with a name attribute and a type." This is what you did before, just add:
<asp:Parameter name="UserName" type="String" /> in the <InsertParameters> section of the sqldatasource control.
"Then in SqlDataSource_Inserting event": double click the sqldatasource control while in design mode.
That should take you to your code behind and create a dummy event called "SqlDatasource1_Selecting".
Now at the top of the window, there are two dropdown list boxes. The right one should say "Selecting", change it to "Inserting". Now you should have a dummy event sub called "SqlDataSource1_Inserting". The code I gave goes in there. "e" is the second parameter of the two that gets passed in whenever the sqldatasource control is about to do an insert.
If you were doing this in VB.Net, your code behind page (Mypage.aspx.vb) would have these two new subs:
ProtectedSub SqlDataSource1_Inserting(ByVal senderAsObject,ByVal eAs System.Web.UI.WebControls.SqlDataSourceCommandEventArgs)Handles SqlDataSource1.Inserting
e.Command.Parameters("@.UserName").Value=s_testEndSub
ProtectedSub SqlDataSource1_Selecting(ByVal senderAsObject,ByVal eAs System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)Handles SqlDataSource1.SelectingEndSub
You can now delete the "SqlDataSource1_Selecting" sub if you want, since you aren't really using it.
|||Thanks a BUNCH!
(Will try it after i make MORE coffee...)
|||
C# People can use the above discussion and use
protected void SqlDataSource1_Inserting(object sender, SqlDataSourceCommandEventArgs e)
{
String var1 = TextBox1.Text;
e.Command.Parameters["@.text1"].Value = var1;
}
in the inserting function
Tuesday, March 20, 2012
Passing a variable to the from statement
Hi,
I have the following sql that I execute against a flat file. The flat file has a fixed length header and trailer but variable length data section. I execute this sql to get the header and trailer details the data section is put through a process in integration services:
SELECT
substring(bulkcolumn,1,5)--<HeaderIdentifier, char(5),>
,substring(bulkcolumn,6,10)--<SenderIdentifier, char(10),>
,substring(bulkcolumn,16,10)--<RecipientIdentifier, char(10),>
,substring(bulkcolumn,26,30)--<FileType, char(30),>
,substring(bulkcolumn,56,8)--<CreationDate, char(8),>
,substring(bulkcolumn,64,6)--<CreationTime, char(6),>
,substring(bulkcolumn,70,8) as SeqNo--<SequenceNumber, int,>
,substring(bulkcolumn,82,1)--<FeedType, char(1),>
,substring(bulkcolumn,charindex('ICMST',bulkcolumn)+6,4)--<RecordCount, varchar(6),>
,getdate()
FROM OPENROWSET(BULK N'c:\filename.txt',single_clob) as doc
My problem is that I want to be able to pass a variable to the filename, but cannot find a way to do it. It doesn't seem to like a normal stored procedure parameter passed to it, i.e BULK N'@.param1',single_clob, i get
'Cannot bulk load. The file "@.param" does not exist.'
The reason for me getting the header details like this is that integration services doesn't seem to fit well when we have a combination of variable and fixed length records.
Any other suggestions as to how I could solve this would be greatly appreciated.
Paul
dynamic sql would be a TSQL solution, though I would imagine SSIS has a "file emulator task" as well...
DECLARE @.SQL NVARCHAR(500)
SET @.SQL = 'SELECT
substring(bulkcolumn,1,5)--<HeaderIdentifier, char(5),>
,substring(bulkcolumn,6,10)--<SenderIdentifier, char(10),>
,substring(bulkcolumn,16,10)--<RecipientIdentifier, char(10),>
,substring(bulkcolumn,26,30)--<FileType, char(30),>
,substring(bulkcolumn,56,8)--<CreationDate, char(8),>
,substring(bulkcolumn,64,6)--<CreationTime, char(6),>
,substring(bulkcolumn,70,8) as SeqNo--<SequenceNumber, int,>
,substring(bulkcolumn,82,1)--<FeedType, char(1),>
,substring(bulkcolumn,charindex('ICMST',bulkcolumn)+6,4)--<RecordCount, varchar(6),>
,getdate()
FROM OPENROWSET(BULK N' + ''' + @.File + ''' + ',single_clob) as doc'
exec sp_executesql @.SQL
|||I couldn't get this to work. It still doesn't recognise the @.file parameter passed in to the select
DECLARE @.SQL NVARCHAR(500)
SET @.SQL = '
declare @.file nvarchar(500)
set @.file = ''c:\interface files\CostCentreImportFile.txt''
select @.file
SELECT
*
FROM OPENROWSET(BULK N'+''' + @.file + ''' + ',single_clob) as doc'
exec sp_executesql @.SQL
It returns....
Msg 4860, Level 16, State 1, Line 5
Cannot bulk load. The file " + @.file + " does not exist.
Even if I were to get that sorted I fear I'd still have a problem as it doesn't seem to recognise the 'bulkcolumn' keyword
DECLARE @.SQL NVARCHAR(500)
SET @.SQL = '
declare @.file nvarchar(500)
set @.file = ''c:\interface files\CostCentreImportFile.txt''
SELECT
substring(bulkcolumn,1,5)--<HeaderIdentifier, char(5),>
,substring(bulkcolumn,6,10)--<SenderIdentifier, char(10),>
,substring(bulkcolumn,16,10)--<RecipientIdentifier, char(10),>
,substring(bulkcolumn,26,30)--<FileType, char(30),>
,substring(bulkcolumn,56,8)--<CreationDate, char(8),>
,substring(bulkcolumn,64,6)--<CreationTime, char(6),>
,substring(bulkcolumn,70,8) as SeqNo--<SequenceNumber, int,>
,substring(bulkcolumn,82,1)--<FeedType, char(1),>
FROM OPENROWSET(BULK N''c:\interface files\CostCentreImportFile.txt'',single_clob) as doc'
--
exec sp_executesql @.SQL
Msg 207, Level 16, State 1, Line 5
Invalid column name 'bulkcolumn'.
The File data source in SSIS, I felt, wasn't adequate as I have two fixed length headers(different format), a variable length data section and then a fixed length trailer. I'd have to define four different file formats and ignore the other record formats on processing. Although I'm slowly talking myself into that approach
THIS WORKS...
DECLARE
@.SQL NVARCHAR(500),
@.file nvarchar(500)
SET @.file = 'c:\interface files\CostCentreImportFile.txt'
SET @.SQL = 'SELECT * FROM OPENROWSET(BULK N''' + @.file + ''',single_clob) AS doc'
PRINT @.SQL
EXEC sp_executesql @.SQL
|||Paul,
Did this work for you? If not please provide more info or mark answer.
thanks,
derek
|||Apologies for the delay, I must admit I don't monitor my older posts.
Yes, thank you very much, that works.
|||This not working for me.
I need something like this select but I would like to get content of this select into variable.
Could someone help me?
Code Snippet
SELECT @.strXML = x
FROM OPENROWSET(BULK @.filename, SINGLE_CLOB) AS result(x)
|||Hello Culprit, the problem with your statement is that it sends a variable (@.filename) as a parameter to the OPENROWSET function. This is not possible, because OPENROWSET does not allow its parameters to be variables (only literals).My suggestion to you is that you create another variable, let's say [@.sql varchar(255)]. This variable will store the text of the whole OPENROWSET statement. Having this variable all you have to do is execute the newly created statement. Here's the code:
DECLARE @.sql varchar(255)
SELECT @.sql = 'OPENROWSET(BULK ' + @.filename + ', SINGLE_CLOB)'
SELECT @.strXML = x
FROM EXEC(@.sql) AS result(x)
I hope this helps. Let me know how it goes. Ciao.
Passing a variable to the from statement
Hi,
I have the following sql that I execute against a flat file. The flat file has a fixed length header and trailer but variable length data section. I execute this sql to get the header and trailer details the data section is put through a process in integration services:
SELECT
substring(bulkcolumn,1,5)--<HeaderIdentifier, char(5),>
,substring(bulkcolumn,6,10)--<SenderIdentifier, char(10),>
,substring(bulkcolumn,16,10)--<RecipientIdentifier, char(10),>
,substring(bulkcolumn,26,30)--<FileType, char(30),>
,substring(bulkcolumn,56,8)--<CreationDate, char(8),>
,substring(bulkcolumn,64,6)--<CreationTime, char(6),>
,substring(bulkcolumn,70,8) as SeqNo--<SequenceNumber, int,>
,substring(bulkcolumn,82,1)--<FeedType, char(1),>
,substring(bulkcolumn,charindex('ICMST',bulkcolumn)+6,4)--<RecordCount, varchar(6),>
,getdate()
FROM OPENROWSET(BULK N'c:\filename.txt',single_clob) as doc
My problem is that I want to be able to pass a variable to the filename, but cannot find a way to do it. It doesn't seem to like a normal stored procedure parameter passed to it, i.e BULK N'@.param1',single_clob, i get
'Cannot bulk load. The file "@.param" does not exist.'
The reason for me getting the header details like this is that integration services doesn't seem to fit well when we have a combination of variable and fixed length records.
Any other suggestions as to how I could solve this would be greatly appreciated.
Paul
dynamic sql would be a TSQL solution, though I would imagine SSIS has a "file emulator task" as well...
DECLARE @.SQL NVARCHAR(500)
SET @.SQL = 'SELECT
substring(bulkcolumn,1,5)--<HeaderIdentifier, char(5),>
,substring(bulkcolumn,6,10)--<SenderIdentifier, char(10),>
,substring(bulkcolumn,16,10)--<RecipientIdentifier, char(10),>
,substring(bulkcolumn,26,30)--<FileType, char(30),>
,substring(bulkcolumn,56,8)--<CreationDate, char(8),>
,substring(bulkcolumn,64,6)--<CreationTime, char(6),>
,substring(bulkcolumn,70,8) as SeqNo--<SequenceNumber, int,>
,substring(bulkcolumn,82,1)--<FeedType, char(1),>
,substring(bulkcolumn,charindex('ICMST',bulkcolumn)+6,4)--<RecordCount, varchar(6),>
,getdate()
FROM OPENROWSET(BULK N' + ''' + @.File + ''' + ',single_clob) as doc'
exec sp_executesql @.SQL
|||I couldn't get this to work. It still doesn't recognise the @.file parameter passed in to the select
DECLARE @.SQL NVARCHAR(500)
SET @.SQL ='
declare @.file nvarchar(500)
set @.file = ''c:\interface files\CostCentreImportFile.txt''
select @.file
SELECT
*
FROM OPENROWSET(BULK N'+''' + @.file + '''+',single_clob) as doc'
execsp_executesql @.SQL
It returns....
Msg 4860, Level 16, State 1, Line 5
Cannot bulk load. The file " + @.file + " does not exist.
Even if I were to get that sorted I fear I'd still have a problem as it doesn't seem to recognise the 'bulkcolumn' keyword
DECLARE @.SQL NVARCHAR(500)
SET @.SQL ='
declare @.file nvarchar(500)
set @.file = ''c:\interface files\CostCentreImportFile.txt''
SELECT
substring(bulkcolumn,1,5)--<HeaderIdentifier, char(5),>
,substring(bulkcolumn,6,10)--<SenderIdentifier, char(10),>
,substring(bulkcolumn,16,10)--<RecipientIdentifier, char(10),>
,substring(bulkcolumn,26,30)--<FileType, char(30),>
,substring(bulkcolumn,56,8)--<CreationDate, char(8),>
,substring(bulkcolumn,64,6)--<CreationTime, char(6),>
,substring(bulkcolumn,70,8) as SeqNo--<SequenceNumber, int,>
,substring(bulkcolumn,82,1)--<FeedType, char(1),>
FROM OPENROWSET(BULK N''c:\interface files\CostCentreImportFile.txt'',single_clob) as doc'
--
execsp_executesql @.SQL
Msg 207, Level 16, State 1, Line 5
Invalid column name 'bulkcolumn'.
The File data source in SSIS, I felt, wasn't adequate as I have two fixed length headers(different format), a variable length data section and then a fixed length trailer. I'd have to define four different file formats and ignore the other record formats on processing. Although I'm slowly talking myself into that approach
THIS WORKS...
DECLARE
@.SQL NVARCHAR(500),
@.file nvarchar(500)
SET @.file ='c:\interface files\CostCentreImportFile.txt'
SET @.SQL ='SELECT * FROM OPENROWSET(BULK N'''+ @.file +''',single_clob) AS doc'
PRINT @.SQL
EXECsp_executesql @.SQL
|||Paul,
Did this work for you? If not please provide more info or mark answer.
thanks,
derek
|||Apologies for the delay, I must admit I don't monitor my older posts.
Yes, thank you very much, that works.
|||This not working for me.
I need something like this select but I would like to get content of this select into variable.
Could someone help me?
Code Snippet
SELECT @.strXML = x
FROMOPENROWSET(BULK@.filename,SINGLE_CLOB)AS result(x)
|||Hello Culprit, the problem with your statement is that it sends a variable (@.filename) as a parameter to the OPENROWSET function. This is not possible, because OPENROWSET does not allow its parameters to be variables (only literals).My suggestion to you is that you create another variable, let's say [@.sql varchar(255)]. This variable will store the text of the whole OPENROWSET statement. Having this variable all you have to do is execute the newly created statement. Here's the code:
DECLARE @.sql varchar(255)
SELECT @.sql ='OPENROWSET(BULK ' +@.filename +', SINGLE_CLOB)'
SELECT @.strXML= x
FROM EXEC(@.sql) AS result(x)
I hope this helps. Let me know how it goes. Ciao.
Passing a variable to the from statement
Hi,
I have the following sql that I execute against a flat file. The flat file has a fixed length header and trailer but variable length data section. I execute this sql to get the header and trailer details the data section is put through a process in integration services:
SELECT
substring(bulkcolumn,1,5)--<HeaderIdentifier, char(5),>
,substring(bulkcolumn,6,10)--<SenderIdentifier, char(10),>
,substring(bulkcolumn,16,10)--<RecipientIdentifier, char(10),>
,substring(bulkcolumn,26,30)--<FileType, char(30),>
,substring(bulkcolumn,56,8)--<CreationDate, char(8),>
,substring(bulkcolumn,64,6)--<CreationTime, char(6),>
,substring(bulkcolumn,70,8) as SeqNo--<SequenceNumber, int,>
,substring(bulkcolumn,82,1)--<FeedType, char(1),>
,substring(bulkcolumn,charindex('ICMST',bulkcolumn)+6,4)--<RecordCount, varchar(6),>
,getdate()
FROM OPENROWSET(BULK N'c:\filename.txt',single_clob) as doc
My problem is that I want to be able to pass a variable to the filename, but cannot find a way to do it. It doesn't seem to like a normal stored procedure parameter passed to it, i.e BULK N'@.param1',single_clob, i get
'Cannot bulk load. The file "@.param" does not exist.'
The reason for me getting the header details like this is that integration services doesn't seem to fit well when we have a combination of variable and fixed length records.
Any other suggestions as to how I could solve this would be greatly appreciated.
Paul
dynamic sql would be a TSQL solution, though I would imagine SSIS has a "file emulator task" as well...
DECLARE @.SQL NVARCHAR(500)
SET @.SQL = 'SELECT
substring(bulkcolumn,1,5)--<HeaderIdentifier, char(5),>
,substring(bulkcolumn,6,10)--<SenderIdentifier, char(10),>
,substring(bulkcolumn,16,10)--<RecipientIdentifier, char(10),>
,substring(bulkcolumn,26,30)--<FileType, char(30),>
,substring(bulkcolumn,56,8)--<CreationDate, char(8),>
,substring(bulkcolumn,64,6)--<CreationTime, char(6),>
,substring(bulkcolumn,70,8) as SeqNo--<SequenceNumber, int,>
,substring(bulkcolumn,82,1)--<FeedType, char(1),>
,substring(bulkcolumn,charindex('ICMST',bulkcolumn)+6,4)--<RecordCount, varchar(6),>
,getdate()
FROM OPENROWSET(BULK N' + ''' + @.File + ''' + ',single_clob) as doc'
exec sp_executesql @.SQL
|||I couldn't get this to work. It still doesn't recognise the @.file parameter passed in to the select
DECLARE @.SQL NVARCHAR(500)
SET @.SQL = '
declare @.file nvarchar(500)
set @.file = ''c:\interface files\CostCentreImportFile.txt''
select @.file
SELECT
*
FROM OPENROWSET(BULK N'+''' + @.file + ''' + ',single_clob) as doc'
exec sp_executesql @.SQL
It returns....
Msg 4860, Level 16, State 1, Line 5
Cannot bulk load. The file " + @.file + " does not exist.
Even if I were to get that sorted I fear I'd still have a problem as it doesn't seem to recognise the 'bulkcolumn' keyword
DECLARE @.SQL NVARCHAR(500)
SET @.SQL = '
declare @.file nvarchar(500)
set @.file = ''c:\interface files\CostCentreImportFile.txt''
SELECT
substring(bulkcolumn,1,5)--<HeaderIdentifier, char(5),>
,substring(bulkcolumn,6,10)--<SenderIdentifier, char(10),>
,substring(bulkcolumn,16,10)--<RecipientIdentifier, char(10),>
,substring(bulkcolumn,26,30)--<FileType, char(30),>
,substring(bulkcolumn,56,8)--<CreationDate, char(8),>
,substring(bulkcolumn,64,6)--<CreationTime, char(6),>
,substring(bulkcolumn,70,8) as SeqNo--<SequenceNumber, int,>
,substring(bulkcolumn,82,1)--<FeedType, char(1),>
FROM OPENROWSET(BULK N''c:\interface files\CostCentreImportFile.txt'',single_clob) as doc'
--
exec sp_executesql @.SQL
Msg 207, Level 16, State 1, Line 5
Invalid column name 'bulkcolumn'.
The File data source in SSIS, I felt, wasn't adequate as I have two fixed length headers(different format), a variable length data section and then a fixed length trailer. I'd have to define four different file formats and ignore the other record formats on processing. Although I'm slowly talking myself into that approach
THIS WORKS...
DECLARE
@.SQL NVARCHAR(500),
@.file nvarchar(500)
SET @.file = 'c:\interface files\CostCentreImportFile.txt'
SET @.SQL = 'SELECT * FROM OPENROWSET(BULK N''' + @.file + ''',single_clob) AS doc'
PRINT @.SQL
EXEC sp_executesql @.SQL
|||Paul,
Did this work for you? If not please provide more info or mark answer.
thanks,
derek
|||Apologies for the delay, I must admit I don't monitor my older posts.
Yes, thank you very much, that works.
|||This not working for me.
I need something like this select but I would like to get content of this select into variable.
Could someone help me?
Code Snippet
SELECT @.strXML = x
FROM OPENROWSET(BULK @.filename, SINGLE_CLOB) AS result(x)
|||Hello Culprit, the problem with your statement is that it sends a variable (@.filename) as a parameter to the OPENROWSET function. This is not possible, because OPENROWSET does not allow its parameters to be variables (only literals).My suggestion to you is that you create another variable, let's say [@.sql varchar(255)]. This variable will store the text of the whole OPENROWSET statement. Having this variable all you have to do is execute the newly created statement. Here's the code:
DECLARE @.sql varchar(255)
SELECT @.sql = 'OPENROWSET(BULK ' + @.filename + ', SINGLE_CLOB)'
SELECT @.strXML = x
FROM EXEC(@.sql) AS result(x)
I hope this helps. Let me know how it goes. Ciao.
Wednesday, March 7, 2012
pass hash (#) table with different structure to stored procedure
I making one stored procedure, which does some operation based on an
interface hash (#) table -- name #mydata.
This stored has two section of code (seperated by parameter value 0
and 1)
But hash table #mydata (same name) number/name of columns changes as
per call 0 or 1.
e.g.
when call for 0, --> Pass 2 columns as company_cd and section_cd in
interface hash (#) table -- name #mydata.
when call for 1, --> Pass 3 columns as Section_cd, line_cd and
subline_cd in interface hash (#) table -- name #mydata.
As a result, none of the case (0 or 1) is running properly, It gives
problem.
When I execute procedure for 0 by passing #mydata with two columns
--> it gives problem in 1 section code
And When I execute procedure for 1 by passing #mydata with three
columns --> it gives problem in 0 section code
Please suggest !!! If anybody have faced the same problem or have any
idea about this case.
(I think passing hash table with 3 column as col1,col2,col3 can serve
the purpose, but this may cause rework in my case, so looking for
alternate solution)
Thanks in Advance,
T.S.NegiIt sounds like creating the temp table with all three columns is
probably the best solution - see here for more details and other
options:
http://www.sommarskog.se/share_data.html
Simon