Showing posts with label create. Show all posts
Showing posts with label create. Show all posts

Wednesday, March 28, 2012

Profile, SQLDataSource and GridView

Hello.

When I create a user at the ASP.NET database, I need to insert more fields than the defaults, and I do it like this:

Dim customProfile As ProfileCommon = ProfileCommon.Create(CreateUserWizard1.UserName, True)

customProfile.telephone =(CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("TelephoneText"),TextBox)).Text
(telephone example)


Those data are inserted at the DB at the aspnet_Profile table, in the fields PropertyNames & PropertyValuesString, but they are saved together (see image above)


I want to separate those properties in the GridView as long as each property appears in a column, is it possible?Tongue Tied
Thank you very much, i'm expecting your answers.

If you want an additional column you could change existing TSQL
SELECT A, B, C FROM TABLE
to
SELECT A, B, C, '' AS D FROM TABLE

|||

I want to separate these properties in columns, not to create a new empty column.

|||Regrettably you published an image - please publish the text that you need split and I will write some TSQL for you.|||

GridView shows me this:

GridView bad

and I need this:


|||Please copy out the text and post that. The image is useless to me.|||

The text is the following:

<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" CellPadding="4" CssClass="gridview" DataSourceID="SqlDataSource1"
ForeColor="#333333" GridLines="None">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundField DataField="UserName" HeaderText="ID" SortExpression="UserName" />
<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
<asp:BoundField DataField="PropertyNames" HeaderText="Propiedades" SortExpression="PropertyNames" />
<asp:BoundField DataField="PropertyValuesString" HeaderText="Valores" SortExpression="PropertyValuesString" />
</Columns>
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\webfax.mdf;Integrated Security=True;User Instance=True"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT aspnet_Membership.Email, aspnet_Profile.PropertyNames, aspnet_Profile.PropertyValuesString, aspnet_Users.UserName FROM aspnet_Membership INNER JOIN aspnet_Profile ON aspnet_Membership.UserId = aspnet_Profile.UserId INNER JOIN aspnet_Users ON aspnet_Membership.UserId = aspnet_Users.UserId">
</asp:SqlDataSource>

|||Thank you for posting the program source. However what I need is the text of the displayed field that needs to sub-divided. I can then modifySELECT aspnet_Membership.Email, aspnet_Profile.PropertyNames,aspnet_Profile.PropertyValuesString, aspnet_Users.UserName FROMaspnet_Membership INNER JOIN aspnet_Profile ON aspnet_Membership.UserId= aspnet_Profile.UserId INNER JOIN aspnet_Users ONaspnet_Membership.UserId = aspnet_Users.UserIdto bsub-divide the fields.|||

ok, both texts are:

empresa:S:0:3:nombre:S:3:10:telefono:s:13:5:apellidos:S:18:12:

and

UBuLa cartera45678que yo tengo


these are for the first case, for the second case:

empresa:S:0:3:nombre:S:3:8:telefono:S:11:5:apellidos:S:16:13

and

453el huevo76534de la gallina

thanks

|||

Presumably you need
empresa:S:0:3:nombre:S:3:10:telefono:s:13:5:apellidos:S:18:12:

broken down to
empresa:S:0:3:
nombre:S:3:10:
telefono:s:13:5:
apellidos:S:18:12:

using the delimiters I have marked in bold

|||

Based on the presumption in my previous post

