Error and notice in Phpmyadmin database. How to fix it? - wordpress

It shows:
Warning in ./libraries/sql.lib.php#613
count(): Parameter must be an array or an object that implements Countable
Backtrace
./libraries/sql.lib.php#2128: PMA_isRememberSortingOrder(array)
./libraries/sql.lib.php#2062: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'wp_wordpress',
string 'wp_3_options',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `wp_3_options`',
NULL,
NULL,
)
./sql.php#221: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'wp_wordpress',
string 'wp_3_options',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `wp_3_options`',
NULL,
NULL,
)
And also:
Notice in ./libraries/DisplayResults.php#1229
Trying to access array offset on value of type bool
Backtrace
./libraries/DisplayResults.php#1349: PMA\libraries\DisplayResults->_getTableHeadersForColumns(
array,
array,
array,
array,
array,
boolean false,
string 'SELECT * FROM `wp_3_options` ',
)
./libraries/DisplayResults.php#4427: PMA\libraries\DisplayResults->_getTableHeaders(
array,
array,
string 'SELECT * FROM `wp_3_options` ',
array,
array,
array,
boolean false,
)
./libraries/sql.lib.php#1686: PMA\libraries\DisplayResults->getTable(
,
array,
array,
boolean false,
)
./libraries/sql.lib.php#1980: PMA_getHtmlForSqlQueryResultsTable(
,
string './themes/pmahomme/img/',
NULL,
array,
boolean true,
string '794',
integer 25,
NULL,
,
array,
)
./libraries/sql.lib.php#2199: PMA_getQueryResponseForResultsReturned(
,
array,
string 'wp_wordpress',
string 'wp_3_options',
NULL,
NULL,
,
string './themes/pmahomme/img/',
string '794',
integer 25,
NULL,
NULL,
NULL,
NULL,
NULL,
string 'SELECT * FROM `wp_3_options`',
NULL,
)
./libraries/sql.lib.php#2062: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'wp_wordpress',
string 'wp_3_options',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `wp_3_options`',
NULL,
NULL,
)
./sql.php#221: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'wp_wordpress',
string 'wp_3_options',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `wp_3_options`',
NULL,
NULL,
)
What this error and Notice mean and how to fix them? How do they affect my site?

Related

Ansible: create a dictionary from a register.results var

