hello i need solution for to create a insert/select/delete/update stored procedure in mysql and how to call them from php currently i am using xampp 1.6.6 version of software thank you

Member Avatar
Member Avatar
+0 forum 4

I have two tables tbl_lang and tbl_unicode as described below: tbl_lang lang_id lang_name lang_code 1 Français fr 2 العربية ar 3 Deutsche ge tbl_unicode ent_id ent_name fr ar ge 1 lbl_username Nom d'utilisateur اسم المستخدم Benutzername 2 lbl_password mot de passe كلمه السر Passwort While displaying in the Datagridview, i am displaying the Language Names (lang_name from tbl_lang) and when i have to run update query on any translations in the datagridview, i want to dynamically get the column name (lang_code from tbl_lang) . Something close to this: update tbl_unicode set (select lang_code from tbl_lang where lang_name = 'Français') = …

Member Avatar
Member Avatar
+0 forum 1

Hy there! I have prestashop 1.4.4.1 and i want to export database clients in CSV through Mysql. I want all the fields possible. Is possible to export their passwords also?I mean MD5. Can you please help me? Best regards, Florea Uwe

Member Avatar
Member Avatar
+0 forum 10

Dear All May you kindly help me. I have a windows login form in VB.net. I have a users table in MySQL. How can i use the users table in to login changes made to any table in MySql database. I only have 1 mysql databse user that i use in my connection string from all my windows forms

Member Avatar
Member Avatar
+0 forum 3

Hi, I am new in pl/sql programming and I need your help. I would like to make a procedure. To be more specific, I have tables like the folowing TABLE1 ================================================ |COL1 | COL2 | COL3 | COL4 | COL5 | COL6 |COL7| =============================================== |600 | 140 | 2 | 10 | 1300 | 500 | 1 | ----------------------------------------------- |600 | 140 | 2 | 20 | 1400 | 340 | 4 | ----------------------------------------------- |600 | 140 | 2 | 15 | 1400 | 230 | 3 | ----------------------------------------------- |600 | 140 | 2 | 35 | 1700 | 120 …

Member Avatar
+0 forum 0

Hi. I am Sorry that I don't know how to ask question for my Scenario. Thats why I just used "How to update qty into table2 from table1? " This is the scenario of one of my customer Table-1 Subscription Master(News Paper) - Received Subscription CustCode Name Copies date Agent 0001 XXX 10 10.05.2015 AKL 0001 XXX 5 15.05.2015 AKL 0001 XXX 7 18.05.2015 AKL System has to instruct the Agent for delivery just like below So I insert data from Table-1 to table-2 Using below code INSERT INTO [dbo.Table-2] ( Custcode,Copies,Date,Agent) SELECT CustCode,Copies,Date,Agent FROM [dbo.table-1] Result is like below …

Member Avatar
Member Avatar
+0 forum 1

Hi I have a stored procedure with a cursor which check if a field is filled in after a certain deadline. DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `controleDeadlines`() BEGIN #declaratie variabelen die nodig zijn declare cId int; declare cDeadline text; declare cUitgevoerd date; declare cOpmerking text; declare cStatus text; declare DONE int default FALSE; declare tempdate date; #declaratie cursor declare cursorDeadlinesIndicatoren cursor for select id,deadline,status,opmerking,uitgevoerd from deadlines_indicatoren d join indicatoren i on d.ind_id = i.IND_Id where i.Type_Uitgevoerd="datum"; DECLARE CONTINUE HANDLER FOR NOT FOUND SET DONE = TRUE; #cursor starten OPEN cursorDeadlinesIndicatoren; read_loop: loop fetch cursorDeadlinesIndicatoren into cId,cDeadline,cStatus,cOpmerking,cUitgevoerd; IF DONE THEN leave …

Member Avatar
Member Avatar
+0 forum 2

Hi I do not know how to sum the one of the column in #table temp table It is my SP SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[usp_Customer_Due_Until_Now] @Code nvarchar(30) AS BEGIN SET NOCOUNT ON; select code as Code, Name as Name, sum(Nett) SINETT into #tableSI From SIHead Where Code=@code Group By Code,Name select code as Code, Name as Name, sum(-Nett) SINETT into #tableSR From SRHead Where Code=@code Group By Code,Name select code as Code, Name as Name, sum(-ChqAmount) SINETT into #tableRC From RCHead Where Code=@code Group By Code,Name select code as Code, Name as Name, …

