Showing posts with label row. Show all posts
Showing posts with label row. Show all posts

Monday, March 26, 2012

invalid row id

with this code:
SET SERVEROUTPUT ON
CREATE OR REPLACE
PROCEDURE update_price(p_cutoff IN CHAR) AS
change CONSTANT Real := 0.9;
CURSOR c_upgrade_p IS
SELECT price FROM (select price, start_date from items i, on_sale os
WHERE (i.id = os.item_id))
WHERE (TO_DATE(start_date,'DD-MON-YYYY') = TO_DATE(p_cutoff,'DD-MON-YYYY'))
FOR UPDATE OF PRICE;
BEGIN
FOR record IN c_upgrade_p LOOP
UPDATE items
SET price = price * 0.9
WHERE CURRENT OF c_upgrade_p;
END LOOP;
COMMIT;
END;
/
exec update_price('30-AUG-03');

i get an invalid row id error, why is this?Try it without the inline view:

CURSOR c_upgrade_p IS
SELECT price
from items i, on_sale os
WHERE (i.id = os.item_id))
WHERE (TO_DATE(start_date,'DD-MON-YYYY') = TO_DATE(p_cutoff,'DD-MON-YYYY'))
FOR UPDATE OF PRICE;

BTW, does this: TO_DATE(start_date,...) mean that start_date is not a DATE?|||the start_date is a date, i am just checking that the format is the same... i dont know how to change from inline...?|||If start_date is a DATE, then don't use TO_DATE on it. And I showed you the version without the inline view, though I made a mistake or two. Here is the corrected version, with the unwanted TO_DATE removed:

CURSOR c_upgrade_p IS
SELECT price
from items i, on_sale os
WHERE i.id = os.item_id
AND start_date = TO_DATE(p_cutoff,'DD-MON-YYYY')
FOR UPDATE OF PRICE;

A DATE column doesn't have any format, it is stored in a special internal coding. Only use TO_DATE to convert a text string to a DATE, and use TO_CHAR to format a DATE for display.|||thanks heaps. ill implement it today and see what happens!

invalid row count

Hi,

I am building a shopping cart program, complete with an admin back end.
I am using ASP.NET, VB. NET and a SQL SERVER 2000 database.

The cart is working well... items can be added, updated and removed. However when trying to access the orders stored in the database from the admin section of the application, I am getting an "invalid record count" error.

I have no idea what this means. I've tried looking it up online, but so far no luck.

The orders are being stored in two tables connected via a foreign key.
I have no problem writing to the tables, it's just a problem reading the tables. I have dropped the two tables twice and rebuilt them, but I get the same error each time.

Any thoughts on what is causing this error?

Thanks,

-MichaelSince this is a sql server forum, maybe some sql would help...

Sounds more like an interface problem though.../|||Originally posted by Brett Kaiser
Since this is a sql server forum, maybe some sql would help...

Sounds more like an interface problem though.../

It is definitely starting to look more and more like an interface problem.
I just checked my SQL server logs and their are not database errors associated with this application.

Thanks,

Michaelsql

Invalid object name 'tsvw_

Hi Everyone!

Is someone here can help me on this?

I receive a error when inserting or Updating row in a replicated table

the error is Invalid object name 'tsvw_*****

What to do with this

More detail please... What version of SQL server are you using? What type of replication are you using? and etc...|||

Sorry, here some more

I'm using MSDE version of SQL 2000, and 3 layer merge replication, on a WAN

|||when you say three layers, do you mean you have a republishing scenario? "tsvw_*" is a view used by merge replication, my guess is that it may have been dropped somewhere during your setup. If you're doing a republishing scenario, make sure you set up A to B first, then republish B to C.

Friday, March 23, 2012

Invalid object name 'ctsv_F9F22D34FACE4A1BA4D2B061ADBEE5C1'

Hi,
I've a replication in a SQL Server 2000 to syncronize with a SQL CE 2.0.
When I try to update a row, I get this error: Invalid object name
'ctsv_F9F22D34FACE4A1BA4D2B061ADBEE5C1'
I get this error if I try to modify a row from enterprise manager too!
Can you help me please?
Thanks!
your merge replication metadata is out of sync. Script out your publication,
drop your publication, and then recreate it from script.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Andrea Grandi" <andrea@.nospam.com> wrote in message
news:uytKvf$TFHA.1796@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I've a replication in a SQL Server 2000 to syncronize with a SQL CE 2.0.
> When I try to update a row, I get this error: Invalid object name
> 'ctsv_F9F22D34FACE4A1BA4D2B061ADBEE5C1'
> I get this error if I try to modify a row from enterprise manager too!
> Can you help me please?
> Thanks!
|||Hi,