i have the result variable ( see at the bottom ) from a task (modul community.general.proxmox_kvm) and i want create a new dictionary variable from the items that changed in the result variable.
The structure should look like this
vm_dict:
80001:
host_name: ansible-clone1
host_ip_address: 10.10.0.1
80002:
host_name: ansible-clone2
host_ip_address: 10.10.0.2
What is a good way to accomplish this ? I tryed it with set_fact and combine filter but i get stucked and was not able to put multible values. Also the changed status not worked as expected.
- name: Populate dict
set_fact:
_dict: "{{ _dict|default({}) | combine( {item.item.key: item.item.value.host_name} ) }}"
loop: "{{ provisioning_vm.results }}"
when: provisioning_vm.changed == true
I will be happy for some suggestions.
Here is the result variable ( type list )
TASK [provisioning_proxmox : print var provisioning_vm] *************************************************************
ok: [localhost] => {
"provisioning_vm": {
"changed": false,
"msg": "All items completed",
"results": [
{
"ansible_loop_var": "item",
"changed": false,
"failed": false,
"invocation": {
"module_args": {
"acpi": null,
"agent": null,
"api_host": "10.0.10.1:8006",
"api_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"api_token_id": null,
"api_token_secret": null,
"api_user": "ansible_admin#pve",
"args": null,
"autostart": null,
"balloon": null,
"bios": null,
"boot": null,
"bootdisk": null,
"cicustom": null,
"cipassword": null,
"citype": null,
"ciuser": null,
"clone": "arbitrary_template",
"cores": null,
"cpu": null,
"cpulimit": null,
"cpuunits": null,
"delete": null,
"description": null,
"digest": null,
"efidisk0": null,
"force": null,
"format": "raw",
"freeze": null,
"full": true,
"hostpci": null,
"hotplug": null,
"hugepages": null,
"ide": null,
"ipconfig": null,
"keyboard": null,
"kvm": null,
"localtime": null,
"lock": null,
"machine": null,
"memory": null,
"migrate_downtime": null,
"migrate_speed": null,
"name": "ansible-clone1.dev.test.com",
"nameservers": null,
"net": null,
"newid": 80001,
"node": "proxmox01",
"numa": null,
"numa_enabled": null,
"onboot": null,
"ostype": null,
"parallel": null,
"pool": null,
"protection": null,
"proxmox_default_behavior": "no_defaults",
"reboot": null,
"revert": null,
"sata": null,
"scsi": null,
"scsihw": null,
"searchdomains": null,
"serial": null,
"shares": null,
"skiplock": null,
"smbios": null,
"snapname": null,
"sockets": null,
"sshkeys": null,
"startdate": null,
"startup": null,
"state": "present",
"storage": "CEPH-DEV",
"tablet": null,
"tags": null,
"target": null,
"tdf": null,
"template": null,
"timeout": 400,
"update": false,
"validate_certs": false,
"vcpus": null,
"vga": null,
"virtio": null,
"vmid": 987654,
"watchdog": null
}
},
"item": {
"key": 80001,
"value": {
"host_ip_address": "10.10.0.1",
"host_name": "ansible-clone1.dev.test.com"
}
},
"msg": "VM with name <ansible-clone1.dev.test.com> already exists",
"vmid": 80001
},
{
"ansible_loop_var": "item",
"changed": false,
"failed": false,
"invocation": {
"module_args": {
"acpi": null,
"agent": null,
"api_host": "10.0.10.1:8006",
"api_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"api_token_id": null,
"api_token_secret": null,
"api_user": "ansible_admin#pve",
"args": null,
"autostart": null,
"balloon": null,
"bios": null,
"boot": null,
"bootdisk": null,
"cicustom": null,
"cipassword": null,
"citype": null,
"ciuser": null,
"clone": "arbitrary_template",
"cores": null,
"cpu": null,
"cpulimit": null,
"cpuunits": null,
"delete": null,
"description": null,
"digest": null,
"efidisk0": null,
"force": null,
"format": "raw",
"freeze": null,
"full": true,
"hostpci": null,
"hotplug": null,
"hugepages": null,
"ide": null,
"ipconfig": null,
"keyboard": null,
"kvm": null,
"localtime": null,
"lock": null,
"machine": null,
"memory": null,
"migrate_downtime": null,
"migrate_speed": null,
"name": "ansible-clone2.dev.test.com",
"nameservers": null,
"net": null,
"newid": 80002,
"node": "proxmox01",
"numa": null,
"numa_enabled": null,
"onboot": null,
"ostype": null,
"parallel": null,
"pool": null,
"protection": null,
"proxmox_default_behavior": "no_defaults",
"reboot": null,
"revert": null,
"sata": null,
"scsi": null,
"scsihw": null,
"searchdomains": null,
"serial": null,
"shares": null,
"skiplock": null,
"smbios": null,
"snapname": null,
"sockets": null,
"sshkeys": null,
"startdate": null,
"startup": null,
"state": "present",
"storage": "CEPH-DEV",
"tablet": null,
"tags": null,
"target": null,
"tdf": null,
"template": null,
"timeout": 400,
"update": false,
"validate_certs": false,
"vcpus": null,
"vga": null,
"virtio": null,
"vmid": 987654,
"watchdog": null
}
},
"item": {
"key": 80002,
"value": {
"host_ip_address": "10.10.0.2",
"host_name": "ansible-clone2.dev.test.com"
}
},
"msg": "VM with name <ansible-clone2.dev.test.com> already exists",
"vmid": 80002
},
{
"ansible_loop_var": "item",
"changed": false,
"failed": false,
"invocation": {
"module_args": {
"acpi": null,
"agent": null,
"api_host": "10.0.10.1:8006",
"api_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"api_token_id": null,
"api_token_secret": null,
"api_user": "ansible_admin#pve",
"args": null,
"autostart": null,
"balloon": null,
"bios": null,
"boot": null,
"bootdisk": null,
"cicustom": null,
"cipassword": null,
"citype": null,
"ciuser": null,
"clone": "arbitrary_template",
"cores": null,
"cpu": null,
"cpulimit": null,
"cpuunits": null,
"delete": null,
"description": null,
"digest": null,
"efidisk0": null,
"force": null,
"format": "raw",
"freeze": null,
"full": true,
"hostpci": null,
"hotplug": null,
"hugepages": null,
"ide": null,
"ipconfig": null,
"keyboard": null,
"kvm": null,
"localtime": null,
"lock": null,
"machine": null,
"memory": null,
"migrate_downtime": null,
"migrate_speed": null,
"name": "ansible-clone4.dev.test.com",
"nameservers": null,
"net": null,
"newid": 80004,
"node": "proxmox01",
"numa": null,
"numa_enabled": null,
"onboot": null,
"ostype": null,
"parallel": null,
"pool": null,
"protection": null,
"proxmox_default_behavior": "no_defaults",
"reboot": null,
"revert": null,
"sata": null,
"scsi": null,
"scsihw": null,
"searchdomains": null,
"serial": null,
"shares": null,
"skiplock": null,
"smbios": null,
"snapname": null,
"sockets": null,
"sshkeys": null,
"startdate": null,
"startup": null,
"state": "present",
"storage": "CEPH-DEV",
"tablet": null,
"tags": null,
"target": null,
"tdf": null,
"template": null,
"timeout": 400,
"update": false,
"validate_certs": false,
"vcpus": null,
"vga": null,
"virtio": null,
"vmid": 987654,
"watchdog": null
}
},
"item": {
"key": 80004,
"value": {
"host_ip_address": "10.10.10.4",
"host_name": "ansible-clone4.dev.test.com"
}
},
"msg": "VM with name <ansible-clone4.dev.test.com> already exists",
"vmid": 80004
}
],
"skipped": false
}
}
For example,
vm_dict: "{{ dict(provisioning_vm.results|
json_query('[].[item.key, item.value]')) }}"
gives
vm_dict:
80001:
host_ip_address: 10.10.0.1
host_name: ansible-clone1.dev.test.com
80002:
host_ip_address: 10.10.0.2
host_name: ansible-clone2.dev.test.com
80004:
host_ip_address: 10.10.10.4
host_name: ansible-clone4.dev.test.com
Optionally, the task below rejects changed items. Change the filter to selectattr if you want to select them
vm_dict: "{{ dict(provisioning_vm.results|
rejectattr('changed')|
json_query('[].[item.key, item.value]')) }}"