DECLARE @.VAR VARCHAR(100)
DECLARE @.EMPRESSA VARCHAR(100)
DECLARE @.NOMBRE VARCHAR(100)
DECLARE @.telefono VARCHAR(100)
DECLARE @.apellidos VARCHAR(100)
SET @.VAR = 'empresa:S:0:3:nombre:S:3:10:telefono:s:13:5:apellidos:S:18:12:'
PRINT @.VAR
--empresa:S:0:3:
--nombre:S:3:10:
--telefono:s:13:5:
--apellidos:S:18:12:
DECLARE @.IMARK1 INT
DECLARE @.IMARK2 INT
SET @.IMARK1 = CHARINDEX('nombre:', @.VAR)
PRINT @.IMARK1
IF @.IMARK1 > 0 BEGIN
SET @.EMPRESSA = SUBSTRING(@.VAR, 1, @.IMARK1-1)
PRINT '@.EMPRESSA [' + @.EMPRESSA + ']'
END
SET @.IMARK1 = CHARINDEX('apellidos:', @.VAR)
IF @.IMARK1 > 0 BEGIN
SET @.apellidos = SUBSTRING(@.VAR, @.IMARK1,DATALENGTH(@.VAR))
PRINT '@.apellidos [' + @.apellidos + ']'
END
SET @.IMARK1 = CHARINDEX('apellidos:', @.VAR)
SET @.IMARK2 = CHARINDEX('telefono:', @.VAR)
IF @.IMARK1 > 0 AND @.IMARK2 > 0 AND @.IMARK1 > @.IMARK2 BEGIN
SET @.telefono = SUBSTRING(@.VAR, @.IMARK2,@.IMARK1 - @.IMARK2)
PRINT '@.telefono [' + @.telefono + ']'
END
SET @.IMARK1 = CHARINDEX('telefono:', @.VAR)
SET @.IMARK2 = CHARINDEX('nombre:', @.VAR)
IF @.IMARK1 > 0 AND @.IMARK2 > 0 AND @.IMARK1 > @.IMARK2 BEGIN
SET @.nombre = SUBSTRING(@.VAR, @.IMARK2,@.IMARK1 - @.IMARK2)
PRINT '@.nombre [' + @.nombre + ']'
END

gives

empresa:S:0:3:nombre:S:3:10:telefono:s:13:5:apellidos:S:18:12:
15
@.EMPRESSA [empresa:S:0:3:]
@.apellidos [apellidos:S:18:12:]
@.telefono [telefono:s:13:5:]
@.nombre [nombre:S:3:10:]

The TSQL will need to be wrapped in in some scalar functions

|||

The functions

CREATE FUNCTION dbo.fnGetApellidos (@.VAR VARCHAR(250))
RETURNS VARCHAR(50) AS
BEGIN
DECLARE @.RETURN VARCHAR(50)
DECLARE @.IMARK1 INT
DECLARE @.IMARK2 INT
SET @.IMARK1 = CHARINDEX('apellidos:', @.VAR)
IF @.IMARK1 > 0 BEGIN
SET @.RETURN = SUBSTRING(@.VAR, @.IMARK1,DATALENGTH(@.VAR))
--PRINT '@.apellidos [' + @.RETURN + ']'
END
RETURN @.RETURN
END
GO
CREATE FUNCTION dbo.fnGetEMPRESSA (@.VAR VARCHAR(250))
RETURNS VARCHAR(50) AS
BEGIN
DECLARE @.RETURN VARCHAR(50)
DECLARE @.IMARK1 INT
DECLARE @.IMARK2 INT
SET @.IMARK1 = CHARINDEX('nombre:', @.VAR)
--PRINT @.IMARK1
IF @.IMARK1 > 0 BEGIN
SET @.RETURN = SUBSTRING(@.VAR, 1, @.IMARK1-1)
--PRINT '@.EMPRESSA [' + @.RETURN + ']'
END
RETURN @.RETURN
END
GO
CREATE FUNCTION dbo.fnGetTelefono (@.VAR VARCHAR(250))
RETURNS VARCHAR(50) AS
BEGIN
DECLARE @.RETURN VARCHAR(50)
DECLARE @.IMARK1 INT
DECLARE @.IMARK2 INT
SET @.IMARK1 = CHARINDEX('apellidos:', @.VAR)
SET @.IMARK2 = CHARINDEX('telefono:', @.VAR)
IF @.IMARK1 > 0 AND @.IMARK2 > 0 AND @.IMARK1 > @.IMARK2 BEGIN
SET @.RETURN = SUBSTRING(@.VAR, @.IMARK2,@.IMARK1 - @.IMARK2)
--PRINT '@.telefono [' + @.RETURN + ']'
END
RETURN @.RETURN
END
GO
CREATE FUNCTION dbo.fnGetNombre (@.VAR VARCHAR(250))
RETURNS VARCHAR(50) AS
BEGIN
DECLARE @.RETURN VARCHAR(50)
DECLARE @.IMARK1 INT
DECLARE @.IMARK2 INT
SET @.IMARK1 = CHARINDEX('telefono:', @.VAR)
SET @.IMARK2 = CHARINDEX('nombre:', @.VAR)
IF @.IMARK1 > 0 AND @.IMARK2 > 0 AND @.IMARK1 > @.IMARK2 BEGIN
SET @.RETURN = SUBSTRING(@.VAR, @.IMARK2,@.IMARK1 - @.IMARK2)
--PRINT '@.nombre [' + @.RETURN + ']'
END
RETURN @.RETURN
END
GO