> your merge replication metadata is out of sync. Script out your publication,
> drop your publication, and then recreate it from script.
wich script? Can I drop/create from Enterprise Manager?
Anyway, now I've another problem... I exported only the 4 tables I was
interested in to another instance. I dropped the whole database and
re-imported the 4 tables. Now I cannot write on those tables
I tried to remove the rowguid column but I get this error "rowguid
column is not valid". I know it's not valid, I removed it!
Is there a way to fix my database?
Thanks!
|||Most probably some artefacts are left on you tables, such as merge replication triggers. They try to write to replication views, but views are not existing..
If triggers are not there, then we should think about something else..
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"Andrea Grandi" <andrea@.nospam.com> wrote in message news:%23EqCibBUFHA.3076@.TK2MSFTNGP12.phx.gbl...
Hi,

> your merge replication metadata is out of sync. Script out your publication,
> drop your publication, and then recreate it from script.
wich script? Can I drop/create from Enterprise Manager?
Anyway, now I've another problem... I exported only the 4 tables I was
interested in to another instance. I dropped the whole database and
re-imported the 4 tables. Now I cannot write on those tables
I tried to remove the rowguid column but I get this error "rowguid
column is not valid". I know it's not valid, I removed it!
Is there a way to fix my database?
Thanks!

Wednesday, March 21, 2012

Invalid Object Name

I am getting an error 'Invalid Object Name' when I try and insert a row yet I can query the same table and get results??
Please Help!Your login probably does not have permission to access the table, either because it has not been set specifically, or the table is not owned by either dbo or the login you are using.

If these are not the problems, then post your code so someone online can review it.|||I am logged in as SA, so I assumed I have permission. But I have also tried running the scripts below when logged in as 'sysdba' user.

Here is a line of code that gives the Invalid Object Name:-

insert into sysdba.hot_list ('HOT_LISTID', 'Jan' , 'type_of_activity') values ('TEMPHOT00JAN' ,'0' ,'Meeting')

This line executes without error:-

truncate table sysdba.hot_list

I must be missing something really obvious!

Thanks
Graham|||I'd suggest:insert into sysdba.hot_list ([HOTLISTID], [Jan] , [type_of_activity])
values ('TEMPHOT00JAN' ,'0' ,'Meeting')...or do without column name quoting at all.

-PatP|||trying...

insert into sysdba.hot_list ([HOTLISTID], [Jan] , [type_of_activity])
values ('TEMPHOT00JAN' ,'0' ,'Meeting')

...didn't work.

I need the column headers as there are more fields in the table than I am inserting with this script.

Thanks
Graham|||Please cut and paste the error message and post it for us.

-PatP|||Here it is:-

Server: Msg 208, Level 16, State 3, Line 1
Invalid object name 'sysdba.TEMP_HOT_LIST'.|||Does the TEMP_HOT_LIST table exist, or just the HOT_LIST table? Could the "problem child" be addressed in a trigger perhaps?

-PatP

Invalid Logical Page

When trying to DTS a table (Auth_Details) from one database to another, I received the following error message:
Error at Source for row number 296443, Errors encountered so far in this task: 1
Attempt to fetch logica page (1:566896) in database abc belongs to object 'Ben_Tables', not to object 'Auth_Details'.
Can anyone tell me what may cause this and how to get rid of the problem?
Thanks,
Joe
Seems you have a corruption in your database. Here's some generic info:
http://www.karaszi.com/sqlserver/inf...suspect_db.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"JoeA" <anonymous@.discussions.microsoft.com> wrote in message
news:8027A9B8-23E8-4F1A-945C-5A5328CC9B0D@.microsoft.com...
> When trying to DTS a table (Auth_Details) from one database to another, I received the following error
message:
> Error at Source for row number 296443, Errors encountered so far in this task: 1
> Attempt to fetch logica page (1:566896) in database abc belongs to object 'Ben_Tables', not to object
'Auth_Details'.
> Can anyone tell me what may cause this and how to get rid of the problem?
> Thanks,
> Joe

Invalid Logical Page

When trying to DTS a table (Auth_Details) from one database to another, I re
ceived the following error message:
Error at Source for row number 296443, Errors encountered so far in this tas
k: 1
Attempt to fetch logica page (1:566896) in database abc belongs to object 'B
en_Tables', not to object 'Auth_Details'.
Can anyone tell me what may cause this and how to get rid of the problem?
Thanks,
JoeSeems you have a corruption in your database. Here's some generic info:
http://www.karaszi.com/sqlserver/in..._suspect_db.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"JoeA" <anonymous@.discussions.microsoft.com> wrote in message
news:8027A9B8-23E8-4F1A-945C-5A5328CC9B0D@.microsoft.com...
> When trying to DTS a table (Auth_Details) from one database to another, I received
the following error
message:
> Error at Source for row number 296443, Errors encountered so far in this t
ask: 1
> Attempt to fetch logica page (1:566896) in database abc belongs to object 'Ben_Tab
les', not to object
'Auth_Details'.
> Can anyone tell me what may cause this and how to get rid of the problem?
> Thanks,
> Joesql