nswag.json to flattenInheritanceHierarchy is not working dotnet 6

I'm trying to generate flate type script class using nswag
I belive there's a proprty 'flattenInheritanceHierarchy' that can do what i need. but seems like its not working. not sure what i'm missing.
I have a c# class called Result which is inheriting from Result
public partial record Result
{
public bool IsSucceeded { get; set; }
public string Message { get; set; } = string.Empty;
}
public partial record Result<T> : Result where T : new()
{
public T Value { get; set; } = new T();
}
i'm using it to retunr the result like this
public async Task<IActionResult> Create(CarDto dto)
{
return Ok(new Result<CarDto>());
}
when i generate typescript classes, actual result is
export class Result {
isSucceeded!: boolean;
message!: string;
}
export class ResultOfCarDto extends Result {
value!: CarDto;
}
but i want it like
export class ResultOfCarDto {
isSucceeded!: boolean;
message!: string;
value!: CarDto;
}
here's my nswag.json
{
"runtime": "Net60",
"defaultVariables": null,
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": "Web.csproj",
"msBuildProjectExtensionsPath": null,
"configuration": null,
"runtime": null,
"targetFramework": null,
"noBuild": true,
"verbose": false,
"workingDirectory": null,
"requireParametersWithoutDefault": true,
"apiGroupNames": null,
"defaultPropertyNameHandling": "CamelCase",
"defaultReferenceTypeNullHandling": "Null",
"defaultDictionaryValueReferenceTypeNullHandling": "NotNull",
"defaultResponseReferenceTypeNullHandling": "NotNull",
"defaultEnumHandling": "Integer",
"flattenInheritanceHierarchy": true,
"generateKnownTypes": true,
"generateEnumMappingDescription": true,
"generateXmlObjects": false,
"generateAbstractProperties": false,
"generateAbstractSchemas": true,
"ignoreObsoleteProperties": true,
"allowReferencesWithProperties": false,
"excludedTypeNames": [],
"serviceHost": null,
"serviceBasePath": null,
"serviceSchemes": [],
"infoTitle": "API",
"infoDescription": null,
"infoVersion": "1.0.0",
"documentTemplate": null,
"documentProcessorTypes": [],
"operationProcessorTypes": [],
"typeNameGeneratorType": null,
"schemaNameGeneratorType": null,
"contractResolverType": null,
"serializerSettingsType": null,
"useDocumentProvider": true,
"documentName": "v1",
"aspNetCoreEnvironment": null,
"createWebHostBuilderMethod": null,
"startupType": null,
"allowNullableBodyParameters": false,
"output": "wwwroot/api/specification.json",
"outputType": "OpenApi3",
"assemblyPaths": [],
"assemblyConfig": null,
"referencePaths": [],
"useNuGetCache": false
}
},
"codeGenerators": {
"openApiToTypeScriptClient": {
"className": "{controller}Client",
"moduleName": "",
"namespace": "",
"typeScriptVersion": 4.3,
"template": "Angular",
"promiseType": "Promise",
"httpClass": "HttpClient",
"withCredentials": false,
"useSingletonProvider": true,
"injectionTokenType": "InjectionToken",
"rxJsVersion": 6.0,
"dateTimeType": "Date",
"nullValue": "Undefined",
"generateClientClasses": false,
"generateClientInterfaces": false,
"generateOptionalParameters": false,
"exportTypes": true,
"wrapDtoExceptions": false,
"exceptionClass": "SwaggerException",
"clientBaseClass": null,
"wrapResponses": false,
"wrapResponseMethods": [],
"generateResponseClasses": true,
"responseClass": "SwaggerResponse",
"protectedMethods": [],
"configurationClass": null,
"useTransformOptionsMethod": false,
"useTransformResultMethod": false,
"flattenInheritanceHierarchy": false,
"generateDtoTypes": true,
"operationGenerationMode": "MultipleClientsFromOperationId",
"markOptionalProperties": false,
"generateCloneMethod": false,
"typeStyle": "Class",
"enumStyle": "Enum",
"useLeafType": true,
"classTypes": [],
"extendedClasses": [],
"extensionCode": null,
"generateDefaultValues": true,
"generateAbstractProperties": false,
"generateAbstractSchemas": false,
"ignoreObsoleteProperties": true,
"excludedTypeNames": [],
"excludedParameterNames": [],
"includeHttpContext": false,
"handleReferences": false,
"generateTypeCheckFunctions": false,
"generateConstructorInterface": false,
"convertConstructorInterfaceData": false,
"importRequiredTypes": true,
"useGetBaseUrlMethod": false,
"baseUrlTokenName": "API_BASE_URL",
"queryNullValue": "",
"inlineNamedDictionaries": false,
"inlineNamedAny": false,
"templateDirectory": null,
"typeNameGeneratorType": null,
"propertyNameGeneratorType": null,
"enumNameGeneratorType": null,
"serviceHost": null,
"serviceSchemes": null,
"output": "ClientApp/src/app/dto/api-dtos.ts"
}
}
}
addtionally its generating 3 fromJS, init and toJSON functions which i also dont want
export class StatusCountDto {
count!: number;
status!: string;
#region I dont want to generate this
init(_data?: any) {
if (_data) {
this.count = _data["count"];
this.status = _data["status"];
}
}
static fromJS(data: any): IssueCountDto {
data = typeof data === 'object' ? data : {};
let result = new IssueCountDto();
result.init(data);
return result;
}
toJSON(data?: any) {
data = typeof data === 'object' ? data : {};
data["count"] = this.count;
data["status"] = this.status;
return data;
}
#endregion I dont want to generate this
}
any suggesstion?