When run by
DECLARE @.VAR VARCHAR(100)
SET @.VAR = 'empresa:S:0:3:nombre:S:3:10:telefono:s:13:5:apellidos:S:18:12:'
PRINT @.VAR
PRINT dbo.fnGetEmpressa(@.VAR)
PRINT dbo.fnGetNombre(@.VAR)
PRINT dbo.fnGetTelefono(@.VAR)
PRINT dbo.fnGetApellidos(@.VAR)

give
empresa:S:0:3:nombre:S:3:10:telefono:s:13:5:apellidos:S:18:12:
empresa:S:0:3:
nombre:S:3:10:
telefono:s:13:5:
apellidos:S:18:12:

Thus instead of
SELECT VAR FROM TABLENAME

you can have
SELECT dbo.fnGetEmpressa(VAR) ASEmpressa,dbo.fnGetNombre(VAR) ASNombre,
dbo.fnGetTelefono(VAR) ASTelefono,dbo.fnGetApellidos(VAR) ASApellidos FROM TABLENAME

this giving you the required split on columns

sql

Monday, March 26, 2012

Product for Creating Data Dictionary

We have a large SQL Server database that has poorly documented tables and
field names. Is there a product that will create a Word document in table
format from the actual database that can be used to add documentation about
the meaning of each field?
Will
Will
SQL Server 2000 has an option called column description
create table dbo.customer (
customer_id integer not null identity (1, 1)
, trade_name varchar (0255) not null
)
go
alter table dbo.customer add
constraint pk_customer primary key nonclustered (customer_id)
go
/* column description meta info */
execute sp_addextendedproperty N'boolean_property_01', '1', N'user', N'dbo',
N'table', N'customer', N'column', N'trade_name'
execute sp_addextendedproperty N'column_description', 'Customer trading
name', N'user', N'dbo', N'table', N'customer', N'column', N'trade_name'
go
select * from :: fn_listextendedproperty (NULL, 'user', 'dbo', 'table',
'customer', 'column', default)
go
drop table dbo.customer
go
"Will" <DELETE_westes@.earthbroadcast.com> wrote in message
news:OOrsHkGUFHA.3636@.TK2MSFTNGP14.phx.gbl...
> We have a large SQL Server database that has poorly documented tables and
> field names. Is there a product that will create a Word document in
table
> format from the actual database that can be used to add documentation
about
> the meaning of each field?
> --
> Will
>
>

Product for Creating Data Dictionary

We have a large SQL Server database that has poorly documented tables and
field names. Is there a product that will create a Word document in table
format from the actual database that can be used to add documentation about
the meaning of each field?
--
WillWill
SQL Server 2000 has an option called column description
create table dbo.customer (
customer_id integer not null identity (1, 1)
, trade_name varchar (0255) not null
)
go
alter table dbo.customer add
constraint pk_customer primary key nonclustered (customer_id)
go
/* column description meta info */
execute sp_addextendedproperty N'boolean_property_01', '1', N'user', N'dbo',
N'table', N'customer', N'column', N'trade_name'
execute sp_addextendedproperty N'column_description', 'Customer trading
name', N'user', N'dbo', N'table', N'customer', N'column', N'trade_name'
go
select * from :: fn_listextendedproperty (NULL, 'user', 'dbo', 'table',
'customer', 'column', default)
go
drop table dbo.customer
go
"Will" <DELETE_westes@.earthbroadcast.com> wrote in message
news:OOrsHkGUFHA.3636@.TK2MSFTNGP14.phx.gbl...
> We have a large SQL Server database that has poorly documented tables and
> field names. Is there a product that will create a Word document in
table
> format from the actual database that can be used to add documentation
about
> the meaning of each field?
> --
> Will
>
>

