UPDATE...SET...FROM

Share your SQL code snippets for SQL Prompt!

Moderators: David Atkinson, Anu Deshpande, Luke Jefferson, Paul Stephenson

UPDATE...SET...FROM

Postby jamiet » Mon Jan 29, 2007 7:06 pm

I've looked within the options panel for a way of exporting snippets but I can't find a way. So I might as well just post it up here in freetext:

Snippet: usf
Description: UPDATE...SET...FROM
Category: DDL
Code:
UPDATE
SET
FROM



I was quite surprised there wasn't one there for UPDATE already actually. Anyway, its in mine now!!!

-Jamie

P.S. Is there a way to export/import snippets?
jamiet
 
Posts: 8
Joined: Mon Jan 29, 2007 7:00 pm

Postby massybird » Thu Feb 15, 2007 4:29 pm

The only thing I would add to your snippet would be:

UPDATE $CURSOR$ SET

so the cursor is positioned right after the UPDATE keyword when SQL Prompt resolves the snippet. That way you avoid moving the cursor yourself to type in the name of the table you're updating. Good suggestion on import/export of snippets.
massybird
 
Posts: 4
Joined: Wed Feb 14, 2007 2:41 pm

setting cursor

Postby nico » Tue Feb 20, 2007 4:27 am

Hi massybird,

I tried to set the cursor in my snippet using the $CURSOR$ statement. But upon testing it in the query analyzer, it only showed the text itself. Hope you can help me out.

Thanks,

Nico
nico
 
Posts: 3
Joined: Tue Feb 20, 2007 4:03 am


Return to SQL Prompt code snippets

Who is online

Users browsing this forum: No registered users and 0 guests

cron