Invalid column name in Entity Framework

I have an ASP.MET application. I performed the tutorial on code first migrations. When I executed the commands, the following code was generated for the user table:
CreateTable(
"dbo.AspNetUsers",
c => new
{
Id = c.String(nullable: false, maxLength: 128),
ApplicationId = c.Guid(nullable: false),
Email = c.String(maxLength: 256),
EmailConfirmed = c.Boolean(nullable: false),
PasswordHash = c.String(),
SecurityStamp = c.String(),
PhoneNumber = c.String(),
PhoneNumberConfirmed = c.Boolean(nullable: false),
TwoFactorEnabled = c.Boolean(nullable: false),
LockoutEndDateUtc = c.DateTime(),
LockoutEnabled = c.Boolean(nullable: false),
AccessFailedCount = c.Int(nullable: true),
UserName = c.String(nullable: false, maxLength: 256),
Discriminator = c.String(),
LegacyPasswordHash = c.String(),
})
.PrimaryKey(t => t.Id)
.Index(t => t.UserName, unique: true, name: "UserNameIndex");
My problem is that I don't need some columns. So, I removed the code from those columns and updated my DB. But, when I try to authenticate a user, I get this error:
Invalid column name 'EmailConfirmed'.
Invalid column name 'PhoneNumberConfirmed'.
Invalid column name 'TwoFactorEnabled'.
Invalid column name 'LockoutEndDateUtc'.
Invalid column name 'LockoutEnabled'.
Invalid column name 'AccessFailedCount'.
But these columns no longer exist because I deleted them.
Or, is it possible to put it back and assign them default values ​​for example:
EmailConfirmed = false
PhoneNumberConfirmed = false
to avoid making an insertion when creating a user. I use EF 6.2.0
Need help please.

