<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — sqlexecute]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=2664</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=2664&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in sqlexecute.]]></description>
		<lastBuildDate>Wed, 09 May 2018 00:43:43 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: sqlexecute]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=25060#p25060</link>
			<description><![CDATA[<p>nevermind...<br />SqlExecute(&#039;SELECT id FROM cliente WHERE contacto1 LIKE &quot;%stoopidme%&quot;&#039;)</p>]]></description>
			<author><![CDATA[null@example.com (VascoMorais)]]></author>
			<pubDate>Wed, 09 May 2018 00:43:43 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=25060#p25060</guid>
		</item>
		<item>
			<title><![CDATA[Re: sqlexecute]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=25059#p25059</link>
			<description><![CDATA[<p>hey Mathmathou you are allways a life saver, i&#039;m trying to use the &quot;like&quot; function in sql to replace some tables and search buttons hidden in my program, that way i can use this simple line instead of hitting an invisible button to search for an item in a table.<br />but i&#039;m doing something wrong</p><p>The sentence is this:</p><p>SqlExecute(&#039;SELECT id FROM cliente WHERE contacto1 LIKE &#039;% + frm_assistencia.cl_contacto1.text%&#039;&#039;)</p><p>i can&#039;t seem to make this one work. <br />i tried using &#039; and &quot; and everything else... <br />Don&#039;t know where i am failing</p>]]></description>
			<author><![CDATA[null@example.com (VascoMorais)]]></author>
			<pubDate>Wed, 09 May 2018 00:40:47 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=25059#p25059</guid>
		</item>
		<item>
			<title><![CDATA[Re: sqlexecute]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=24541#p24541</link>
			<description><![CDATA[<div class="quotebox"><cite>mathmathou wrote:</cite><blockquote><p>Hello lhimes,</p><br /><p>Examples bellow are based on :</p><p>- a table called clients and a table called gender<br />- two fields : name, surname in table clients<br />- one field : id_gender in table gender</p><br /><p>If you want to save values from edit fields and comboboxes, you have to assign their content to a variable which must first be declared</p><div class="codebox"><pre><code>procedure Form2_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    gender_id,client_name, client_surname : String;
begin
    gender_id := IntToStr(Form2.ComboBox1.dbItemID);
    client_name := Form2.Edit1.Text;
    client_surname := Form2.Edit2.Text;
    SQLExecute(&#039;INSERT INTO clients(id_gender,name,surname) VALUES(&quot;&#039;+gender_id+&#039;&quot;,&quot;&#039;+client_name+&#039;&quot;,&quot;&#039;+client_surname+&#039;&quot;)&#039;);
end;</code></pre></div><br /><p>The syntax for performing and update needs some specific elements :<br />what fields do you want to update ?<br />in what table ?<br />under which condition ?</p><div class="codebox"><pre><code>procedure Form2_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    gender_id,client_name, client_surname : String;
begin
    gender_id := IntToStr(Form2.ComboBox1.dbItemID);
    client_name := Form2.Edit1.Text;
    client_surname := Form2.Edit2.Text;
    SQLExecute(&#039;UPDATE clients SET id_gender=&quot;&#039;+gender_id+&#039;&quot;,name = &quot;&#039;+client_name+&#039;&quot; WHERE surname=&quot;&#039;+client_surname+&#039;&quot; &#039;);
end;</code></pre></div><p>In this (silly) example, you are going to change the value of name and gender where the value of surname matches something you selected.</p><br /><p>Do you know that MVD can do all that for you without a single line of code ?</p><br /><p>Hope this helps</p><br /><br /><p>Mathias</p></blockquote></div><p>Hi Mathias,</p><p>Could you send me this example in the form of source code?&nbsp; I need to see if I can add this to a script<br />I&#039;m writing.&nbsp; &nbsp;Thanks a&nbsp; lot!!</p>]]></description>
			<author><![CDATA[null@example.com (gonpublic2k)]]></author>
			<pubDate>Mon, 19 Mar 2018 16:51:23 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=24541#p24541</guid>
		</item>
		<item>
			<title><![CDATA[Re: sqlexecute]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=15833#p15833</link>
			<description><![CDATA[<p>By the way, if you are not using variables but hard coding the values to be inserted, you don&#039;t need the + sign, this is only for concatenation when using variables.</p><p>With a variable : <br /></p><div class="codebox"><pre><code>&quot;&#039;+my_variable+&#039;&quot;</code></pre></div><p>With text directly in the query<br /></p><div class="codebox"><pre><code>&quot;my_text&quot;</code></pre></div><p>With an integer directly in the query<br /></p><div class="codebox"><pre><code>&#039;123&#039; 
Or sometimes just
123</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (mathmathou)]]></author>
			<pubDate>Thu, 11 Aug 2016 08:55:43 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=15833#p15833</guid>
		</item>
		<item>
			<title><![CDATA[Re: sqlexecute]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=15832#p15832</link>
			<description><![CDATA[<p>Hello,</p><p>I think you just forgot to had the field after the table declaration :</p><div class="codebox"><pre><code>SQLExecute(&#039;INSERT INTO table_name(field1,field2) VALUES(&quot;&#039;+value1+&#039;&quot;,&quot;&#039;+value2+&#039;&quot;)&#039;);</code></pre></div><br /><p>Math</p>]]></description>
			<author><![CDATA[null@example.com (mathmathou)]]></author>
			<pubDate>Thu, 11 Aug 2016 08:50:26 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=15832#p15832</guid>
		</item>
		<item>
			<title><![CDATA[Re: sqlexecute]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=15831#p15831</link>
			<description><![CDATA[<p>i have a table venue. i use this command&gt;;<br />sqlexecute(&#039;insert into venue values (&quot;&#039;+8 Ball+&#039;&quot;)&#039;);<br />i get an error ) expected at 5:47<br />where am i going wrong?</p><p>lee</p>]]></description>
			<author><![CDATA[null@example.com (lhimes)]]></author>
			<pubDate>Thu, 11 Aug 2016 08:44:14 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=15831#p15831</guid>
		</item>
		<item>
			<title><![CDATA[Re: sqlexecute]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=15823#p15823</link>
			<description><![CDATA[<p>Hello lhimes,</p><br /><p>You are right, teh use of variables is not mandatory and you can write :</p><div class="codebox"><pre><code>SQLExecute(&#039;UPDATE clients SET id_gender=&quot;&#039;+IntToStr(Form2.ComboBox1.dbItemID)+&#039;&quot;,name = &quot;&#039;+Form2.Edit1.Text+&#039;&quot; WHERE surname=&quot;&#039;+Form2.Edit2.Text+&#039;&quot; &#039;);</code></pre></div><p>instead of<br /></p><div class="codebox"><pre><code>SQLExecute(&#039;UPDATE clients SET id_gender=&quot;&#039;+gender_id+&#039;&quot;,name = &quot;&#039;+client_name+&#039;&quot; WHERE surname=&quot;&#039;+client_surname+&#039;&quot; &#039;);  </code></pre></div><br /><p>I personnaly use variables because I find it easier to track and it&#039;s a good habbit.</p><br /><p>Anyway, the trick is to include what you want to save bewteen<br /></p><div class="codebox"><pre><code>&quot;&#039;+</code></pre></div><p>and </p><div class="codebox"><pre><code>+&#039;&quot;</code></pre></div><br /><p>The entire SQL Query is surrounded by<br /></p><div class="codebox"><pre><code>(&#039;                     and                            &#039;);</code></pre></div><p>have a good day</p><br /><br /><p>Mathias</p>]]></description>
			<author><![CDATA[null@example.com (mathmathou)]]></author>
			<pubDate>Thu, 11 Aug 2016 02:42:12 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=15823#p15823</guid>
		</item>
		<item>
			<title><![CDATA[Re: sqlexecute]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=15822#p15822</link>
			<description><![CDATA[<p>hello Mathias</p><p>that was a big help. nowhere did i see or read anything that indicated i needed to use a variable in the statement. as for the update. an example&nbsp; would be a person with a numeric handicap in one table and is continually recalculated in a form. i have thought of calculated fields but then i run into problems when i do reports and think the update is the easiest solution</p>]]></description>
			<author><![CDATA[null@example.com (lhimes)]]></author>
			<pubDate>Thu, 11 Aug 2016 00:54:43 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=15822#p15822</guid>
		</item>
		<item>
			<title><![CDATA[Re: sqlexecute]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=15810#p15810</link>
			<description><![CDATA[<p>Hello lhimes,</p><br /><p>Examples bellow are based on :</p><p>- a table called clients and a table called gender<br />- two fields : name, surname in table clients<br />- one field : id_gender in table gender</p><br /><p>If you want to save values from edit fields and comboboxes, you have to assign their content to a variable which must first be declared</p><div class="codebox"><pre><code>procedure Form2_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    gender_id,client_name, client_surname : String;
begin
    gender_id := IntToStr(Form2.ComboBox1.dbItemID);
    client_name := Form2.Edit1.Text;
    client_surname := Form2.Edit2.Text;
    SQLExecute(&#039;INSERT INTO clients(id_gender,name,surname) VALUES(&quot;&#039;+gender_id+&#039;&quot;,&quot;&#039;+client_name+&#039;&quot;,&quot;&#039;+client_surname+&#039;&quot;)&#039;);
end;</code></pre></div><br /><p>The syntax for performing and update needs some specific elements :<br />what fields do you want to update ?<br />in what table ?<br />under which condition ?</p><div class="codebox"><pre><code>procedure Form2_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    gender_id,client_name, client_surname : String;
begin
    gender_id := IntToStr(Form2.ComboBox1.dbItemID);
    client_name := Form2.Edit1.Text;
    client_surname := Form2.Edit2.Text;
    SQLExecute(&#039;UPDATE clients SET id_gender=&quot;&#039;+gender_id+&#039;&quot;,name = &quot;&#039;+client_name+&#039;&quot; WHERE surname=&quot;&#039;+client_surname+&#039;&quot; &#039;);
end;</code></pre></div><p>In this (silly) example, you are going to change the value of name and gender where the value of surname matches something you selected.</p><br /><p>Do you know that MVD can do all that for you without a single line of code ?</p><br /><p>Hope this helps</p><br /><br /><p>Mathias</p>]]></description>
			<author><![CDATA[null@example.com (mathmathou)]]></author>
			<pubDate>Wed, 10 Aug 2016 03:55:57 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=15810#p15810</guid>
		</item>
		<item>
			<title><![CDATA[sqlexecute]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=15806#p15806</link>
			<description><![CDATA[<p>i need working sample sqlexecute update and sqlexecute insert statements using plain text, a text box and a combobox. every time i try to use one of these statements i always get a missing ) or a missing ; message and i dont seem to be able to find the problem. thanks</p><p>lee</p>]]></description>
			<author><![CDATA[null@example.com (lhimes)]]></author>
			<pubDate>Wed, 10 Aug 2016 00:58:56 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=15806#p15806</guid>
		</item>
	</channel>
</rss>
