PLSQL Developer bind variables from GUI like as Oracle SQL Developer - plsqldeveloper

How can I bind variables in PLSQL Developer from GUI like as Oracle PL/SQL Developer?
Example: select :variable from dual;
Thanks!

You can execute queries with bind variables inside the "Test Window".
It isn't only for debugging: if you type and execute a query, a new tab showing the query results will appear.
The result grid is not as smart as the grid you can use in regular SQL Windows, but it does the job.
I did ask multiple times to the Pl/SQL Developers to add support for bind variables to the regular SQL Window but it seems they aren't much interested in doing it

Related

Is it Possible to get the view creation statement in sql server using sql query

Is it possible to get the view creation statement writing any query in sql sever 2008
Actually i want to copy the views from one database to another database
thanks
Do you have SSMS? You have the option to generate scripts for all objects in a database. You can limit it to just the views.
Right click on the node for the specific database in Object Explorer.
Select Tasks
Under Tasks, select Generate Scripts
Execute the wizard, selecting the options suited for your task.
This will generate a script for all your views, or allow you to select the specific views you're interested in.
#Sashenka's answer is correct, but this will let you script more than one view at a time.
In SSMS,
Right click the view
Select Script view as
Select CREATE To
Choose New Query Editor Window
You can then copy the script and modify it for your new Database.
Easiest way is to use SQL Compare, but you can also do this in SQL Server Management Studio in a similar fashion to what I describe in this blog post.
In short, open object explorer details, multiselect all your views, and script as Drop and Create from the context menu. You can now apply this script on your second server.

sql debugging in vs2010 confusion

After much work i've configured my machine (win 7 x64, VS2010, SQL 2008 R2) to be able to debug stored procedures locally from within visual studio. My question is about how the debugging context is supposed to switch as you debug.
an example:
when debugging and I call another vb class the debugger follows and jumps to that class for me to step through. when I hit a sql call is there a way to tell the debugger to follow it there too?
currently the only way I can debug a stored procedure is to right click it and choose "step into" and provide values. Those values I have to determine by running my app, making edits, and writing down my param values I was going to pass into the stored procedure. Then going back and stepping into the stored procedure with those values allows me to track and use intellesense to debug the sql stuff.
What i'm looking for though is to have the debugger do the switching for me. So I don't have to do as much work to step through stored procedures. When I run my application and open one of my stored procedures to view the breakpoint symbols are not loaded but it does say it has auto-attached to the sql process and everything.
Wasn't sure if this was how sql debugging was supposed to go or if I did something incorrectly. Figured someone here might know what was going on. Thanks for looking!
my target framework was dot net 4 client profile. When I swapped to full dot net 4 framework and rebuilt everything started working like I thought it should. My only guess is that some of the sql-clr debugging stuff is trimmed out of the client profile?
Try the following.
The standard workflow to debug a CLR SQL assembly is the following…
Right-Click the project and select ‘Deploy’
Debug | Attach to Process…
Select the Process ‘sqlservr.exe’ and make sure it is the one with a Type of ‘T-SQL, Managed, x86 or x64’
Press the Attach Button

Can conditional breakpoints be set while debugging in SSMS?

I've just begun using breakpoints to debug a T-SQL stored procedure in Management Studio (SQL Server 2008). I notice that the breakpoints window has a condition column:
But I can't find any way to actually specify a condition on a breakpoint, not via the Debug menu, not via a context menu on the breakpoint or within the breakpoint window, etc.
Is there a way to use conditional breakpoints in SSMS, or does that column exist for some future version?
No, they can't. From this site, you can see some of the other limitations also.
Here's the relevant quote:
The T-SQL debugger does not support the Microsoft Visual Studio features of setting breakpoint conditions or hit counts.
I have found a workaround:
in case my condition is #IterationNR = 18 I have stated
IF #IterationNR = 18
SET #IterationNR = #IterationNR
and set breakpoint to line with SET command...
Another alternative would be to create a C# or VB .NET application that uses ADO .NET to execute the SQL query that you were executing on SQL Server Management Studio, and set the conditional or hit-count breakpoint within Visual Studio on the SqlCommand object.

How and where in VS2008 I can see my Linq commands being translate into Transact-SQL statements?

Linq commands are translated into transact-sql statements. I've VS2008 professional. How and where can I see how this majic happens? (by debugging?)
EDIT
Let's say I have this
var allProducts = db.Products;
I guess this will be translate by
SELECT * FROM Products
Where can I look at to see that? For instance, when I debug my code, I can see on the bottom are changing value each time I press f10. Is there something like that in vs2008 for linq command?
You can use the Log property on the DataContext object.
You can configure VS to step into .NET source code:
Configuring Visual Studio to Debug .NET Framework Source Code

Does sql profiler show you the paramater values that were passed in?

I'm using this 3rd party sql tracing application because I have sql server express 2008 installed (just a trial version).
It only shows the sql passed into the server, with the parameters like #p1 and not that actual value of the parameter, which to me is not all that usefull.
Does the built in sql profiler show you the actual values the .net web app is passing in like '2342' or a = 200 ?
yes, it shows the query with the parameters already substituted. When I debug, I usually just copy the SQL from the profiler and paste it into Management Studio and run it.
It can. When you define a profile template, you can specify which sql "things" you want to see and which columns (information) you want to see for each "thing". So if you aren't seeing the parameters, you may have to modify the profile template you are using.