SQL select error
Hi,
I tried the following..
statement.executeQuery("select pathloss from PathLossTable where srcx =" + x_coordinate + "AND (srcy = " + y_coordinate + ") AND (destx = " + bsPosX + ") AND (desty = " + bsPosY+")");
x_coordinate, y_coordinate, bsPoxX and bsPosY are variables, while srcx, srcy, destx and desty are column names in SQL table.
This gives me an error like
[Microsoft][ODBC Driver Manager] Invalid cursor state
Can anyone tell me what the error is??
Thanks,
Shashi
Where exactly is the exception thrown?
Like shashilv said:
Obviously not by executeQuery.
Post your code, what you are doing with the resultset.
Typical mistake with JDBC-ODBC:
It doesn't support more than 1 statement at the same time for the same connection.
Have you done this?
Similar Messages
-
I have a SQL Server connected intro a Windows Server 2003 Domain Active Directory, the server holds a default instance with a single Database, the SQL Server is 2005 Std Edition, and is using mix mode Authentification, then I able to create SQL Native Users
and Invoque Windows Domain Users also.
The Goal of this project is remove the sysadmin Server role for all the Windows Domain Users, to give then a more granular secure model but at the moment is this only way to connect at the Data Base Server.
I already create Native SQL Servers users without any problem!, they respect Securable Setting, Server Roles, User Mapping, everything...Just when I create a Login Profile form a Domain Users and apply the same setting, I get this error...
The SELECT permissions was denied on the object 'extended_properties', database 'mssqlsystemresource', schema 'sys'.(Microsoft SQL Server, Error:229)
But if the user have sysadmin Server Rol he can sing over the server without any issue, I review the .sys view extended_properties and "Public" is the only Database Role placed.
Any Idea if I need change any Setting in the Secure in SQL Master DataBase? or which is the issue witjh this matter?
Thank in advance for your help!Since there are so many possibilities for what might be wrong. Here's another possibility to look at. I ran into something where I had set up my own roles on a database. (For instance, "Administrator", "Manager", "DataEntry",
"Customer", each with their own kinds of limitations) The only ones who could use it were "Manager" role or above--because they were also set up as sysadmin because they were adding users to the database (and they were highly trusted).
Also, the users that were being added were Windows Domain users--using their domain credentials. (Everyone with access to the database had to be on our domain, but not everyone on the domain had access to the database--and only a few of them had access
to change it.)
Anyway, this working system suddenly stopped working and I was getting error messages similar to the above. What I ended up doing that solved it was to go through all the permissions for the "public" role in that database and add those permissions
to all of the roles that I had created. I know that everyone is supposed to be in the "public" role even though you can't add them (or rather, you can "add" them, but they won't "stay added").
So, in "SQL Server Management Studio", I went into my application's database, in other words (my localized names are obscured within <> brackets): "<Computername> (SQL Server <version> - sa)"\Databases\<MyAppDB>\Security\Roles\Database
Roles\public". Right-click on "public" and select "Properties". In the "Database Role Properties - public" dialog, select the "Securables" page. Go through the list and for each element in the
list, come up with an SQL "Grant" statement to grant exactly that permission to another role. So, for instance, there is a scalar function "[dbo].[fn_diagramobjects]" on which the "public" role has "Execute" privilege.
So, I added the following line:
EXEC ( 'GRANT EXECUTE ON [dbo].[fn_diagramobjects] TO [' + @RoleName + '];' )
Once I had done this for all the elements in the "Securables" list, I wrapped that up in a while loop on a cursor selecting through all the roles in my roles table. This explicitly granted all the permissions of the "public" role to
my database roles. At that point, all my users were working again (even after I removed their "sysadmin" access--done as a temporary measure while I figured out what happened.)
I'm sure there's a better (more elegant) way to do this by doing some kind of a query on the database objects and selecting on the public role, but after about half and hour of investigating, I wasn't figuring it out, so I just did it the brute-force method.
In case it helps someone else, here's my code.
CREATE PROCEDURE [dbo].[GrantAccess]
AS
DECLARE @AppRoleName AS sysname
DECLARE AppRoleCursor CURSOR LOCAL SCROLL_LOCKS FOR
SELECT AppRoleName FROM [dbo].[RoleList];
OPEN AppRoleCursor
FETCH NEXT FROM AppRoleCursor INTO @AppRoleName
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC ( 'GRANT EXECUTE ON [dbo].[fn_diagramobjects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_alterdiagram] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_creatediagram] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_dropdiagram] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_helpdiagramdefinition] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_helpdiagrams] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_renamediagram] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[all_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[all_objects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[all_parameters] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[all_sql_modules] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[all_views] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[allocation_units] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[assemblies] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[assembly_files] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[assembly_modules] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[assembly_references] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[assembly_types] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[asymmetric_keys] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[certificates] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[change_tracking_tables] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[check_constraints] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[column_type_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[column_xml_schema_collection_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[computed_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[conversation_endpoints] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[conversation_groups] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[conversation_priorities] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[crypt_properties] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[data_spaces] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_audit_specification_details] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_audit_specifications] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_files] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_permissions] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_principal_aliases] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_principals] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_role_members] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[default_constraints] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[destination_data_spaces] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[event_notifications] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[events] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[extended_procedures] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[extended_properties] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[filegroups] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[foreign_key_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[foreign_keys] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_catalogs] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_index_catalog_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_index_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_index_fragments] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_indexes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_stoplists] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_stopwords] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[function_order_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[identity_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[index_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[indexes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[internal_tables] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[key_constraints] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[key_encryptions] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[message_type_xml_schema_collection_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[module_assembly_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[numbered_procedure_parameters] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[numbered_procedures] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[objects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[parameter_type_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[parameter_xml_schema_collection_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[parameters] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[partition_functions] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[partition_parameters] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[partition_range_values] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[partition_schemes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[partitions] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[plan_guides] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[procedures] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[remote_service_bindings] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[routes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[schemas] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_contract_message_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_contract_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_contracts] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_message_types] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_queue_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_queues] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[services] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[spatial_index_tessellations] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[spatial_indexes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sql_dependencies] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sql_modules] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[stats] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[stats_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[symmetric_keys] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[synonyms] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[syscolumns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[syscomments] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysconstraints] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysdepends] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysfilegroups] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysfiles] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysforeignkeys] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysfulltextcatalogs] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysindexes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysindexkeys] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysmembers] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysobjects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[syspermissions] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysprotects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysreferences] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[system_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[system_objects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[system_parameters] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[system_sql_modules] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[system_views] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[systypes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysusers] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[table_types] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[tables] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[transmission_queue] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[trigger_events] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[triggers] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[type_assembly_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[types] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[views] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_indexes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_attributes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_collections] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_component_placements] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_components] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_elements] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_facets] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_model_groups] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_namespaces] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_types] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_wildcard_namespaces] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_wildcards] TO [' + @AppRoleName + '];' )
FETCH NEXT FROM AppRoleCursor INTO @AppRoleName
END
CLOSE AppRoleCursor
RETURN 0
GO
Once that is in the system, I just needed to "Exec GrantAccess" to make it work. (Of course, I have a table [RoleList] which contains a "AppRoleName" field that contains the names of the database roles.)
So, the mystery remains: why did all my users lose their "public" role and why could I not give it back to them? Was this part of an update to SQL Server 2008 R2? Was it because I ran another script to delete each user and add them back
so to refresh their connection with the domain? Well, this solves the issue for now.
One last warning: you probably should check the "public" role on your system before running this to make sure there isn't something missing or wrong, here. It's always possible something is different about your system.
Hope this helps someone else. -
I have created a user and given him the owner rights for the database. Though I can LogIn as the user, I cannot access the databases. I am having the error mesage:
Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The SELECT permission was denied on the object 'extended_properties', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error: 229)
For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=229&LinkId=20476
Sha_woopSince there are so many possibilities for what might be wrong. Here's another possibility to look at. I ran into something where I had set up my own roles on a database. (For instance, "Administrator", "Manager", "DataEntry", "Customer",
each with their own kinds of limitations) The only ones who could use it were "Manager" role or above--because they were also set up as sysadmin because they were adding users to the database (and they were highly trusted). Also, the users that
were being added were Windows Domain users--using their domain credentials. (Everyone with access to the database had to be on our domain, but not everyone on the domain had access to the database--and only a few of them had access to change it.)
Anyway, this working system suddenly stopped working and I was getting error messages similar to the above. What I ended up doing that solved it was to go through all the permissions for the "public" role in that database and add those permissions to
all of the roles that I had created. I know that everyone is supposed to be in the "public" role even though you can't add them (or rather, you can "add" them, but they won't "stay added").
So, in "SQL Server Management Studio", I went into my application's database, in other words (my localized names are obscured within <> brackets): "<Computername> (SQL Server <version> - sa)"\Databases\<MyAppDB>\Security\Roles\Database
Roles\public". Right-click on "public" and select "Properties". In the "Database Role Properties - public" dialog, select the "Securables" page. Go through the list and for each element in the list, come up with an SQL "Grant" statement to
grant exactly that permission to another role. So, for instance, there is a scalar function "[dbo].[fn_diagramobjects]" on which the "public" role has "Execute" privilege. So, I added the following line:
EXEC ( 'GRANT EXECUTE ON [dbo].[fn_diagramobjects] TO [' + @RoleName + '];' )
Once I had done this for all the elements in the "Securables" list, I wrapped that up in a while loop on a cursor selecting through all the roles in my roles table. This explicitly granted all the permissions of the "public" role to my database roles.
At that point, all my users were working again (even after I removed their "sysadmin" access--done as a temporary measure while I figured out what happened.)
I'm sure there's a better (more elegant) way to do this by doing some kind of a query on the database objects and selecting on the public role, but after about half and hour of investigating, I wasn't figuring it out, so I just did it the brute-force method.
In case it helps someone else, here's my code.
CREATE PROCEDURE [dbo].[GrantAccess]
AS
DECLARE @AppRoleName AS sysname
DECLARE AppRoleCursor CURSOR LOCAL SCROLL_LOCKS FOR
SELECT AppRoleName FROM [dbo].[RoleList];
OPEN AppRoleCursor
FETCH NEXT FROM AppRoleCursor INTO @AppRoleName
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC ( 'GRANT EXECUTE ON [dbo].[fn_diagramobjects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_alterdiagram] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_creatediagram] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_dropdiagram] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_helpdiagramdefinition] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_helpdiagrams] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT EXECUTE ON [dbo].[sp_renamediagram] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[all_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[all_objects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[all_parameters] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[all_sql_modules] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[all_views] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[allocation_units] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[assemblies] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[assembly_files] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[assembly_modules] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[assembly_references] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[assembly_types] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[asymmetric_keys] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[certificates] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[change_tracking_tables] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[check_constraints] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[column_type_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[column_xml_schema_collection_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[computed_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[conversation_endpoints] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[conversation_groups] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[conversation_priorities] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[crypt_properties] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[data_spaces] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_audit_specification_details] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_audit_specifications] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_files] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_permissions] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_principal_aliases] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_principals] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[database_role_members] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[default_constraints] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[destination_data_spaces] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[event_notifications] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[events] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[extended_procedures] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[extended_properties] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[filegroups] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[foreign_key_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[foreign_keys] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_catalogs] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_index_catalog_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_index_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_index_fragments] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_indexes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_stoplists] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[fulltext_stopwords] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[function_order_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[identity_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[index_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[indexes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[internal_tables] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[key_constraints] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[key_encryptions] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[message_type_xml_schema_collection_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[module_assembly_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[numbered_procedure_parameters] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[numbered_procedures] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[objects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[parameter_type_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[parameter_xml_schema_collection_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[parameters] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[partition_functions] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[partition_parameters] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[partition_range_values] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[partition_schemes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[partitions] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[plan_guides] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[procedures] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[remote_service_bindings] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[routes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[schemas] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_contract_message_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_contract_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_contracts] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_message_types] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_queue_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[service_queues] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[services] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[spatial_index_tessellations] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[spatial_indexes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sql_dependencies] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sql_modules] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[stats] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[stats_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[symmetric_keys] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[synonyms] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[syscolumns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[syscomments] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysconstraints] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysdepends] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysfilegroups] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysfiles] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysforeignkeys] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysfulltextcatalogs] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysindexes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysindexkeys] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysmembers] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysobjects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[syspermissions] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysprotects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysreferences] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[system_columns] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[system_objects] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[system_parameters] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[system_sql_modules] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[system_views] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[systypes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[sysusers] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[table_types] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[tables] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[transmission_queue] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[trigger_events] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[triggers] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[type_assembly_usages] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[types] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[views] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_indexes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_attributes] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_collections] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_component_placements] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_components] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_elements] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_facets] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_model_groups] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_namespaces] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_types] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_wildcard_namespaces] TO [' + @AppRoleName + '];' )
EXEC ( 'GRANT SELECT ON [sys].[xml_schema_wildcards] TO [' + @AppRoleName + '];' )
FETCH NEXT FROM AppRoleCursor INTO @AppRoleName
END
CLOSE AppRoleCursor
RETURN 0
GO
Once that is in the system, I just needed to "Exec GrantAccess" to make it work. (Of course, I have a table [RoleList] which contains a "AppRoleName" field that contains the names of the database roles.)
So, the mystery remains: why did all my users lose their "public" role and why could I not give it back to them? Was this part of an update to SQL Server 2008 R2? Was it because I ran another script to delete each user and add them back so to refresh
their connection with the domain? Well, this solves the issue for now.
One last warning: you probably should check the "public" role on your system before running this to make sure there isn't something missing or wrong, here. It's always possible something is different about your system.
Hope this helps someone else. -
Why sql select 'Hello'||'world012345678' from dual; cause error?
I have problem and your help to solve it would be very much appreciated.
Can anybody tell why the result is so different for the following two sql-sentence in SQL/PLus?
sql>select 'Hello'||'world012345678' from dual;
sql>select 'Hello'||'world0123456789' from dual;
sql>select 'Hello'||'world012345678' from dual;
Result:
select 'Hello'||'world012345678' from dual
ERROR at line 1:
ORA-00600: internal error code, arguments: [17182], [158346180], [], [], [],
sql>select 'Hello'||'world0123456789' from dual;
Helloworld0123456789
I found that if the length of one string equals 14, then the sql will failed as the first sentence.If you need to check the validity of DUAL then you have:
Select count(1) from DUAL ;
NOT
Select * from DUAL;
If you find more than 1, then
delete from dual;
insert into dual values ('x') ;
commit;
Then, try you offending query. -
Wierd SQL Select Compile Error
Hello.
When I do my SQL like this:
SQL SELECT cus_surname as "Surname",
cus_forename as
"FirstName",
cus_telephone as
"Telephone",
cus_address as
"Address1",
cus_line1 as
"Address2",
cus_line2 as
"Address3",
cus_town as
"Address4",
cus_city as
"Address5",
cus_postcode as
"Address6"
INTO :lCustomer
FROM msp_customers
WHERE cus_serial = :lRefCustomer.Serial
on session SessionToUse;
I get this compile error:
The read-only virtual attribute
FoundationClasses.FoundationBusinessObject.IsNew can't be passed as an
OUTPUT or an INPUT OUTPUT parameter.
Yet if I remove the "as" from the SQL Select syntax it works, with no
compile errors.
Why? I don't understand why they are different!
Tim Sawyer
PanCredit
Leeds, UK.
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>I added a DBMS_OUTPUT.put_line(l_wrap) in keith codes
and run out put wrapped test codes in sqlplus and can see wrapped test procedure.
create or replace procedure test wrapped
a000000
b2
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
7
11d 124
ohyVALi7ang26ROCF0CZ3wLg6ngwgy7Q2SdqfC/p+D6E39xrRLEK0/eVVEVSORSTWoZXk1gi
JT9nTrV3IXmGVbi5uMlIl+0C/WV9wPlFL5z37QfcEOYUdmLx8iwul2hEvDehUX0jLfiltHqx
MhAgy16zDvWPfv5uE4HrlBvRAYoDmETXR7r10x/uyQyUxDw4sVyq6Ndh4GSFw9zp801nKSN1
P0GOB03CtlcnrqAjQhASJKrP4sXW74oOyr373DBBP/CLndRTT0TZ1HvWVzAgL5C++Dl6PNyQ
But I got compiled errors as
Compilation errors for PROCEDURE SYS.TEST
Error: PLS-00103: Encountered the symbol "ASWALLET_OPEN" when expecting one of the following:
( ; is with authid as cluster compress order using compiled
wrapped external deterministic parallel_enable pipelined
result_cache
The symbol "is" was substituted for "ASWALLET_OPEN" to continue.
Line: 1
Text: create or replace procedure test wrapped
Error: PLS-00103: Encountered the symbol "=" when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table long double ref
char time timestamp interval date binary national character
nchar
The symbol "<an identifier>" was substituted for "=" to continue.
Line: 1
Text: create or replace procedure test wrapped
Error: PLS-00103: Encountered the symbol "=" when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table long double ref
char time timestamp interval date binary national character
nchar
Line: 1
Text: create or replace procedure test wrapped
.Bot trigger and procedure works well before wrapped.
I use oracle 11g2 at window 2003.
Thanks
newdba -
XDK for PL/SQL install errors
Is this a problem ?
resolver :
Error while turning off verifier
ORA-29532: Java call terminated by uncaught Java exception:
java.security.AccessControlException: the Permis
sion (oracle.aurora.security.JServerPermission Verifier ) has
not been granted by dbms_java.grant_permission to
SchemaProtectionDomain(SYSTEM|PolicyTableProxy(SYSTEM))
I also get some of these ...
errors : oracle/xml/sql/dml/OracleXMLSave
ORA-29534: referenced object
SYSTEM.oracle/xml/sql/core/OracleXMLConvert could not be resolved
skipping : oracle/xml/sql/core/OracleXMLTime is already resolved
resolving: oracle/xml/sql/core/OracleXMLConvert
errors : oracle/xml/sql/core/OracleXMLConvert
ORA-29521: referenced name oracle/gss/util/XmlValidate could
not be found
resolving: oracle/xml/sql/OracleXMLSQLNoRowsException
errors : oracle/xml/sql/OracleXMLSQLNoRowsException
ORA-29534: referenced object
SYSTEM.oracle/xml/sql/OracleXMLSQLException could not be resolved
resolving: oracle/xml/sql/core/OracleXMLUtil
errors : oracle/xml/sql/core/OracleXMLUtil
ORA-29534: referenced object
SYSTEM.oracle/xml/sql/core/OracleXMLConvert could not be resolved
At the end, the final test shows ...
SQL> Rem Use these to test the results..
SQL> select dbms_xmlquery.getxml('select * from dual', 2) from
dual;
select dbms_xmlquery.getxml('select * from dual', 2) from dual
ERROR at line 1:
ORA-29541: class
SYSTEM.oracle/xml/sql/query/OracleXMLStaticQuery could not be
resolved
ORA-06512: at "SYSTEM.DBMS_XMLQUERY", line 20
ORA-06512: at "SYSTEM.DBMS_XMLQUERY", line 271
ORA-06512: at line 1
Can anyone please help. My load command was ...
./xdkload -u "system/manager" -s -noverify -dbver "817"
I'm trying to load version 9.0.2.0.0C into an 8.1.7 instance on
HP-UX 11. Before running the script, I had to set environment
variables INSTALL_ROOT, and LD_LIBRARY_PATH (we use
SHLIB_PATH). I haven't actually found any installation
instructions, so I've only got this far by poking around. Any
help is much appreciated.
SteveSounds like the same problem described in a number of posts
recently.
Re: Startup/Shutdown 9iAS on windows
http://forums.oracle.com/forums/message.jsp?id=550104
The problem is caused by unresolved classes in the XSU package
from the latest Beta, I hope someone from Oracle can take a look
at this.
Good luck!
Ola -
Java.sql.SQLException: Error in allocating a connection
hi,
I have developed enterprise application using net beans IDE 5.5.I created one enity bean using sql server database.When i tried deploy this project i am getting following error...
Internal Exception: java.sql.SQLException: Error in allocating a connection.
Cause: Class name is wrong or classpath is not set for : com.microsoft.jdbc.sqlserver.SQLServerDataSourceError
can anybody please help me.....where i went wrong...i am new to netbeans IDE
regrds
patelu need to download the three jar files.
download the following jar files and add in ur classpath.
msutil-2000.sp2-lib.jar
msbase-2000.sp2-lib.jar
mssqlserver-2000.sp2-lib.jar
This is sample program...
u can test in standalone first and do in netbeans....
import java.sql.*;
public class querybean {
public String getdata(String sql) {
try {
System.out.println("testing connection ");
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;databaseName=master;user=sa;password=userpass;");
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery(sql);
System.out.println("testing connection pooling");
while(rs.next()) {
System.out.println(rs.getString(1));
} catch(Exception e1) {
System.out.println("exception caught" + e1);
return "";
public static void main (String args[]) throws Exception {
querybean qb = new querybean();
qb.getdata("select * from sampletable");
I belive it will work now -
I am getting "ORA-00900: invalid SQL statement" error.?
I did installed oracle 11gR2. and used "DBMS_METADATA_DIFF.COMPARE_ALTER('TABLE','TBL_A','TBL_A','USER1','USER2')" to see the result like below, but I am getting "ORA-00900: invalid SQL statement" error. Any idea?
I am using:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> desc user1.tbl_a
Name Null? Type
FIELD_A1 NOT NULL NUMBER
FIELD_A2 VARCHAR2(20)
FIELD_A4 NOT NULL NUMBER(5,2)
FIELD_A5 VARCHAR2(10)
FIELD_A6 NOT NULL NUMBER(2)
SQL> desc user2.tbl_a
Name Null? Type
FIELD_A1 NOT NULL NUMBER
FIELD_A2 VARCHAR2(50)
FIELD_A3 DATE
FIELD_A4 NUMBER(5,2)
FIELD_A5 NOT NULL VARCHAR2(10)
SQL> select dbms_metadata_diff.compare_alter('TABLE','TBL_A','TBL_A','USER1','USER2') from dual
expected result:
DBMS_METADATA_DIFF.COMPARE_ALTER('TABLE','TBL_A','TBL_A','U1','U2')
ALTER TABLE "U1"."TBL_A" ADD ("FIELD_A3" DATE)
ALTER TABLE "U1"."TBL_A" DROP ("FIELD_A6")
ALTER TABLE "U1"."TBL_A" MODIFY ("FIELD_A2" VARCHAR2(50))
ALTER TABLE "U1"."TBL_A" MODIFY ("FIELD_A4" NUMBER(5,2) DEFAULT 0)
ALTER TABLE "U1"."TBL_A" MODIFY ("FIELD_A4" NULL)
ALTER TABLE "U1"."TBL_A" MODIFY ("FIELD_A5" NOT NULL ENABLE)Thanks for reply rp,
I got result using "select dbms_metadata_diff.compare_alter('TABLE','TBL_A','TBL_A','USER1','USER2') from dual" -
ORA-00900: invalid SQL statement Error while Executing Procedure
Hi:
I am trying to execute following procedure through java code, but i am getting ORA-00900: invalid SQL statement error.
Procedure is :
<code>
(vResult out int)
as
vCardId varchar2(16);
vForacid varchar2(16);
vApp_Entry_No varchar2(10);
vSrNo number(6);
vCardStatus char(1);
vCardStat char(2);
vExpiryDate date;
Cursor cardCur1 is
select u.card_number,trim(u.ACCOUNT_NUMBER),u.CARD_STATUS,to_char(u.EXPIRY_DATE,'dd-MM-yyyy')
FROM DailyCardData u
where default_indicator='1'
and isprocessed = 'N'
order by expiry_date;
begin
vSrNo := 0;
vResult := 0;
open cardCur1;
Loop
fetch cardCur1 into vCardId,vForacid,vCardStat,vExpiryDate;
if cardCur1%NOTFOUND then
exit;
end if;
if (vCardStat != null) then
vCardStatus := 'H';
elsif (vExpiryDate <= sysdate) then
vCardStatus := 'E';
else
vCardStatus := null;
end if;
select a.app_entry_no into vApp_Entry_No from Application a,ApplicationLinkedAccounts l
where l.foracid = vForacid and l.AcSrNo = '1'
and a.app_entry_no = l.app_entry_no
and a.cardid is null
and a.DOWNLOADFILECREATIONFLAG = 'Y';
update Application set CardId = vCardId,
Card_Status = vCardStatus,APPLICATIONPROCESSEDFLAG = 'Y',
APPLICATIONPROCESSEDdate = DOWNLOADFILECREATIONdate
where App_Entry_No = vApp_Entry_No;
commit;
update DailyCardData set isprocessed = 'Y',app_entry_no = vApp_Entry_No
where card_number = vCardId;
commit;
end Loop;
close cardCur1;
vResult := 1;
end;
</code>
Can any body help me in that?
Thank You,
AnupFirst of all I don't see a procedure header.
Secondly I see you commit inside your procedure. This is a bug.
Thirdly I see you also commit inside a loop. This is also a bug, and needs to be removed asap.
The error indicates a statement doesn't parse. As you don't post the error stack, nor a table definition no one can reproduce the problem.
You need to isolate the statements, one by one, and run them through sql*plus to see what happens.
Sybrand Bakker
Senior Oracle DBA -
SQL execution error, ORA-01843: not a valid month
Im using ASP/VBScript and its my first time starting to use Oracle as a DB provider.
Just having an issue with a statement that I have.
Heres my statement:
SELECT T592_NOON.SHIP_CODE, T592_NOON.REPORT_DATE, T592_NOON.L_B, T592_NOON.AVERAGE_SPEED, T592_NOON.SEASTATE, T592_NOON.DISTANCE, T592_NOON.WIND_DIRECTION, T592_NOON.IFO_MAIN, T592_NOON.IFO_BOILER, T592_NOON.IFO_AUXENGINE FROM T592_NOON WHERE (((SHIP_CODE)='S271') AND (REPORT_DATE BETWEEN to_date('08/02/2004 13:00:00', 'DD-MON-YYYY HH24:MI') and to_date('28/02/2004 18:15:00', 'DD-MON-YYYY HH24:MI')))
Whenever I run it it errors and returns:
SQL execution error, ORA-01843: not a valid month
Can anyone tell why this wouldnt work?
REPORT_DATE type is DATE
REPORT_DATE Sample data: 2003-04-28-12.00.00.000000Changing the format of the date seemed to fix it.
Incorrect: '08/02/2004 13:00:00'
Correct: '08-FEB-2004 13:00' -
Hello,
I've encountered issue during installation of SP1 to SQL Server 2012. After upgrade I'm getting this error in Event Log:
Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 537, state 3, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline.
If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script
upgrade steps run to completion.
Can someone point me direction how I can fix it? This is a production server and currently only way to make it working is to use T902 flag in SQL Server startup params. I've found some suggestions to check Data path if it exists but it does so this is not
the issue here. Any ideas?
I've found also here
http://www.sqlservercentral.com/Forums/Topic1377073-1550-1.aspx#bm1378279
suggestions for similar issue with SQL Server 2008 which that I should do:
Via ssms:
From msdb:
Delete:
dc_admin role
Dc_operator role
Dc_proxy role
UlitityCMRReader role
UtilityIMRReader role
UtilityIMRWriter role
but for not I didn't tried it yet. This is standalone SQL Server instance.
Any help really appreciated.
RegardsScript returns the same error.
System databases:
1 1 760 -1 10 1048578 0 1 master C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\master.mdf
2 0 12768 -1 10 1048642 0 1 mastlog C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
1 1 1024 -1 10 1048578 0 2 tempdev C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\tempdb.mdf
2 0 64 -1 10 1048642 0 2 templog C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\templog.ldf
1 1 288 -1 128 2 0 3 modeldev C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\model.mdf
2 0 4464 -1 10 1048642 0 3 modellog C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\modellog.ldf
1 1 28936 -1 10 1048578 0 4 MSDBData C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\MSDBData.mdf
2 0 3352 268435456 10 1048642 0 4 MSDBLog C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\MSDBLog.ldf
are all in place where path shows.
Before sending my message I've searched update script for "FROM master.sys.master_files" and I found script which you are showing me. I've made some digging and when I runned:
SELECT physical_name
FROM master.sys.master_files
WHERE (name = N'master')
it returned also path to one my customers database name which has filename set correctly but it's Logical DB name is master and mastlog. I'm running shared hosting company and I allow my customers to restore their DBs from .bak files but I have no idea why
this customers logical name is set to master and mastlog. Probably when I change this names update script will work as it should. On the other hand in my opinion there should be some kind of fail safe mechanism for situations like this one.
EDIT: After changing logical name for DB and log for mentioned DB your script runned fine so probably now when I remove T902 flag and restart my SQL Server update will run correctly. Big thanks for resolving this issue. -
SharePoint 2010 SQL Permission Errors
We occasionally receive errors in the Event Log for SQL permission errors. I am not able to find what exactly is causing the issue and don't want to grant rights to something if I don't know what it is doing. There error is not specific
to a particular list or library. Below is one example of the ULS log output. I see references to a deadlock but also permission denied.
Name=Request (GET:https://subsite.contoso.com:443/HomePage/Forms/AllItems.aspx)
Site=/
Leaving Monitored Scope (PostResolveRequestCacheHandler). Execution Time=13.8458
Videntityinfo::isFreshToken reported failure.
Begin Query the AD to get the user email and display name.
End Query the AD to get the user email and display name.
System.Data.SqlClient.SqlException: The EXECUTE permission was denied on the object 'proc_SecAddUser', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.
The EXECUTE permission was denied on the object 'proc_AddListItem', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.
The EXECUTE permission was denied on the object 'proc_UpdateDiskUsed', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)
at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock)
at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock)
at Microsoft.SharePoint.Library.SPRequestInternalClass.OpenWebInternal(String bstrUrl, Guid& pguidID, String& pbstrRequestAccessEmail, UInt32& pwebVersion, String& pbstrServerRelativeUrl, UInt32& pnLanguage, UInt32& pnLocale, String& pbstrDefaultTheme, String& pbstrDefaultThemeCSSUrl, String& pbstrThemedCssFolderUrl, String& pbstrAlternateCSSUrl, String& pbstrCustomizedCssFileList, String& pbstrCustomJSUrl, String& pbstrAlternateHeaderUrl, String& pbstrMasterUrl, String& pbstrCustomMasterUrl, String& pbstrSiteLogoUrl, String& pbstrSiteLogoDescription, Object& pvarUser, Boolean& pvarIsAuditor, Int32& plSiteFlags, Boolean& pbOverwriteMUICultures, Boolean& pbMUIEnabled, String& pbstrAlternateMUICultures, Int32& puiVersion, Int16& pnClientTag)
at Microsoft.SharePoint.Library.SPRequest.OpenWebInternal(String bstrUrl, Guid& pguidID, String& pbstrRequestAccessEmail, UInt32& pwebVersion, String& pbstrServerRelativeUrl, UInt32& pnLanguage, UInt32& pnLocale, String& pbstrDefaultTheme, String& pbstrDefaultThemeCSSUrl, String& pbstrThemedCssFolderUrl, String& pbstrAlternateCSSUrl, String& pbstrCustomizedCssFileList, String& pbstrCustomJSUrl, String& pbstrAlternateHeaderUrl, String& pbstrMasterUrl, String& pbstrCustomMasterUrl, String& pbstrSiteLogoUrl, String& pbstrSiteLogoDescription, Object& pvarUser, Boolean& pvarIsAuditor, Int32& plSiteFlags, Boolean& pbOverwriteMUICultures, Boolean& pbMUIEnabled, String& pbstrAlternateMUICultures, Int32& puiVersion, Int16& pnClientTag)
at Microsoft.SharePoint.SPWeb.InitWebPublic()
at Microsoft.SharePoint.SPWeb.get_Url()
at Microsoft.SharePoint.SPGroup.InitMember()
at Microsoft.SharePoint.SPGroup..ctor(SPWeb web, SPSecurableObject scope, SPUser user, String GroupName, Object[,] arrGroupsData, UInt32 index, Int32 iByParamId, SPGroupCollectionType groupCollectionType)
at Microsoft.SharePoint.SPGroupCollection.get_Item(String name)
at Microsoft.SharePoint.Administration.SPFarm.PerformCentralAdministratorsGroupOperation(AdminGroupOperation operation, String[] usersToAdd, String[] usersToRemove, Boolean& groupExists)
at Microsoft.SharePoint.Administration.SPFarm.CurrentUserIsAdministrator(Boolean allowContentApplicationAccess)
at Microsoft.SharePoint.SPSite.set_AdministratorOperationMode(Boolean value)
at Microsoft.SharePoint.SPFeatureManager.EnsureSiteAndWeb(SPUrlZone zone, Guid databaseid, Guid siteid, Guid webid, SPSite& site, SPWeb& web)
at Microsoft.SharePoint.SPFeatureManager.<>c__DisplayClass19.<GetFeatureRootAndListSchemaPaths>b__18()
at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, Boolean bResetContext, WaitCallback code, Object param)
at Microsoft.SharePoint.SPFeatureManager.GetFeatureRootAndListSchemaPaths(Byte[]& userToken, Guid& tranLockerId, Int32 nZone, Guid databaseid, Guid siteid, Guid webid, Guid featid, Int32 ltid, String& sPathToFeatureRoot, String& sPathToSchemaXml)
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetViewsSchemaXml(String bstrUrl, String bstrListName, Boolean bFullBlown, Boolean bNeedInitAllViews, ISP2DSafeArrayWriter p2DWriter, Int32& plDefaultViewIndex, Int32& plMobileDefaultViewIndex)
at Microsoft.SharePoint.Library.SPRequest.GetViewsSchemaXml(String bstrUrl, String bstrListName, Boolean bFullBlown, Boolean bNeedInitAllViews, ISP2DSafeArrayWriter p2DWriter, Int32& plDefaultViewIndex, Int32& plMobileDefaultViewIndex)
at Microsoft.SharePoint.SPViewCollection.EnsureViewSchema(Boolean fullBlownSchema, Boolean bNeedInitallViews)
at Microsoft.SharePoint.SPList.get_Views()
at Microsoft.SharePoint.SPList.get_DefaultViewUrl()
at Microsoft.SharePoint.Publishing.CachedList..ctor(SPList list, CachedObjectFactory factory)
at Microsoft.SharePoint.Publishing.CachedArea.GetChildListByGuid(Guid listIdGuid)
at Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationSettings.GetCachedList(SPWeb web, Guid listId)
at Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationSettings.GetMetadataNavSettingsXml(SPWeb web, Guid sourceListId, Boolean& listExists)
at Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationSettings.GetMetadataNavigationSettings(SPWeb web, Guid sourceListId, Boolean checkWebPropHint)
at Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationContext.get_NavigationSettings()
at Microsoft.Office.DocumentManagement.MetadataNavigation.MetadataNavigationContext.EnsurePageInitEventHandling(Control controlOnPage)
at Microsoft.Office.Server.WebControls.MetadataHierarchyDataSourceControl.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at Microsoft.SharePoint.WebControls.DelegateControl.AddControlResilient(Control ctl)
at Microsoft.SharePoint.WebControls.DelegateControl.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at Microsoft.SharePoint.WebControls.DelegateControl.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at System.Web.UI.ControlBuilder.BuildChildren(Object parentObj)
at System.Web.UI.TemplateBuilder.InstantiateIn(Control container)
at Microsoft.SharePoint.WebControls.UIVersionedContent.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at Microsoft.SharePoint.WebControls.UIVersionedContent.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
SqlError: 'The EXECUTE permission was denied on the object 'proc_SecAddUser', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.' Source: '.Net SqlClient Data Provider' Number: 229 State: 5 Class: 14 Procedure: 'proc_SecAddUser' LineNumber: 1 Server: 'sqlserver.contoso.com'
SqlError: 'The EXECUTE permission was denied on the object 'proc_AddListItem', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.' Source: '.Net SqlClient Data Provider' Number: 229 State: 5 Class: 14 Procedure: 'proc_AddListItem' LineNumber: 1 Server: 'sqlserver.contoso.com'
SqlError: 'The EXECUTE permission was denied on the object 'proc_UpdateDiskUsed', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.' Source: '.Net SqlClient Data Provider' Number: 229 State: 5 Class: 14 Procedure: 'proc_UpdateDiskUsed' LineNumber: 1 Server: 'sqlserver.contoso.com'
Insufficient SQL database permissions for user 'Name: contoso\user1 SID: S-1-5-21-1326408308-1533151006-945732055-253740
ImpersonationLevel: Impersonation' in database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99' on SQL Server instance 'sqlserver.contoso.com'.
Additional error information from SQL Server is included below.
The EXECUTE permission was denied on the object 'proc_SecAddUser', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.
The EXECUTE permission was denied on the object 'proc_AddListItem', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.
The EXECUTE permission was denied on the object 'proc_UpdateDiskUsed', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.
ConnectionString: 'Data Source=sqlserver.contoso.com;
Initial Catalog=SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99;
Integrated Security=True;
Enlist=False;
Asynchronous Processing=False;
Connect Timeout=15' ConnectionState: Closed ConnectionTimeout: 15
SqlCommand:
'SET NOCOUNT ON;
DECLARE @DN nvarchar(256),@LN nvarchar(128),@@DocUIVersion int,@@Level tinyint,@@S uniqueidentifier;
DECLARE @ItemId int;
DECLARE @@iRet int;
DECLARE @ExtraItemSize int;
DECLARE @Login nvarchar(255);
DECLARE @Title nvarchar(255);
DECLARE @Email nvarchar(255);
DECLARE @Notes nvarchar(1023);
DECLARE @MobilePhone nvarchar(127);
DECLARE @AddedToTable bit;
DECLARE @UserIdOut int;
DECLARE @LoginOut nvarchar(255);
DECLARE @TitleOut nvarchar(255);
DECLARE @EmailOut nvarchar(255);
DECLARE @NotesOut nvarchar(1023);
DECLARE @MobilePhoneOut nvarchar(127);
DECLARE @DeletedOut bit;
DECLARE @NeedtoAddtoList bit;
DECLARE @IsGroup bit;
SET @IsGroup = 0;
SET @@Level = 1;
SELECT @Login = @wssp0;
SELECT @Title = @wssp1;
SELECT @Email = @wssp2;
SELECT @Notes = @wssp3;
SELECT @MobilePhone = @wssp4;
SELECT @@S=@wssp5;
EXEC @@iRet = proc_SecAddUser @@S, @wssp6, @wssp7, @wssp8, @wssp9, @wssp10, @Login, @Title, @Email, @Notes, @MobilePhone, @wssp11, @wssp12, @wssp13, @wssp14, @AddedToTable OUTPUT, @UserIdOut OUTPUT, @LoginOut OUTPUT, @TitleOut OUTPUT, @EmailOut OUTPUT, @NotesOut OUTPUT, @MobilePhoneOut OUTPUT, @DeletedOut OUTPUT, @NeedtoAddtoList OUTPUT;
IF @@iRet <> 0 BEGIN GOTO DONE;
END ;
SELECT @ItemId = @UserIdOut;
IF @NeedtoAddtoList = 0 BEGIN GOTO DONE;
END ;
BEGIN TRAN IF NOT EXISTS( SELECT tp_ID FROM UserData WHERE tp_ListId = 'E97F9667-B512-4AF9-8F98-ABA92DA3D4A2' AND tp_ID = @ItemId AND tp_Level = 1 AND tp_RowOrdinal =0) BEGIN SELECT @ExtraItemSize = 0 EXEC @@iRet = proc_AddListItem @SiteId =@wssp15,@WebId=@wssp16,@ListID=@wssp17,@RowOrdinal=@wssp18,@ItemDocType=@wssp19,@SortTypeReversed=@wssp20,@RetainId=@wssp21,@RetainObjectIdentity=@wssp22,@ItemId = @ItemId OUTPUT,@ItemDirName=@DN OUTPUT,@ItemLeafName=@LN OUTPUT,@UserID=@wssp23,@tp_Author = @ItemId,@tp_Editor = @ItemId,@TimeNow=@wssp24,@CopySecurityFromMasterID=@wssp25,@UseNvarchar1ItemName=@wssp26,@ServerTemplate=@wssp27,@IsNotUserDisplayed=@wssp28,@Basetype=@wssp29,@Level=@wssp30,@UIVersion=@wssp31,@tp_GUID=@wssp32,@CheckSchemaVersion=@wssp33,@OnRestore=@wssp34,@AddNamespace=@wssp35,@CheckDiskQuota=@wssp36, @tp_ContentTypeId = @wssp37, @nvarchar1 = @wssp38, @tp_ModerationStatus = @wssp39, @nvarchar3 = @wssp40, @nvarchar4 = @wssp41, @nvarchar5 = @wssp42, @nvarchar6 = @wssp43, @bit2 = @wssp44, @bit3 = @wssp45, @nvarchar9 = @wssp46, @nvarchar10 = @wssp47, @bit4 = @wssp48, @Size=@wssp49, @ExtraItemSize = @ExtraItemSize , @eventData=@wssp50, @acl=@wssp51, @DocClientId=@wssp52;
IF @@iRet <> 0 BEGIN ROLLBACK TRAN;
GOTO DONE;
END END ;
COMMIT TRAN;
EXEC proc_UpdateDiskUsed @@S, 1;
DONE:
SELECT @@iRet, @ItemId, @AddedToTable, @LoginOut, @TitleOut, @EmailOut, @NotesOut, @MobilePhoneOut, @DeletedOut '
CommandType: Text
CommandTimeout: 0
Parameter: '@wssp0'
Type: NVarChar
Size: 4000
Direction: Input
Value: 'NT AUTHORITY\LOCAL SERVICE'
Parameter: '@wssp1'
Type: NVarChar
Size: 4000
Direction: Input
Value: 'UserLast, UserFirst'
Parameter: '@wssp2'
Type: NVarChar
Size: 4000
Direction: Input
Value: ''
Parameter: '@wssp3'
Type: NVarChar
Size: 4000
Direction: Input
Value: ''
Parameter: '@wssp4'
Type: NVarChar
Size: 4000
Direction: Input
Value: ''
Parameter: '@wssp5'
Type: UniqueIdentifier
Size: 0
Direction:
Input Value: 'eb7d8a16-18a1-46d7-a35d-36eedccb321b'
Parameter: '@wssp6'
Type: VarBinary
Size: 8000
Direction: Input
Parameter: '@wssp7'
Type: VarBinary
Size: 8000
Direction: Input
Parameter: '@wssp8'
Type: DateTime
Size: 0
Direction: Input
Value: '04/24/2014 13:49:03'
Parameter: '@wssp9'
Type: Bit Size: 0
Direction: Input
Value: 'False'
Parameter: '@wssp10'
Type: Bit
Size: 0
Direction: Input
Value: 'False'
Parameter: '@wssp11'
Type: Int
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp12'
Type: UniqueIdentifier
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp13'
Type: Bit
Size: 0
Direction: Input
Value: 'False'
Parameter: '@wssp14'
Type: Bit
Size: 0
Direction: Input
Value: 'False'
Parameter: '@wssp15'
Type: UniqueIdentifier
Size: 0
Direction: Input
Value: 'eb7d8a16-18a1-46d7-a35d-36eedccb321b'
Parameter: '@wssp16'
Type: UniqueIdentifier
Size: 0
Direction: Input
Value: 'c3cfb850-7d5e-4fd1-bea7-c2add4127427'
Parameter: '@wssp17'
Type: UniqueIdentifier
Size: 0
Direction: Input
Value: 'e97f9667-b512-4af9-8f98-aba92da3d4a2'
Parameter: '@wssp18'
Type: TinyInt
Size: 1
Direction: Input
Value: '0'
Parameter: '@wssp19'
Type: TinyInt
Size: 1
Direction: Input
Value: '0'
Parameter: '@wssp20'
Type: Bit
Size: 0
Direction: Input
Value: 'False'
Parameter: '@wssp21'
Type: UniqueIdentifier
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp22'
Type: Bit
Size: 0
Direction: Input
Value: 'False'
Parameter: '@wssp23'
Type: Int
Size: 0
Direction:
Input Value: '-1'
Parameter: '@wssp24'
Type: DateTime
Size: 0
Direction: Input
Value: '04/24/2014 13:49:03'
Parameter: '@wssp25'
Type: Int
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp26'
Type: Bit
Size: 0
Direction: Input
Value: 'True'
Parameter: '@wssp27'
Type: Int
Size: 0
Direction: Input
Value: '112'
Parameter: '@wssp28'
Type: Bit
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp29'
Type: Int
Size: 0
Direction: Input
Value: '0'
Parameter: '@wssp30'
Type: TinyInt
Size: 1
Direction: Input
Value: '1'
Parameter: '@wssp31'
Type: Int
Size: 0
Direction: Input
Value: '512'
Parameter: '@wssp32'
Type: UniqueIdentifier
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp33'
Type: Int
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp34'
Type: Bit
Size: 0
Direction:
Input Value: 'False'
Parameter: '@wssp35'
Type: Bit
Size: 0
Direction: Input
Value: 'True'
Parameter: '@wssp36'
Type: Bit
Size: 0
Direction: Input
Value: 'False'
Parameter: '@wssp37'
Type: VarBinary
Size: 8000
Direction: Input
Parameter: '@wssp38'
Type: NVarChar
Size: 4000
Direction: Input
Value: 'UserLast, UserFirst'
Parameter: '@wssp39'
Type: Int
Size: 0
Direction: Input
Value: '0'
Parameter: '@wssp40'
Type: NVarChar
Size: 4000
Direction: Input
Value: 'NT AUTHORITY\LOCAL SERVICE'
Parameter: '@wssp41'
Type: NVarChar
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp42'
Type: NVarChar
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp43'
Type: NVarChar
Size: 0
Direction:
Input Value: ''
Parameter: '@wssp44'
Type: Bit
Size: 0
Direction: Input
Value: 'False'
Parameter: '@wssp45'
Type: Bit
Size: 0
Direction: Input
Value: 'False'
Parameter: '@wssp46'
Type: NVarChar
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp47'
Type: NVarChar
Size: 0
Direction: Input
Value: ''
Parameter: '@wssp48'
Type: Bit
Size: 0
Direction: Input
Value: 'False'
Parameter: '@wssp49'
Type: Int
Size: 0
Direction: Input
Value: '82'
Parameter: '@wssp50'
Type: VarBinary
Size: 0
Direction: Input
Parameter: '@wssp51'
Type: VarBinary
Size: 8000
Direction: Input
Parameter: '@wssp52'
Type: VarBinary
Size: 0
Direction: Input
System.Data.SqlClient.SqlException:
The EXECUTE permission was denied on the object 'proc_SecAddUser', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.
The EXECUTE permission was denied on the object 'proc_AddListItem', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.
The EXECUTE permission was denied on the object 'proc_UpdateDiskUsed', database 'SharePoint_AdminContent_d4605df0-8a2d-44e0-8805-8d65c4d73d99', schema 'dbo'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)
at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock)
at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock)
Videntityinfo::isFreshToken reported failure.
Leaving Monitored Scope (CachedList:HomePage). Execution Time=15.1112
Leaving Monitored Scope (Load CachedList:151c2f9a-be3a-42ad-a4c6-379cb6ec05ad). Execution Time=825.2132
Leaving Monitored Scope (Request (GET:https://subsite.contoso.com:443/HomePage/Forms/AllItems.aspx)). Execution Time=966.741did you check this post,
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/5f8003a0-f845-4fb6-8b43-a0a234bcb1ea/the-execute-permission-was-denied-on-the-object-multiple-alerts?forum=sharepointadminprevious
Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog -
I am using the following query in Execute SQL Task
SELECT CASE(SELECT COUNT(*) FROM STG_APJ_APIW_DETAILS
WHERE source_filename = ?
AND lTRIM(RTRIM([BILLING DATE])) <> '') WHEN 0 THEN (SELECT CONVERT(VARCHAR(8), GETDATE(), 112) AS [YYYYMMDD])
ELSE
(SELECT TOP 1 [BILLING DATE] FROM STG_APJ_APIW_DETAILS
WHERE source_filename = ?
AND lTRIM(RTRIM([BILLING DATE])) <> '')
END
In parameter Mapping i have created two parameters and in result set i choose my variable.
Result set property is Single Row.
Following is the error message i received,
[Execute SQL Task] Error: Executing the query "SELECT CASE(SELECT COUNT(*) FROM STG_APJ_APIW_DETA..." failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems
with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
SarvanI cant see where you've named resultset. try like below to make sure resultset has the name used in resultset tab
SELECT CASE(SELECT COUNT(*) FROM STG_APJ_APIW_DETAILS
WHERE source_filename = ?
AND lTRIM(RTRIM([BILLING DATE])) <> '') WHEN 0 THEN (SELECT CONVERT(VARCHAR(8), GETDATE(), 112))
ELSE
(SELECT TOP 1 [BILLING DATE] FROM STG_APJ_APIW_DETAILS
WHERE source_filename = ?
AND lTRIM(RTRIM([BILLING DATE])) <> '')
END AS [Billing Date]
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
SSIS - Using Variables in Execute SQL Task Error
The following query in my Execute SQL Task throws the following error when run - [Execute SQL Task] Error: Executing the query "SELECT @columnz = COALESCE(@columnz + ',[' + times..." failed with the following error:
"Must declare the scalar variable "@columnz".". Possible failure reasons: Problems with the query,
"ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Query:
drop table tmpNCPCNCDownstreamMaxUtilization3wks
select node, max(utilization) as max_Utilization, DATE
into tmpNCPCNCDownstreamMaxUtilization3wks
from stage_ncpcncdownstream_temporal
WHERE Date BETWEEN DATEADD(day, -20, GETDATE()) AND GETDATE()
group by node, date
order by node
go
alter table tmpNCPCNCDownstreamMaxUtilization3wks add Timestamp varchar(50)
go
update tmpNCPCNCDownstreamMaxUtilization3wks
set Timestamp = 'WeekOf_' + cast(left(Date, 11) as varchar)
go
--drop table tmpNCPCNC_DownstreamNodeUtilizationMaxPivot
--go
declare @columnz varchar (8000)
go
SELECT @columnz = COALESCE(@columnz + ',[' + timestamp + ']','[' + timestamp+ ']')
FROM tmpNCPCNCDownstreamMaxUtilization3wks group by timestamp order by timestamp
go
--pivot contents in @columns
declare @query varchar(8000)
SET @query ='select * into tmpNCPCNC_DownstreamNodeUtilizationMaxPivot from
(select node, timestamp, Max_Utilization from tmpNCPCNCDownstreamMaxUtilization3wks)a
pivot
sum(max_Utilization) for timestamp in('+ @columnz +')
)as p'
execute (@query)
--empty contents from NCPCNCDownstreamMaxUtilization3wks
update tmpNCPCNCDownstreamMaxUtilization3wks
set timestamp =''
truncate table tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
--load to table to be joined to Node feature class
insert into tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
(Node, TwoWeeksAgo, PreviousWeek, CurrentWeek)
select * from tmpNCPCNC_DownstreamNodeUtilizationMaxPivot
--calculate average utilization for all values in each record
update tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
set average = (coalesce(twoweeksago, 0) + coalesce(previousweek, 0) + coalesce(currentweek, 0))/3
from tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
ScottIssue is with variable @columnz.
Scope of variables is only limited to the batch and if batch is over Variable is no more accessible.
Reproduce Steps:
DECLARE @columnz int = 0
Go --Scope of @columnz ends here
SELECT @columnz -- Ends up with error
So you have to remove GO keyword. I have commented 2 of them in below:
DROP TABLE tmpNCPCNCDownstreamMaxUtilization3wks
SELECT node
,max(utilization) AS max_Utilization
,DATE
INTO tmpNCPCNCDownstreamMaxUtilization3wks
FROM stage_ncpcncdownstream_temporal
WHERE DATE BETWEEN DATEADD(day, - 20, GETDATE())
AND GETDATE()
GROUP BY node
,DATE
ORDER BY node
GO
ALTER TABLE tmpNCPCNCDownstreamMaxUtilization3wks ADD TIMESTAMP VARCHAR(50)
GO
UPDATE tmpNCPCNCDownstreamMaxUtilization3wks
SET TIMESTAMP = 'WeekOf_' + cast(left(DATE, 11) AS VARCHAR)
GO
--drop table tmpNCPCNC_DownstreamNodeUtilizationMaxPivot
--go
DECLARE @columnz VARCHAR(8000)
--GO
SELECT @columnz = COALESCE(@columnz + ',[' + TIMESTAMP + ']', '[' + TIMESTAMP + ']')
FROM tmpNCPCNCDownstreamMaxUtilization3wks
GROUP BY TIMESTAMP
ORDER BY TIMESTAMP
--GO
--pivot contents in @columns
DECLARE @query VARCHAR(8000)
SET @query = 'select * into tmpNCPCNC_DownstreamNodeUtilizationMaxPivot from
(select node, timestamp, Max_Utilization from tmpNCPCNCDownstreamMaxUtilization3wks)a
pivot
sum(max_Utilization) for timestamp in(' + @columnz + ')
)as p'
EXECUTE (@query)
--empty contents from NCPCNCDownstreamMaxUtilization3wks
UPDATE tmpNCPCNCDownstreamMaxUtilization3wks
SET TIMESTAMP = ''
TRUNCATE TABLE tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
--load to table to be joined to Node feature class
INSERT INTO tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week (
Node
,TwoWeeksAgo
,PreviousWeek
,CurrentWeek
SELECT *
FROM tmpNCPCNC_DownstreamNodeUtilizationMaxPivot
--calculate average utilization for all values in each record
UPDATE tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
SET average = (coalesce(twoweeksago, 0) + coalesce(previousweek, 0) + coalesce(currentweek, 0)) / 3
FROM tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
-Vaibhav Chaudhari -
Execute SQl Task Error SSIS Package
Hi all,
I`m using for each loop container in my package to grab the file name from the source path. I have created 2 vairables
FilePath and SourceFolder
I`m using execute sql task inside the container and this is my query
Insert into [dbo].[DCA_FF_TEST] (File_Name,File_Date) SELECT File_name = ?,
File_Date = GetDate()
Please not the Table I am trying to insert has more columns but at this stage I dont need them.
When i execute the task I get an error
[Execute SQL Task] Error: Executing the query "
INSERT INTO [dbo].[DCA_FF_TEST] ([File_Name],[F..." failed with the following error: "The statement has been terminated.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters
not set correctly, or connection not established correctly.
Can someone point me in the right direction? Am I missing anything?
Resultset property Set to None
Parameter Mapping: Variablename: FilePath , Direction: Input, datatype : Varchar, Parametername: 0, ParameterSize: 100.
I`ve checked the connection as well it works.
FMDid you try
Insert into [dbo].[DCA_FF_TEST] (File_Name,File_Date)
SELECT ?, GetDate()
Or
Insert into [dbo].[DCA_FF_TEST] (File_Name,File_Date) VALUES (?, GetDate())
A Fan of SSIS, SSRS and SSAS
Maybe you are looking for
-
I only see my songs when i connect my ipod to my itunes
ok so i made the mistake of deleting my windows media player library with my ipod connected to the computer not thinking it would affect the existing songs stored in my ipod. i restored by computer settings. and when i hook up my ipod to my computer
-
Infopath submit button only works for the first row in a repeating table
Hi, I have a InfoPath Email submit button issue I could not figure out. I have a master/detail repeating table in my form, and one of fields is "EmailAddress" which shows customer's email address. I created a submit button and put the "EmailAddress"
-
Hi, we are using XI 3.0 and try to test services /sap/bc/bsp/sap/spi_monitor and getting some error messages, i am sure in sxmb_adm logging_sync parameter is set to 1, when I goto RWB and select "Component Monitoring" Adapter Engine is yellow I am se
-
Avoid Duplicate Tasks when Expanding Groups for Custom Task Process
Is there a way to: Avoid Duplicate Tasks when Expanding Groups for Custom Task Process? I've got a people metadata column that I am planning on putting groups into. I want the groups to expand and send a task for all users in the groups. I also wan
-
HTTP/1.1 connection problems
Hello We have a Sun ONE Application Server 7 installed in production environment. Certain past time, we observed that this server leave off accepting HTTP 1.1 requests although continues answering HTTP 1.0 requests. The load of the server is inferior