Tempo de leitura: 1 minuto
Olá, no post de hoje iremos aprender como executar stored procedure com TCSPExec no ADVPL. Stored procedure são um conjunto de comandos SQL que podemos criar e armazenar no banco de dados para serem executadas a qualquer momento por programas externos. Em um exemplo mais objetivo, stored procedure são funções que criamos que contém comandos SQL e assim podemos chamar essas funções para execução desses comandos SQL.
No nosso exemplo nesse post a função TCSPExec em ADVPL executa uma stored procedure definida. Ela é uma das funções de acesso a banco de dados em ADVPL.
Sintaxe:
TCSPExec(cProcedure,xParamN)
Parâmetro(s):
Retorno:
Abaixo criamos uma stored procedure chamada BUSCA_TABPROTHEUS e o parâmetro chamado tabela, esse parâmetro que iremos passar para a procedure para que a mesma execute a instrução SQL SELECT * FROM SX3990 WHERE X3_ARQUIVO = @Tabela e assim no retornar a tabela do Protheus na SX3:
CREATE PROCEDURE BUSCA_TABPROTHEUS
@Tabela VARCHAR(3)
AS
SELECT * FROM SX3990 WHERE X3_ARQUIVO = @Tabela
Exemplo em ADVPL:
#include 'protheus.ch'
#include "tbiconn.ch"
/*{Protheus.doc} User Function fTCSPExec
(Essa função tem por finalidade mostrar a função de Acesso a Banco de Dados TCSPExec em ADVPL)
@type Function
@author Adilio Costa
@since 20/10/2023
@version Protheus 12.1.2210
@site https://www.protheusadvpl.com.br
@canal https://www.youtube.com/protheusadvpl
@instagram https://www.instagram.com/protheusadvpl
@Portal ProtheusAdvpl:https://hotmart.com/pt-br/marketplace/produtos/portal-protheusadvpl/O10336806O
@Post:Como Executar Stored Procedure com TCSPExec no ADVPL
*/
User Function fTCSPExec()
Local cProcedure := "BUSCA_TABPROTHEUS"
Local cParam1 := "SA1"
Local aRet := {}
Local nI
//Executa a Stored Procedure
aRet := TCSPExec(cProcedure,cParam1)
If(aRet <> nil)
For nI := 1 To Len(aRet)
conout(aRet[nI])
Next nI
Else
Conout('Erro na execução da Stored Procedure: ' + TcSqlError() )
Endif
Return
Bem, finalizamos mais um post aqui no blog. Espero que você tenha entendido, qualquer dúvida nos envie um e-mail para adiliocosta@protheusadvpl.com.br. Grande abraço e fica com Deus.
Links de referência(s):
Link permanente
I have been exploring for a little for any high-quality articles or weblog posts on this sort of house . Exploring in Yahoo I eventually stumbled upon this web site. Studying this info So i am satisfied to show that I have a very good uncanny feeling I came upon just what I needed. I so much definitely will make sure to don?t forget this site and provides it a glance on a relentless basis.
Link permanente
Things i have usually told folks is that when you are evaluating a good on the net electronics shop, there are a few aspects that you have to take into consideration. First and foremost, you want to make sure to look for a reputable as well as reliable retail store that has enjoyed great assessments and scores from other shoppers and industry people. This will make sure that you are getting along with a well-known store that gives good assistance and assistance to it’s patrons. Thank you for sharing your ideas on this web site.
Link permanente
I can’t express how much I appreciate the effort the author has put into creating this remarkable piece of content. The clarity of the writing, the depth of analysis, and the plethora of information presented are simply astonishing. His zeal for the subject is apparent, and it has certainly struck a chord with me. Thank you, author, for providing your insights and enriching our lives with this exceptional article!
Link permanente
Good day! I know this is kinda off topic but I’d figured I’d ask. Would you be interested in exchanging links or maybe guest writing a blog article or vice-versa? My site addresses a lot of the same topics as yours and I believe we could greatly benefit from each other. If you’re interested feel free to shoot me an e-mail. I look forward to hearing from you! Wonderful blog by the way!
Link permanente
This Blog is looking good and very well written and keep share it
Link permanente
https://emilion90wu.pennywiki.com/3551444/indicators_on_korean_massage_atlanta_you_should_know
Link permanente
https://edgarl7nh4.pointblog.net/top-healthy-massage-bangkok-secrets-63368932
Link permanente
https://nanobookmarking.com/story15837282/everything-about-chinese-medicine-cupping
Link permanente
Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You clearly know what youre talking about, why waste your intelligence on just posting videos to your weblog when you could be giving us something enlightening to read?
Link permanente
http://www.mybudgetart.com.au is Australia’s Trusted Online Wall Art Canvas Prints Store. We are selling art online since 2008. We offer 2000+ artwork designs, up-to 50 OFF store-wide, FREE Delivery Australia & New Zealand, and World-wide shipping to 50 plus countries.
Link permanente
https://manuelt6456.ezblogz.com/54184998/what-does-chinese-medicine-cupping-mean
Link permanente
https://sethw9864.estate-blog.com/22911934/an-unbiased-view-of-chinese-medicine-bloating
Link permanente
https://andres5yzx1.blog-ezine.com/22969458/the-definitive-guide-to-healthy-massage-los-angeles
Link permanente
Audio started playing any time I opened this site, so irritating!
Link permanente
https://gunner6xwsq.creacionblog.com/22859897/helping-the-others-realize-the-advantages-of-massage-moreno-valley
Link permanente
https://titus81h4j.rimmablog.com/22838422/the-5-second-trick-for-chinese-medicine-cooling-foods
Link permanente
https://edwinb9730.blogunteer.com/22831987/indicators-on-chinese-medicine-books-you-should-know
Link permanente
https://nathanielo012clj5.life3dblog.com/profile
Link permanente
Great beat ! I wish to apprentice at the same time as you amend your website, how could i subscribe for a blog website? The account helped me a acceptable deal. I have been tiny bit acquainted of this your broadcast provided bright clear concept
Link permanente
https://hectoro0yv0.popup-blog.com/22814275/helping-the-others-realize-the-advantages-of-healthy-massage-winnetka
Link permanente
Royal Chicago Limo Service is a premier provider of luxury transportation services. We offer a wide range of vehicles, from classic limousines to modern luxury sedans, to ensure that you arrive in style and comfort. Our experienced chauffeurs are highly trained and knowledgeable about the local area, so you can rest assured that you will be taken to your destination safely and on time. 708 980 6881
Link permanente
https://tyson80853.designertoblog.com/53838842/5-simple-techniques-for-thailand-massage-bangkok
Link permanente
https://randally630zwx7.rimmablog.com/22724259/not-known-details-about-thailand-massage
Link permanente
https://dantef67r9.alltdesign.com/not-known-details-about-thailand-massage-42626096
Link permanente
https://felixfkll78990.widblog.com/77156457/rumored-buzz-on-chinese-medical-massage
Link permanente
https://damienvur89.sharebyblog.com/22858022/considerations-to-know-about-massage-therapy-business-plan-example
Link permanente
https://anderson91d3f.answerblogs.com/23035504/the-5-second-trick-for-chinese-medicine-cooling-foods
Link permanente
I think one of your advertisements triggered my internet browser to resize, you might want to put that on your blacklist.
Link permanente
I appreciate, cause I found exactly what I was looking for. You have ended my four day long hunt! God Bless you man. Have a nice day. Bye
Link permanente
https://ariannad680zyx1.bloggosite.com/profile
Link permanente
https://normanj678sqn7.prublogger.com/profile
Link permanente
https://bookmarkrange.com/story16732401/the-basic-principles-of-taiwan-medical-massage
Link permanente
https://jaiden57a1w.jiliblog.com/80354887/top-business-trip-massage-secrets
Link permanente
One thing I would like to comment on is that weightloss routine fast can be performed by the perfect diet and exercise. Someone’s size not only affects appearance, but also the complete quality of life. Self-esteem, melancholy, health risks, and physical skills are disturbed in excess weight. It is possible to just make everything right and still gain. In such a circumstance, a condition may be the offender. While a lot of food rather than enough exercise are usually to blame, common medical ailments and popular prescriptions might greatly increase size. Kudos for your post here.
Link permanente
I have been absent for a while, but now I remember why I used to love this web site. Thanks , I will try and check back more often. How frequently you update your web site?
Link permanente
What i don’t realize is in truth how you’re now not actually a lot more well-liked than you may be right now. You’re very intelligent. You realize therefore considerably with regards to this matter, produced me in my view believe it from numerous varied angles. Its like men and women don’t seem to be interested except it is something to accomplish with Girl gaga! Your own stuffs excellent. Always take care of it up!
Link permanente
excellent points altogether, you just gained a new reader. What would you recommend about your post that you made some days ago? Any positive?
Link permanente
https://trevorj7890.weblogco.com/22911625/chinese-medicine-blood-pressure-for-dummies
Link permanente
https://andersonopoj55555.bloggip.com/22760538/not-known-facts-about-us-massage-service
Link permanente
https://isaacy478ttq9.blogsidea.com/profile
Link permanente
https://letsbookmarkit.com/story15819498/how-chinese-medicine-journal-can-save-you-time-stress-and-money
Link permanente
https://davet356omj6.wikiexcerpt.com/user
Link permanente
https://emilio49371.link4blogs.com/44926126/what-does-chinese-medicine-cupping-mean
Link permanente
Wonderful blog! Do you have any recommendations for aspiring writers? I’m planning to start my own website soon but I’m a little lost on everything. Would you advise starting with a free platform like WordPress or go for a paid option? There are so many choices out there that I’m completely overwhelmed .. Any suggestions? Thanks a lot!
Link permanente
https://jeffreya44he.shivawiki.com/6243166/korean_massage_stick_things_to_know_before_you_buy
Link permanente
https://marioo789s.blogsvirals.com/22820145/an-unbiased-view-of-korean-massage-spa-irvine
Link permanente
https://devinh5555.bloggazzo.com/22869266/facts-about-chinese-medicine-chart-revealed
Link permanente
Thanks for any other informative website. Where else may just I get that type of information written in such a perfect approach? I’ve a project that I’m just now working on, and I’ve been at the glance out for such information.
Link permanente
https://martinflon89023.blog5.net/63949413/rumored-buzz-on-chinese-medical-massage
Link permanente
https://simon57s8o.bligblogging.com/23035264/examine-this-report-on-business-trip-massage
Link permanente
This Blog looks good and is very well written and keep sharing it
https://wantyouknow.com/tamilrockers/
Link permanente
https://franciscoq9630.ambien-blog.com/28529272/examine-this-report-on-chinese-medicine-bloating
Link permanente
Thanks for this wonderful article. One other thing is that most digital cameras can come equipped with a new zoom lens so that more or less of that scene for being included through ‘zooming’ in and out. These kind of changes in {focus|focusing|concentration|target|the a**** length are reflected while in the viewfinder and on big display screen at the back of the particular camera.
Link permanente
I would love to add that when you do not actually have an insurance policy otherwise you do not form part of any group insurance, you will well make use of seeking assistance from a health agent. Self-employed or those with medical conditions typically seek the help of any health insurance brokerage service. Thanks for your short article.
Link permanente
I’m not sure exactly why but this blog is loading incredibly slow for me. Is anyone else having this problem or is it a problem on my end? I’ll check back later on and see if the problem still exists.
Link permanente
One thing is that often one of the most prevalent incentives for using your credit cards is a cash-back or even rebate present. Generally, you’ll have access to 1-5 back on various expenditures. Depending on the credit cards, you may get 1 in return on most buying, and 5 back again on acquisitions made on convenience stores, filling stations, grocery stores in addition to ‘member merchants’.
Link permanente
https://julius9jq39.actoblog.com/23116181/the-2-minute-rule-for-chinese-medicine-cooker
Link permanente
https://griffin331a9.bloginder.com/23102190/the-5-second-trick-for-massage-chinese-therapy-freehold
Link permanente
https://emilen023iji5.weblogco.com/profile
Link permanente
https://holdenz7384.bloggazza.com/22854903/how-chinese-medicine-chicago-can-save-you-time-stress-and-money
Link permanente
https://edwin43950.bloguetechno.com/helping-the-others-realize-the-advantages-of-thailand-massage-cost-58024902
Link permanente
I was very pleased to seek out this web-site.I wished to thanks on your time for this wonderful learn!! I positively having fun with each little little bit of it and I have you bookmarked to take a look at new stuff you blog post.
Link permanente
I have been browsing online more than 3 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. Personally, if all website owners and bloggers made good content as you did, the internet will be a lot more useful than ever before.
Link permanente
https://knoxh6655.therainblog.com/22859120/what-does-chinese-medicine-cupping-mean
Link permanente
https://beauf6n67.blogvivi.com/23049841/a-review-of-healthy-massage-elmsford
Link permanente
https://judaha9739.review-blogger.com/44943931/5-simple-statements-about-chinese-medicine-cupping-explained
Link permanente
I love your wordpress web template, wherever do you download it from?
Link permanente
bookdecorfactory.com is a Global Trusted Online Fake Books Decor Store. We sell high quality budget price fake books decoration, Faux Books Decor. We offer FREE shipping across US, UK, AUS, NZ, Russia, Europe, Asia and deliver 100+ countries. Our delivery takes around 12 to 20 Days. We started our online business journey in Sydney, Australia and have been selling all sorts of home decor and art styles since 2008.
Link permanente
https://myfirstbookmark.com/story15826668/the-2-minute-rule-for-korean-massage-coquitlam
Link permanente
https://keegan38150.aioblogs.com/76418407/chinese-medicine-books-no-further-a-mystery
Link permanente
https://archer0l778.loginblogin.com/28652895/the-smart-trick-of-chinese-medicine-certificate-that-nobody-is-discussing
Link permanente
Good day! I know this is kinda off topic but I was wondering if you knew where I could locate a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having problems finding one? Thanks a lot!
Link permanente
https://public.sitejot.com/rotatetrunk9.html