Friday, March 23, 2012

produce SQL statement for a database

hi
is there any feature in MSSql that produce SQL statement for a database(include CREATE TABLE, INSERT Records, ...)(for SQL Server 2000...and maybe 7.0)

In the SQL Query Analyzer Object Browser, drill down to your table, right-click on the table name and select "Script Object...As" and it will generate the SQL for you.

Additionally, in Enterprise Manager, drill down to your "Tables" and select the table you want to query. Right-click on the table, Select Open Table --> Query. You SQL statement is generated dynamically as you select fields. A Select statement is the default. In the gray area where you see the table and all of it's fields, Right-click and there is a selection for "Change Type." In there you can change the query to an Insert, Create, etc...|||I prefer to build my own..

USE NorthWind

DECLARE @.TBName sysname, @.SQL varchar(8000)

SELECT @.TBName = 'Cust', @.SQL = ''

SELECT @.SQL = @.SQL + RTRIM(SQL) FROM (
--SELECT SQL FROM (
SELECT RTRIM(' SELECT ' + RTRIM(COLUMN_NAME)) As SQL, TABLE_NAME, 3 As SQL_Group, ORDINAL_POSITION As Row_Order
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME LIKE @.TBName+'%'
AND ORDINAL_POSITION = 1
UNION ALL
SELECT RTRIM(', ' + RTRIM(COLUMN_NAME)) As SQL, TABLE_NAME, 3 As SQL_Group, ORDINAL_POSITION As Row_Order
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME LIKE @.TBName+'%'
AND ORDINAL_POSITION <> 1
UNION ALL
SELECT RTRIM(' FROM [' + RTRIM(TABLE_NAME) + ']') As SQL, TABLE_NAME, 4 As SQL_Group, 1 As Row_Order
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME LIKE @.TBName+'%'
AND ORDINAL_POSITION = 1
UNION ALL
SELECT RTRIM(' GO ') As SQL, TABLE_NAME, 5 As SQL_Group, 1 As Row_Order
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME LIKE @.TBName+'%'
AND ORDINAL_POSITION = 1
) AS XXX
Order By TABLE_NAME, SQL_Group, Row_Order

SELECT @.SQL

--EXEC(@.SQL)

Tuesday, March 20, 2012

Processing of cube created via DSO in AS 2005 fails

We are testing an application originaly written for AS 2000 with AS

2005.
This application uses DSO from VB to create and process cubes. I have

gotten
over the major hurdles of getting DSO to work with AS 2005. However,

upon
creating of the cubes, I get errors processing it (even from

Management
Studio). Here's the code (abridged to remove error handling) that

we use to
create a cube:

Dim dsoCube As DSO.MDStore
Set

dsoCube = m_dsoDatabase.MDStores.AddNew(cubeName)

' set the cube's

description
dsoCube.Description = sCubeDesc

' set the cube's

datasource
dsoCube.DataSources.Add

m_dsoDatabase.DataSources(mvarDBName)

Dim dboStr As String


dboStr = sLQuote & "dbo" & sRQuote & "."
' set the source

table (fact table) for the cube
dsoCube.SourceTable = dboStr &

sLQuote & FACT_TABLE & sRQuote

dsoCube.EstimatedRows =

164558
' specify access permissions to the cube by adding roles to the

cube
Dim dsoCubeRole As DSO.role
Set dsoCubeRole =

dsoCube.Roles.AddNew("BSA Role")
dsoCubeRole.SetPermissions "Access",

"RW"

' create cube's measures
'
Dim dsoMeasure As

DSO.Measure
Set dsoCube = m_dsoDatabase.MDStores.Item(cubeName)


Set dsoMeasure = dsoCube.Measures.AddNew("BaseAmt")

' set the

measure's source column, data type and the formatting


dsoMeasure.SourceColumn = dsoCube.SourceTable & "." &

_
sLQuote & "baseamt" & sRQuote


dsoMeasure.SourceColumnType = adDouble
dsoMeasure.FormatString =

"Currency"
' this measure will be aggregated by summation


dsoMeasure.AggregateFunction = aggSum

Set dsoMeasure =

dsoCube.Measures.AddNew("Count")

' set the measure's source column,

data type and the formatting
dsoMeasure.SourceColumn =

dsoCube.SourceTable & "." & _
sLQuote

& "baseamt" & sRQuote
dsoMeasure.SourceColumnType =

adInteger
' this measure will be aggregated by summation


dsoMeasure.AggregateFunction = aggCount
Set dsoMeasure =

dsoCube.Measures.AddNew("TranNo")

' set the measure's source column,

data type and the formatting
dsoMeasure.SourceColumn =

dsoCube.SourceTable & "." & _
sLQuote

& "TranNo" & sRQuote
dsoMeasure.SourceColumnType =

adInteger

' this measure will be aggregated by summation


dsoMeasure.AggregateFunction = aggMax

' Create Calculated

members
Dim dsoCalculatedMember As DSO.Command
Set

dsoCalculatedMember = dsoCube.Commands.AddNew("CustAvgAmt")

' set the

command type
dsoCalculatedMember.CommandType = cmdCreateMember
'

set the MDX statement that defines the calculated member


dsoCalculatedMember.Statement = _
"Create Member Measures.[CustAvgAmt] As

" & _
"'avg({LastPeriods(3 ,

[bookdate].&[2003].&[4].&[10])},
measures.[baseamt])'"