Storing user objects in Session

I have a User entity. One user can buy a product. After the form validation I want to store the user data (ID, name, mail, password, address, ..) in $session, and only after the success payment retrieve this data from session and store it to the db.
This is what I'm doing: (if the from is valid)
$session = new Session();
$serialized_user = serialize($user);
$session->set('myuser', ($serialized_user));
Then, after the payment check:
$test = ($this->get('session')->get('myuser'));
$test_unserialized = unserialize($test);
$em = $this->getDoctrine()->getManager();
$em->persist($test_unserialized);
$em->flush();
return $this->render('UserBundle:Account:buyedOk.php');
What I got is this error:
An exception occurred while executing 'INSERT INTO user (user, passw, email, is_active, is_locked, date_expire, date_registration, last_visit, name, surname, address, zipcode, city, province, country, vat, tel, fax, contact_name, contact_role, contact_email, contact_tel, email_hex, email_confirmed, validated,id_currency) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["March", "$2y$13$hTBP0ANwRlwgcfX19OtsTubn6ctI64lz5GVQ3JF3nZtD0GDPK8rTC", null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'email' cannot be null
Suggestions?

My Update Stored Procedure not working some times and not showing error SQL Server 2008 R2 queries attached?

I am trying to update my project that is already ex sis in table. Stored procedure is working fine in some projects but not updating in some project even it is not giving any error I can't find out error I am pasting my queries down there please check it out if there is any issue.
Table creation query:
CREATE TABLE [dbo].[Des_InventoryN]
(
[ID] [int] IDENTITY(1,1) NOT NULL,
[Target_Project_ID] [int] NULL,
[Projects] [nvarchar](255) NULL,
[Bridge_Cost] [money] NULL,
[Hway_Cost] [money] NULL,
[Bridge_Comp] [nvarchar](50) NULL,
[Hway_Comp] [nvarchar](50) NULL,
[Proj_WCB] [nvarchar](50) NULL,
[Proj_Owner] [nvarchar](50) NULL,
[Ind_Exp] [bit] NOT NULL,
[Sub] [bit] NOT NULL,
[Sub_Prime_Factor] [nvarchar](50) NULL,
[M1] [bit] NOT NULL,
[M2] [bit] NOT NULL,
[M3] [bit] NOT NULL,
[M4] [bit] NOT NULL,
[M5] [bit] NOT NULL,
[M6] [bit] NOT NULL,
[M7] [bit] NOT NULL,
[M8] [bit] NOT NULL,
[M9] [bit] NOT NULL,
[M10] [bit] NOT NULL,
[E1] [bit] NOT NULL,
[E2] [bit] NOT NULL,
[E3] [bit] NOT NULL,
[E4] [bit] NOT NULL,
[E5] [bit] NOT NULL,
[E6] [bit] NOT NULL,
[E7] [bit] NOT NULL,
[E8] [bit] NOT NULL,
[E9] [bit] NOT NULL,
[E10] [bit] NOT NULL,
[E11] [bit] NOT NULL,
[E12] [bit] NOT NULL,
[E13] [bit] NOT NULL,
[E14] [bit] NOT NULL,
[E15] [bit] NOT NULL,
[E16] [bit] NOT NULL,
[E17] [bit] NOT NULL,
[E18] [bit] NOT NULL,
[E19] [bit] NOT NULL,
[E20] [bit] NOT NULL,
[E21] [bit] NOT NULL,
[E22] [bit] NOT NULL,
[E23] [bit] NOT NULL,
[E24] [bit] NOT NULL,
[E25] [bit] NOT NULL,
[E26] [bit] NOT NULL,
[O1] [bit] NOT NULL,
[O2] [bit] NOT NULL,
[O3] [bit] NOT NULL,
[O4] [bit] NOT NULL,
[O5] [bit] NOT NULL,
[O6] [bit] NOT NULL,
[O7] [bit] NOT NULL,
[O8] [bit] NOT NULL,
[O9] [bit] NOT NULL,
[O10] [bit] NOT NULL,
[O11] [bit] NOT NULL,
[O12] [bit] NOT NULL,
[O13] [bit] NOT NULL,
[O14] [bit] NOT NULL,
[upsize_ts] [timestamp] NULL,
[Creation] [datetime] NULL,
[UpdateTime] [datetime] NULL,
[Dnumber] [nvarchar](20) NULL,
[EIS_Chap_IV] [bit] NULL,
[EA_Chap_IV] [bit] NULL,
[Proj_Flag] [bit] NULL,
[Proj_Type] [nvarchar](50) NULL,
[Cus_ID] [int] NULL,
[SubPer] [nvarchar](50) NULL,
CONSTRAINT [PK_Des_InventoryN] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
Stored procedure for table:
CREATE PROCEDURE [dbo].[UpdateProject]
#Target_Project_ID int,
#Projects varchar(50),
#Bridge_Cost money,
#Hway_Cost money,
#Bridge_Comp nvarchar(50),
#Hway_Comp nvarchar(50),
#ProjectType nvarchar(50),
#Proj_Owner nvarchar(50),
#Proj_WCB nvarchar(50),
#Ind_Exp bit,
#Sub bit,
#M1 bit,
#M2 bit,
#M3 bit,
#M4 bit,
#M5 bit,
#M6 bit,
#M7 bit,
#M8 bit,
#M9 bit,
#M10 bit,
#E1 bit,
#E2 bit,
#E3 bit,
#E4 bit,
#E5 bit,
#E6 bit,
#E7 bit,
#E8 bit,
#E9 bit,
#E10 bit,
#E11 bit,
#E12 bit,
#E13 bit,
#E14 bit,
#E15 bit,
#E16 bit,
#E17 bit,
#E18 bit,
#E19 bit,
#E20 bit,
#E21 bit,
#E22 bit,
#E23 bit,
#E24 bit,
#E25 bit,
#E26 bit,
#O1 bit,
#O2 bit,
#O3 bit,
#O4 bit,
#O5 bit,
#O6 bit,
#O7 bit,
#O8 bit,
#O9 bit,
#O10 bit,
#O11 bit,
#O12 bit,
#O13 bit,
#O14 bit,
#Creation datetime,
#Dnumber nvarchar(30),
#SubPer nvarchar(30),
#Sub_Prime_Factor nvarchar(30)
AS
BEGIN
SET NOCOUNT ON;
UPDATE [InspectionDesign].[dbo].[Des_InventoryN]
SET
[Projects] = #Projects
,[Bridge_Cost] = #Bridge_Cost
,[Hway_Cost] = #Hway_Cost
,[Bridge_Comp] = #Bridge_Comp
,[Hway_Comp] = #Hway_Comp
,[Proj_WCB] = #Proj_WCB
,[Proj_Owner] = #Proj_Owner
,[Ind_Exp] = #Ind_Exp
,[Sub] = #Sub
,[M1] = #M1
,[M2] = #M2
,[M3] = #M3
,[M4] = #M4
,[M5] = #M5
,[M6] = #M6
,[M7] = #M7
,[M8] = #M8
,[M9] = #M9
,[M10] = #M10
,[E1] = #E1
,[E2] = #E2
,[E3] = #E3
,[E4] = #E4
,[E5] = #E5
,[E6] = #E6
,[E7] = #E7
,[E8] = #E8
,[E9] = #E9
,[E10] = #E10
,[E11] = #E11
,[E12] = #E12
,[E13] = #E13
,[E14] = #E14
,[E15] = #E15
,[E16] = #E16
,[E17] = #E17
,[E18] = #E18
,[E19] = #E19
,[E20] = #E20
,[E21] = #E21
,[E22] = #E22
,[E23] = #E23
,[E24] = #E24
,[E25] = #E25
,[E26] = #E26
,[O1] = #O1
,[O2] = #O2
,[O3] = #O3
,[O4] = #O4
,[O5] = #O5
,[O6] = #O6
,[O7] = #O7
,[O8] = #O8
,[O9] = #O9
,[O10] = #O10
,[O11] = #O11
,[O12] = #O12
,[O13] = #O13
,[O14] = #O14,
[UpdateTime] = #Creation,
[Dnumber] = #Dnumber,
[Proj_Type] = #ProjectType,
[SubPer] = #SubPer,
[Sub_Prime_Factor] = #Sub_Prime_Factor
WHERE
[ID] = #Target_Project_ID AND [Projects] = #Projects;
END
Query for passing parameters in stored procedure that is running fine but not updating project even not giving any error and displaying 1 row effected
I am just updating M1 value from 0 to 1 in this query while the rest of data is same so you have to insert data in table before updating same as mentioned in this query just M1 value 1 to 0
USE [InspectionDesign]
GO
DECLARE #return_value int
EXEC #return_value = [dbo].[UpdateProject]
#Target_Project_ID = 63,
#Projects = N'E. Third St 52nd St/LIRR & 19th St/NYCT Design & CSS',
#Bridge_Cost = 5101000.0,
#Hway_Cost = 953000.0,
#Bridge_Comp = N'2',
#Hway_Comp = N'1',
#ProjectType = N'1',
#Proj_Owner = N'4',
#Proj_WCB = N'3',
#Ind_Exp = false,
#Sub = false,
#M1 = 1,
#M2 = 0,
#M3 = 1,
#M4 = 1,
#M5 = 1,
#M6 = 1,
#M7 = 1,
#M8 = 1,
#M9 = 1,
#M10 = 1,
#E1 = 0,
#E2 = 0,
#E3 = 0,
#E4 = 0,
#E5 = 0,
#E6 = 0,
#E7 = 0,
#E8 = 0,
#E9 = 0,
#E10 = 0,
#E11 = 0,
#E12 = 0,
#E13 = 0,
#E14 = 0,
#E15 = 0,
#E16 = 0,
#E17 = 0,
#E18 = 0,
#E19 = 0,
#E20 = 0,
#E21 = 0,
#E22 = 0,
#E23 = 0,
#E24 = 0,
#E25 = 0,
#E26 = 0,
#O1 = 0,
#O2 = 0,
#O3 = 0,
#O4 = 0,
#O5 = 0,
#O6 = 0,
#O7 = 0,
#O8 = 0,
#O9 = 1,
#O10 = 0,
#O11 = 0,
#O12 = 1,
#O13 = 0,
#O14 = 0,
#Creation = N'4/1/2014 9:46:02 AM',
#Dnumber = N'D031095',
#SubPer = NULL,
#Sub_Prime_Factor = N'1'
SELECT 'Return Value' = #return_value
GO
Hopes for your suggestion thanks in advance.
In your Stored Procedure there is a where condition
where [ID] =#Target_Project_ID and [Projects]=#Projects;
you may update this as
where [Target_Project_ID] =#Target_Project_ID and [Projects]=#Projects;

Resources