Monday, March 19, 2012

Invalid Data for Numeric when EXEC returns empty row

Hi, whenever the underlying query being called by EXEC in the following
has an empty result set I get the following error -- Invalid Data for
'Numeric' when EXEC returns empty row. However if I call the query
without using REPLACE (which I'm forced to do, because openquery does
not allow variables), I get just an empty result set. Whenever the
underlying query returns a non-empty result set, the code works without
error (regardless of wether there are nulls in the numeric column).

set @.switch ='5707550'
set @.start_date = '01-JAN-2006'
set @.end_date = '27-JAN-2006'
set @.month = 1
set @.year = 2006

set @.sql_str='
SELECT * FROM
(select MSC_KEY,
to_char(trunc(TSTAMP), ''yyyy-Mon-dd'') as "Timestamp",
ROUND( NVL(SUM(SUNRGMMSCBHCP1.XASUTIL),0) / DECODE (
NVL(SUM(SUNRGMMSCBHCP1.XASNXFR),0),0,NULL,NVL(SUM( SUNRGMMSCBHCP1.XASNXFR),0)
), 5)
as "PER_CPU_UTIL"
FROM NOR_GSM_COMPOSITE_MSC1_BHCPP SUNRGMMSCBHCP1,mscs_view v
WHERE SUNRGMMSCBHCP1.gsm_msc_key = v.msc_key and v.MSC_KEY in (' +
@.switch + ')
and SUNRGMMSCBHCP1.TSTAMP between to_date(''' + @.start_date + '
00:00:00'', ''DD-MON-YYYY HH24:MI:SS'') and
to_date(''' + @.end_date + ' 23:59:00'', ''DD-MON-YYYY
HH24:MI:SS'')

group by MSC_KEY, trunc(tstamp)
)
WHERE rownum < 10000'

SET @.sql_str = N'select * from OPENQUERY(VISION, ''' +
REPLACE(@.sql_str, '''', ''') + ''')'

EXEC (@.sql_str);

Is there anyway to prevent this error?

Thanks,

CrazyCrazy Cat wrote:
> Hi, whenever the underlying query being called by EXEC in the following
> has an empty result set I get the following error -- Invalid Data for
> 'Numeric' when EXEC returns empty row. However if I call the query
> without using REPLACE (which I'm forced to do, because openquery does
> not allow variables), I get just an empty result set. Whenever the
> underlying query returns a non-empty result set, the code works without
> error (regardless of wether there are nulls in the numeric column).

code deleted to save space ...

> Is there anyway to prevent this error?
> Thanks,
> Crazy

Found the problem -- apparently one of the keys was of type numeric and
I wasn't converting it to varchar before selecting it -- funny it
worked when the result set was non-empty.

Thanks,

Crazy

Friday, February 24, 2012

Intersecting Subtotals

I am trying to eliminate the value displayed in an intersecting
subtotal in a matrix. I have a subtotal setup for both the row and
column where the total of the column totals across the bottom isn't
appropriate to be totaled.
Is anyone aware of a way to identify this intersecting cell and change
it to a non-display field or to change the text color to white so it
isn't visible?
ThanksThis will identify all 4 versions of a cell:
=iif(InScope("ColumnGroup1"), iif(InScope("RowGroup1"), "In Cell", "In
Subtotal of RowGroup1"), iif(InScope("RowGroup1"), "In Subtotal of
ColumnGroup1", "In Subtotal of entire matrix"))
You can use it to change the background colour too. I have a matrix with
both row and column subtotal, and like you, I can't get the calculation to
work out for the intercepting cell. My cell expression looks like this:
=iif(InScope("matrix2_DateWeek_Year"),
iif(InScope("matrix2_DateWeek_Week"),
SUM(Fields!Measures_Billable_Hours.Value),
SUM(Fields!Measures_Billable_Hours.Value)),
iif(InScope("matrix2_DateWeek_Week"),
(First(Fields!Measures_Billable_Hours.Value, "matrix2_DateWeek_Week") -
Last(Fields!Measures_Billable_Hours.Value, "matrix2_DateWeek_Week")),
"x"))
The x shows up in the bottom right corner.
Kaisa M. Lindahl
"GregR" <grinard@.mesanetworks.net> wrote in message
news:1137777096.339565.269760@.z14g2000cwz.googlegroups.com...
>I am trying to eliminate the value displayed in an intersecting
> subtotal in a matrix. I have a subtotal setup for both the row and
> column where the total of the column totals across the bottom isn't
> appropriate to be totaled.
> Is anyone aware of a way to identify this intersecting cell and change
> it to a non-display field or to change the text color to white so it
> isn't visible?
> Thanks
>