Set dsoCalculatedMember = dsoCube.Commands.AddNew("CustAvgCnt")
' set the

command type
dsoCalculatedMember.CommandType = cmdCreateMember


' set the MDX statement that defines the calculated member


dsoCalculatedMember.Statement = _
"Create Member Measures.[CustAvgCnt] As

" & _
"'avg({LastPeriods(3 ,

[bookdate].&[2003].&[4].&[10])},
measures.[Count])'"

'

add the BookDate dimension
Dim dsoBookDateDim As DSO.Dimension
Set

dsoBookDateDim = dsoCube.Dimensions.AddNew("BookDate")

' add the

RecvPay dimension
Dim dsoRecvPayDim As DSO.Dimension
Set

dsoRecvPayDim = dsoCube.Dimensions.AddNew("RecvPay")

' get the list

of all tables used in this cube
' this list includes the fact table and

the dimension tables
' Note: Make sure that you do not repeat the same

table name twice.
dsoCube.FromClause = dsoCube.SourceTable & ", "

&
dsoBookDateDim.FromClause

dsoCube.joinClause =

dsoCube.joinClause & _
"(" & _
dboStr

& sLQuote & FACT_TABLE & sRQuote & "." & sLQuote

&
"bookdate" & sRQuote & _
" = " &

_
dboStr & sLQuote & "TblBookDate" & sRQuote &

"." & sLQuote &
"bookdate" & sRQuote & _


")"

dsoCube.SourceTableFilter = mvarFactTableFilter
' save the

cube definition in the metadata repository
dsoCube.Update

This

code runs fine, but during processing of the selected cube from
Management

Studio, the following error is displayed:
The Measures cube either does

not exist or has not been processed

There is no Measures cube, nor was

there ever. This does not happen when
processing cubes in AS 2000 or even in

AS 2005 if the cube was migrated from
AS 2000.

Can anybody help with

this?

Thanks in advance,
Boris Zakharin, MCAD
Metavante Risk and

Compliance

Hi Boris,

the problem is in the following line, which creates a calculated member. In AS2005 (as well as in AS2000) the member created in the cube scope should be prefixed with the cube name or CurrentCube, since Measures is the first name detected AS2005 treats it as a cube name. Pehaps AS2000 did not detected this error during the prosessing, but the calc member was disabled pr may be I'm wrong and CurrentCube was optional, but anyway, if you add CurrentCube to all calculated members it should start to process.

"Create Member Measures.[CustAvgAmt] As " & _
"'avg({LastPeriods(3 , [bookdate].&[2003].&[4].&[10])},
measures.[baseamt])'"

|||Thanks a lot, that worked

Processing methodology

we have 3 large fact tables with combined rec cnts of 32 million. These 3 fact tables share order attribute that we would like to pull out and create a order dimension so that the facts tables don't have to contain the attributes. I've tried update processing of this dimension but the time it takes is not much different than a full process. I would like to know if there is anything like a incremental processing of this dimension and how would I set that up?