Member Avatar
Member Avatar
+0 forum 2

I'm implement if else in stored procedure with and oprator . If both Conditions are true the if statement should return 1 else -1. here username and email should not be duplicate please review query below. alter proc spUserdetailss @name Nvarchar(50), @passwords Nvarchar(100), @emailadd Nvarchar(50), @Gender nvarchar(50) as begin declare @Ucount int declare @Ecount int declare @returncode int select @Ucount = count(Username), @Ecount= Count(Email) from userdata where Username=@nameUsername = @name and Email=@emailadd Email = @emailadd if @Ucount > 0 and @Ecount >0 Begin set @returncode =-1 end else begin set @returncode = 1 insert into userdata values(@name, @passwords, @emailadd, @Gender) …

Member Avatar
Member Avatar
+0 forum 5

Hi I have an issue in below stored procedure. below Store procedure is working fine. But fixed the Year. Any one know How can do the year dynamically select by user? SELECT * FROM ( SELECT salesEXE,SalesEXEName,name,gross,YearNo FROM vw_Pivot_Month_ALL) TableYearNo pivot (Sum(gross) for [yearno] in ([2008],[2009],[2010],[2011],[2012],[2013],[2014],[2015],[2016],[2017],[2018],[2019],[2020]) )pivotTable pls advice Maideen

Member Avatar
Member Avatar
+0 forum 5

I have this query as part of a stored procedure, and this query as it is listed here works: INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 8.0;Database=G:\KF\GBSData.xls;', 'SELECT * FROM [Sheet1$]') SELECT * FROM [KWF_GBSData].[dbo].[tblKWF_WorkTable2] WHERE invoiceNumber IN ( SELECT invoiceNumber FROM [KWF_GBSData].[dbo].[tblKWF_WorkTable2] WHERE stockNumberShipped LIKE 'CCCOMBO%' ) I would like to change the `'SELECT * FROM [Sheet1$]'` to something a little more dynamic so that I can use a parameter for the Excel worksheet name rather than it always using Sheet1$. I would also like to use a parameter for the `WHERE stockNumberShipped LIKE 'CCCOMBO%'` so that I can pass in the …

Member Avatar
Member Avatar
+0 forum 4

Hi I have database in structure like below Newspaper State1 state2 state3 state4 ABC 1000 5684 5687 246 DEF 879 2547 2578 2357 But I need to the structure like below How can i change this Newspaper State copies ABC State1 1000 ABC State2 5684 ABC State3 5687 ABC State4 246 DEF State1 879 DEF State2 2547 DEF State3 2578 DEF State4 2357 Pls help me Maideen

Member Avatar
Member Avatar
+0 forum 3

** Hello i am newbiw to MYSQL .... iwant to create stored procedure in PHPMYADMIN . But when i am same procedue od MS SQL in MYSQL it is giving error . #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@'companyna' nvarchar(150) begin select Company_Name from companynames where ' at line 2 this is my MS SQL Stored Procedure create proc spgetcompanynames @companyna nvarchar(150) as begin select Company_Name from companynames where Company_Name Like @companyna + '%' end this is my MYSQL …

Member Avatar
Member Avatar
+0 forum 1

Hi I did the stored procedure in mssql 2012. working fine in server. I have an issue that I need the output of my SP into HTML Report Format in aspx.page with Sub and Grand Total I no need GridView Pls advice Maideen My SP SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[Z_usp_Circ_Details_Member] AS BEGIN SET NOCOUNT ON; SELECT * FROM (SELECT MEMBER,[LANGUAGE],[TYPE],[PLATFORM],copies,CATEGORY,MAINAREA,YearNo FROM Z_tbl_Circulation_Details where mainarea='Peninsular Malaysia' and Language='English') TableYearNo pivot (Sum(copies) for [member] in ([The sun],[The Star]))pivotTable END Results English Newspaper Print Free Peninsular Malaysia 2012 603706 5210 English Newspaper Print Free Peninsular Malaysia 2013 …

Member Avatar
Member Avatar
+0 forum 2

