If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > SQL Data Manager vs Query Analyzer

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-12-04, 08:11
frasse7 frasse7 is offline
Registered User
 
Join Date: Feb 2004
Posts: 2
SQL Data Manager vs Query Analyzer

What can I do in SQL Data Manager? I thought it was something like the Query Analyzer (MSSQL), but I can't do anything in the SQL Data Manager.

If I write this in Query Analyzer it works great:


declare @name varchar(50)
set @name = 'risktolerance'
select * from profiledata where profilename = @name


If I write something similar in SQL Data Manager I get errors on the first row:


declare :name varchar(50);
set :name = 'James';
select * from person where first_name = :name;


Is it impossible to write anything but simple select statements? How do I test my scripts without having to write a complete stored procedure?

Yes, I am a fresh newbie, who is trying hard to like Pervasive.
Please let me know how to work with pervasive, thanks.
Reply With Quote
  #2 (permalink)  
Old 02-12-04, 09:41
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
You'll need to create a procedure.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 02-12-04, 11:30
Tim Meiers Tim Meiers is offline
Registered User
 
Join Date: Jul 2003
Posts: 18
Re: SQL Data Manager vs Query Analyzer

Hello,

To answer your direct question, yes, to declare a variable you must do so within a stored procedure or a stored trigger.

A broader answer is that SQL Data Manager provides a great deal of capability. For Pervasive.SQL V8, the documentation for SQL Data Manager was substantially enhanced. In it, you will find sections on the Query Pane and the Query Builder, as well as extensive tasks on how to use the utility.

Refer to the chapter SQL Data Manager in the Pervasive.SQL User's Guide.

You may access the online User's Guide in HTML format from here:
http://www.pervasive.com/library/doc...e/sug7toc.html

If you prefer, you may download a PDF or CHM version of the User's Guide from here:
http://www.pervasive.com/support/tec...sqlv8_docs.asp

For information about stored procedures, refer to the SQL Engine Reference. You may access it online here:
http://www.pervasive.com/library/doc...sqlreftoc.html

Regards,
Tim Meiers
Pervasive Technical Publications

Quote:
Originally posted by frasse7
What can I do in SQL Data Manager? I thought it was something like the Query Analyzer (MSSQL), but I can't do anything in the SQL Data Manager.

If I write this in Query Analyzer it works great:


declare @name varchar(50)
set @name = 'risktolerance'
select * from profiledata where profilename = @name


If I write something similar in SQL Data Manager I get errors on the first row:


declare :name varchar(50);
set :name = 'James';
select * from person where first_name = :name;


Is it impossible to write anything but simple select statements? How do I test my scripts without having to write a complete stored procedure?

Yes, I am a fresh newbie, who is trying hard to like Pervasive.
Please let me know how to work with pervasive, thanks.
Reply With Quote
  #4 (permalink)  
Old 02-13-04, 02:13
Dilyias Dilyias is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
Re: SQL Data Manager vs Query Analyzer

Quote:
Originally posted by frasse7
Is it impossible to write anything but simple select statements? How do I test my scripts without having to write a complete stored procedure?
I understand your frustrations when comparing QA to SQL DM.

I really only have experience with 2000i, although I am beginning to experiment with V85.

What I've found helpful is to have your DROP, CREATE, and "CALL storedproc()" test calls all in the same SQL script (separated by #'s or whatever you use) for debugging.

It's not quite as intuitive as QA but it gets the job done.

Hmm, perhaps I should create a better SQL DM for Pervasive that creates a temporary Stored Proc behind the scenes for you and runs it if it detects variables, and one that doesn't freeze the entire window when running a query (i.e. the bottom pane's results are populated by a separate thread like QA), one that runs when you press 'F5'...If only I had the time. Maybe all of this has improved in V85.

Last edited by Dilyias; 02-13-04 at 02:58.
Reply With Quote
  #5 (permalink)  
Old 02-13-04, 04:22
frasse7 frasse7 is offline
Registered User
 
Join Date: Feb 2004
Posts: 2
OK, just have to live with it then. Drop, create and call.

When you write the new SQL DM could you include scrolling with the mouse? And the F5 key is a must.

thanks
Reply With Quote
  #6 (permalink)  
Old 02-13-04, 10:05
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
F5 is used to refresh in SQL DM. You can run the queries using short cuts though. For example, Ctrl+Shift+R runs the query to Grid. Check the menu Tools then Query for the other options.

Also, why use F5? Delphi and C++ Builder use F9 to run.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #7 (permalink)  
Old 02-13-04, 12:49
Dilyias Dilyias is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
F5 is just a carry over from QA. F5 in qbasic, visual basic, .Net, Ctrl-F5 in VC++. Ok, so it is a MS thing.

I think I better learn the V85 DM first as it seemed to have improved since 2000i. For example, Ctrl+Shift+T does nothing in my 2000i DM.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On