I assume that you are using Analysis Services 2005?

Actually, the "Process Update" method is slow than doing a "Process Full" on a dimension. The reason for this is, that "Process Update" reads the entire dimension table and compares the content of this with the existing, processed dimension. Any differences are then updated in the OLAP dimension. "Process Full", on the other hand, does not have to make any comparisons - it simply reads the entire dimension table and builds the OLAP dimension.

Now, the main reason for using "Process Update" is that is does not invalidate your processed measure groups. If you do a "Process Full" on the dimension, you are forced into doing a "Process Full" on any measure group that contains this dimension. Note, that "Process Update" will invalidate the aggregations on any associated measure group, provided that changes have occured to the dimension. This means, that a "Process Update" on the dimension will have to be followed by a "Process Index" on the associated measure groups in order to get aggregations back.

Friday, March 9, 2012

Process to create db copy on another server

Hello
(duplicated post in sqlserver.replication)
I have a production database that i would like to have mirrored on another
server. I have never worked with database replication, but from what I
understand, changes made to any of the replicated DBs get reflected in all
other DBs. What I need is to have the one production database copied daily
(or weekly) to another box.
Can I somehow set this up through replication so that the replicated
database cannot be updated? ie is static and just syncs to the production db?
Should I be using replication or another tool/process?
Thanks for the help!
Replication is usually more for real time updates. But you can use Snapshot
replication and set the time to how ever often you wish. But if you are
really talking about a daily or even weekly copy I would just set up a job
to copy the full backup file to the other servers and restore it. You can
put the restored copy in ReadOnly mode so it doesn't have to use locks.
Andrew J. Kelly SQL MVP
"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:01C58D3A-8F33-4C09-9326-A8D8BB754062@.microsoft.com...
> Hello
> (duplicated post in sqlserver.replication)
> I have a production database that i would like to have mirrored on another
> server. I have never worked with database replication, but from what I
> understand, changes made to any of the replicated DBs get reflected in all
> other DBs. What I need is to have the one production database copied
> daily
> (or weekly) to another box.
> Can I somehow set this up through replication so that the replicated
> database cannot be updated? ie is static and just syncs to the production
> db?
> Should I be using replication or another tool/process?
> Thanks for the help!

Monday, February 20, 2012

procedure using cursors

exam is coming.i still feel headache about procedure using cursor.
here is example:
Q.Create a cursor stored procedure called PriceChange to read the title id and price from the titles tables which will return the information as a cursor output. Use the PriceChange stored procedure to increase the price in the titles table by 10% using a cursor. If the price is null, set the price to $9.99. (pubs database)
i try to do this way but fail,can somebody help me?thanks.

CREATE PROCEDURE PriceChange
(@.titles_cursor CURSOR VARYING OUTPUT)
AS
SET @.titles_cursor = CURSOR
FORWARD_ONLY STATIC FOR
SELECT title_id,
price
FROM titles

OPEN @.titles_cursor
GO

DECLARE @.MyCursor CURSOR,
@.title_id_temp varchar(6),
@.price_temp money

EXEC PriceChange @.titles_cursor=@.MyCursor OUTPUT

WHILE (@.@.FETCH_STATUS = 0)
BEGIN
FETCH NEXT FROM @.MyCursor INTO @.title_id_temp,@.price_temp
IF @.price_temp IS NULL
SET price=9.99
ELSE
SET price=@.price_temp*1.1
END
I am not too big into the use of cursors in SQL, but do you intend to pass a cursor to the stored procedure? Can you do this?

What error messages do you get when you try to use this?

procedure to create log and error files

Hi,

I have a procedure, containing 10 tables, whenever my procedure is executed, i what to know the start and end time of each table and this should be stored in a separate file known as log file and all the error info. should be stored in error file, and then i want to run this procedure through unix shell script(.ksh), can u plz.. help me out in this regard.

Thanks in advance.
mahe.For your loggin problem in oracle database you can use the log4plsql tools
see : http://log4plsql.sourceforge.net/

with this tools you can log in a lot off device.

G.