Hi i have issue in stored procedure converting data type Destination table dbo.Z_tbl_CirculationCopy_TEMP has numeric data type But source table Z_tbl_Import_temp have VarChar Type If I export data from source, I have error message Msg 8114, Level 16, State 5, Procedure Z_usp_IMPORT_EXCEL_UNPIVOT_1, Line 10 Error converting data type varchar to numeric. Pls help to resolve this issue Thanking you in advance Maideen Below is my store procedure INSERT INTO dbo.Z_tbl_CirculationCopy_TEMP([MEMBER],[LANGUAGE],[TYPE],[PLATFORM],[CATEGORY],[MAINAREA],[STATE],[COPIES], [MONTHNAME],[YEARNO],[REMARKS],[AVGISSUE_PAID],[AVGISSUE_FREE],[BCP_NTT],[BCP_50],[BCP_20],[BCP_20_Below], [WP_TOTAL],[SABAH_TOTAL],[SARAWAK_TOTAL],[EM_Total]) SELECT [MEMBER],[LANGUAGE],[TYPE],[PLATFORM],[CATEGORY],[MAINAREA],[STATE],[COPIES], [MONTHNAME],[YEARNO],[REMARKS],[AVGISSUE_PAID],[AVGISSUE_FREE],[BCP_NTT],[BCP_50],[BCP_20],[BCP_20_Below], [WP_TOTAL],[SABAH_TOTAL],[SARAWAK_TOTAL],[EM_Total] FROM (SELECT [MEMBER],[LANGUAGE],[TYPE],[PLATFORM],[CATEGORY],[MAINAREA],[MONTHNAME],[YEARNO],[REMARKS], [AVGISSUE_PAID],[AVGISSUE_FREE],[BCP_NTT],[BCP_50],[BCP_20], [BCP_20_Below], [WP_TOTAL],[SABAH_Total],[SARAWAK_Total],[EM_Total], [Perlis],[Kedah],[Penang],[Perak],[Kelantan],[Terengganu],[Pahang],[Selangor],[WP],[NegriSembilan],[Melaka],[Johor], [KotaKinaBalu],[sandakan],[Tawau],[Kudat],[Pendalaman],[Labuan],[SABAH_Other], [Kuching],[Miri],[Sibu],[Bintulu],[SriAman],[KotaSemerahan],[Sarikei],[SARAWAK_Others],[Others] FROM dbo.Z_tbl_Import_temp ) P UNPIVOT (Copies FOR State IN ([Perlis],[Kedah],[Penang],[Perak],[Kelantan],[Terengganu],[Pahang],[Selangor], [WP],[NegriSembilan],[Melaka],[Johor], [KotaKinaBalu],[Sandakan],[Tawau],[Kudat],[Pendalaman],[Labuan],[SABAH_Other], [Kuching],[Miri],[Sibu],[Bintulu],[SriAman],[KotaSemerahan],[Sarikei],[SARAWAK_Others],[Others] ))AS unpvt …

Member Avatar
Member Avatar
+0 forum 1

0 down vote favorite I have a table: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, `score` int(11) NOT NULL, PRIMARY KEY (`id`) Now i want to create a stored procedure that will insert new column into this table with the next id (which is automaticly created), name (value which I will write), and score (which i will write). > Quoted Text Here I have tryed DELIMITER ;; CREATE PROCEDURE insertStudent (IN name varchar(100),IN score int(11)) BEGIN insert into student (name,score) values (newName,newScore); END ;; But it doesnt seem to work. I know this is …

Member Avatar
Member Avatar
+0 forum 4

