Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored procedures and MS SQL or PostgreSQL
Message
From
03/01/2019 19:38:00
 
 
To
03/01/2019 18:04:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01664815
Message ID:
01665100
Views:
57
Decide first on how many/which backends you need to support/for dev safety.
If staying within SQL, ORM or admin tools talking to many backends might give hints on different syntax. Dotnet - as you seem to target dotnet - just the data layers there might give you idea on syntax differences.

If you are certain to stay within a single backend, switching from SQL might be easier for non DB devs.
C# only for MSSQL a real option, Java for more than one backend.
Javascript and Python "nicer" languages to my taste, but I' go that way only if the language was used elsewhere in the stack - either in a Python web backend or Javscript somewhere in the app layer.

In some stacks using Javascript (Node.JS backend firing Rest backend or GraphQL, React Native, Nativescript, Cordova, Java switching from Nashorn JS engine to Node on GraalVM) comes easy/natural, dunno how well JS is supported in Dotnet/MS arena, but that is probably me, as I don't follow MS as closely as 20 years ago. They seem to favor JS with UWP, at least developed dynamic layers with Ironpython/IronJS.
No idea what current best practices are there to run "modern" JS - some kind of Node integration or own tool...



>What would I search for to look up the syntax for the stored procedure language? And short question would be, other than creating a query, does the language have the ability to scan the result set or anything?
>
>Thanks.
>
>Albert
>
>>If I'm understanding your question correctly, stored procs are written in some form of SQL or T-SQL and look amazingly like what you're used to with VFP, with some minor 'packaging' around them.
>>
>>USE [database]
>>
>>(Create)
>>ALTER PROCEDURE [dbo].[ProcName]
>> @UserName varchar(25),
>> @Name varchar(75) output,
>> @Phone varchar(15) output,
>> @Ext varchar(10) output,
>> @Email varchar(100) output
>>
>>AS
>>BEGIN
>> SET NOCOUNT ON;
>> select @Name = ltrim(rtrim(first_name)) + ' ' + ltrim(rtrim(last_name)),
>> @Phone = substring(Phone,1,3) + '-' + SUBSTRING(Phone, 4,3) + '-' + substring(phone,7,4),
>> @Ext = Ext,
>> @Email = email
>> from tablename
>> where UserName = @UserName
>>
>>END
>>
>>That's a very simple stored proc. Others can get quite involved
>>
>>
>>>Kinda a random question but it has crossed my mind as I have worked through the many posts - what are stored procedures written in when they are contained within SQL Server or PostgreSQL server? I would assume it is some sort of function call that runs some sort of script?
>>>
>>>Albert
Previous
Reply
Map
View

Click here to load this message in the networking platform