Hi. problem in where insert data into table. Using vwd 2012 and Mssql 2012. Insert command is working fine in first record. If add another record, it shows "Procedure or Function has too many argument" I have tried may way, I could not solve. Pls help me. Below is my Store Procedure, Class file and aspx.vb files. Store Procedure GO /****** Object: StoredProcedure [dbo].[usp_CommonInfo_Insert] ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER Procedure [dbo].[usp_CommonInfo_Insert] @Code nvarchar(10) = NULL, @Name nvarchar(100) = NULL, @Type nvarchar(10) = NULL, @BAddress nvarchar(150) = NULL, @SAddress nvarchar(150) = NULL, @Tel1 nvarchar(20) = NULL, …

Member Avatar
Member Avatar
+0 forum 1

Good day, Just want to ask some help, Please! I always encounter "Cannot find Table 0" when i call Stored Procedure in DB2 using VB .Net with Ole DBConnection Provider. Here is my code: Private Sub cmdPost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPost.Click rsSearch = clsDAOMngr.getConfigParam(2) For i = 0 To rsSearch.Tables.Count Step 1 With rsSearch.Tables(0) MsgBox(.Rows(i)(0).ToString()) End With Next End Sub '------------------------------------------------------- Public Function getConfigParam(ByVal strParameter As String) As DataSet getConfigParam = Nothing Dim sProcedure As String = "" sProcedure = "EDMS.SAMPLE_SELECT2" getConfigParam = clsDBMngr.executeStoredProcedure_split(sProcedure, strParameter, 1) End Function '------------------------------------------------------- Public Function executeStoredProcedure_split(ByVal spname As String, …

Member Avatar
Member Avatar
+0 forum 1

I am trying to create stored procedure which will insert one row in the first table and identity of inserted row in other two tables. For some reason I am receiving error "Procedure or function expects parameter '@id', which was not supplied.". My code is as follows: ALTER PROCEDURE InsertProf ( @id int output, @added datetime2, @addedby nvarchar(50), @ime nvarchar(50), @prezime nvarchar(50), @fakultet int ) AS BEGIN SET NOCOUNT ON; declare @IdentityOutput table(ID int) INSERT INTO np_Profesori (Ime, Prezime) output inserted.IDProfesor into @IdentityOutput VALUES (@ime, @prezime) SET @id=(select ID from @IdentityOutput) INSERT INTO np_GdjeRadi (IDProfesor, IDFakultet) VALUES (@id, @fakultet) INSERT …

Member Avatar
Member Avatar
+0 forum 6

Error occured: Procedure .. has too many argument specified I have an issue that when i Update the record there is error "Error occured: Procedure .. has too many argument specified". It is my Store procedure SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER Procedure [dbo].[web_usp_empData_Update] @id bigint, @Code nvarchar(10), @Name nvarchar(50), @Address nvarchar(150), @Tel nvarchar(20), @HP nvarchar(20), @email nvarchar(50), @NRIC nvarchar(20), @Jobtitle nvarchar(50), @Dept nvarchar(20) As Begin Update empData Set [Code] = @Code, [Name] = @Name, [Address] = @Address, [Tel] = @Tel, [HP] = @HP, [email] = @email, [NRIC] = @NRIC, [Jobtitle] = @Jobtitle, [Dept] = @Dept Where …

Member Avatar
Member Avatar
+0 forum 4

Hi, is it possible to combine Stored Procedure and Text Command Type in Select Statement? I have a stored procedure that compute available items, it quite a bit long select statement, now i need to call this statement in another select statement which is in text command type, how will i do it? something like `Select Barcode, ItemCode, Get_itemCount From Product` where Get_itemCount is my storedProc Im using vb.net and Sql server 2008 R2 thanks in advance

Member Avatar
Member Avatar
+0 forum 14

This SP is working well. But when recordcount in dbo.PTSGELEN is over 1000000 approx. it comes timeout error. ALTER PROCEDURE [dbo].[PTS2Tabloya] @KOLETIK nvarchar(40), @SIL tinyint , @EKLENEN int OUT AS BEGIN SET NOCOUNT ON; set @EKLENEN = 0 IF @SIL=0 AND LEN(@KOLETIK)=20 begin INSERT INTO dbo.URUNGIR (GTIN,SN,XD,BN,CLABEL,SLABEL) SELECT GTIN,SN,XD,BN,CLABEL,SLABEL FROM dbo.PTSGELEN WHERE (CLABEL = @KOLETIK OR SLABEL = @KOLETIK); set @EKLENEN = @@Rowcount ; END; IF @SIL=1 AND LEN(@KOLETIK)=20 BEGIN DELETE FROM dbo.URUNGIR WHERE (CLABEL = @KOLETIK OR SLABEL = @KOLETIK) ; set @EKLENEN = @@Rowcount ; END; END

Member Avatar
Member Avatar
+0 forum 1

Dear friends, I am using Wordpress 3.6 . I need to integrate an alert system(to send email notification) to users when a preference value (Reach price of onion 40 $/kg). Is stored procedure can do any thing with it? Please advise how it is feasible. Thanks, Anes

Member Avatar
Member Avatar
+0 forum 1

I faced to a huge problem when i coding some stored procedure. How to combine some string to sql string in stored procedure??? This is what i did upto now. @WhereCondition = ' WHERE id = 102 ' DECLARE recoredSet CURSOR FOR SELECT SUM(Amount) as AmountSum FROM sale + @WhereCondition OPEN recoredSet --After above code I wrote fetch commands and it has no any problem. In above code, @WhereCondition is assinged some value. Eg: @WhereCondition = ' WHERE id = 5 ' But the problem is plus mark (+) is not supported. If Plus mark is not there, the code …

Member Avatar
Member Avatar
+0 forum 5

I currently have $tableName="thenameofthetable"; $someid=$_GET["someidthruget"]; $result = mysql_query("SELECT name,age FROM ". $tableName. " WHERE idp=". $someid); Which looks really insecure. How can I do it using a stored procedure which I think will make it a lot more secure? Thanks

Member Avatar
Member Avatar
+0 forum 5

I have tested out my procedure on my home machine. It woks pretty well I know there is output from the sql. Now I want to try it out on the host. It gives no output. Here is my php code $bob="call seeker($profound)"; if (mysqli_multi_query($conn,$bob)) { echo "<hr>"; echo "<table><th>Section</th><th>Author</th><th>Title</th>"; do { if ($mysqli=more_results($conn)) { $thepot=$row['scribe']; $ego=$row['id']; $volume=$row['title']; $subject=$row['subject']; $catinfo=<<<MEOW <tr> <td>$subject</td> <td>$thepot</td> <td><a href ="card.php?id=$ego">$volume</a></td> </tr> MEOW; echo $catinfo; $result->free(); } }//if result // }//do whle while ($row=$result->fetch_row); } //if statement if query else {echo "whiskey tango foxtrot";} echo"</table>"; I would appreciate any assistance I can get here.

Member Avatar
Member Avatar
+0 forum 3

Hi all I'm trying to write a Procedure to subtract days from a data but Ignoring weekends. This is what I have so far but I have a Syntax error Unexpected END, Expecting `;` I have put a ; after the last END but still get the same error. DELIMITER $$ CREATE PROCEDURE `production`.`new_procedure` (in fDate Date, fVal int) BEGIN Declare x int default 1; Declare NewDate Date; WHILE x <= fVal DO set NewDate=Date_SUB(fDate,interval x Day); SELECT CASE DAYNAME(NewDate) WHEN `Saturday` THEN fVal=fVal+1 WHEN `Sunday` THEN fVal=fVal+1 Else x=x+1 END End END$$

Member Avatar
Member Avatar
+0 forum 4

I would like to know about the following code, could anyone tell me, please? .text:004027A0 sub_4027A0 proc near ; CODE XREF: sub_401010+118-p .text:004027A0 .text:004027A0 var_404 = byte ptr -404h .text:004027A0 .text:004027A0 sub esp, 404h .text:004027A6 lea eax, [esp+404h+var_404] .text:004027A9 push 1 .text:004027AB push eax .text:004027AC call sub_401CC0 .text:004027B1 add esp, 8 .text:004027B4 test ax, ax .text:004027B7 jz short loc_4027C2 .text:004027B9 xor al, al .text:004027BB add esp, 404h .text:004027C1 retn .text:004027C2 ; --------------------------------------------------------------------------- .text:004027C2 .text:004027C2 loc_4027C2: ; CODE XREF: sub_4027A0+17-j .text:004027C2 push ebx .text:004027C3 push 3 .text:004027C5 push 0FA31h .text:004027CA push 8 .text:004027CC push 1298h .text:004027D1 push 0C6E0h .text:004027D6 push 5DEFh …

Member Avatar
Member Avatar
+0 forum 6

I don't quite understand how to make a Procedure as most of my processing takes place in my scripts. I have a set of 3 Queries that are almost identical that I would like to combine them to return a result set. The queries are: SELECT Date, Location, Sum(SubTotal) FROM data WHERE (Date between 20121211 AND 20121231) and Account_Number like '%cash%' group by Location, Date order by Date; SELECT Date, Location, Sum(SubTotal) FROM data WHERE (Date between 20121211 AND 20121231) AND Account_Number not like '%cash%' group by Location, Date order by Date; SELECT Date, Location, Sum(SubTotal) FROM data WHERE (Date …

Member Avatar
Member Avatar
+0 forum 2

Hi. So, just switched to RAD XE3 to use Metropolis UI feature, and therefore started to completely rearrange and redesign my app to make it a little nicer, only this time I've chosen FireMonkey Metropolis App, since it has some good components, such as TSwitch (slide switch). Everything seems to work fine (with modifications and spending lot of time...), but can't find a way to call Switch procedure via VK buttons. The VK procedure is able to show toolbar, and to show message with ShowMessage('Hello'); as well, but I can't call switch procedure. The TSwitch has the OnSwitch event (It's …

Member Avatar
Member Avatar
+0 forum 1

The End.